KiCad PCB EDA Suite
Loading...
Searching...
No Matches
gal_modern.cpp File Reference
#include <gal/gal_modern.h>
#include <gal/opengl/gpu_oom_error.h>
#include <rhi/rhi_device.h>
#include <rhi/rhi_device_proxy.h>
#include <rhi/rhi_buffer.h>
#include <rhi/rhi_upload_commands.h>
#include <rhi/rhi_control_commands.h>
#include <rhi/rhi_projection.h>
#include <rhi/rhi_cull_runs.h>
#include <rhi/render_thread.h>
#include <rhi/rhi_platform_device.h>
#include <rhi/rhi_glyph_atlas.h>
#include <bitmap_base.h>
#include <gal/bitmap_texture.h>
#include <bezier_curves.h>
#include <font/glyph_types.h>
#include <geometry/shape_ellipse.h>
#include <geometry/shape_line_chain.h>
#include <geometry/shape_poly_set.h>
#include <hash.h>
#include <math/util.h>
#include <mmh3_hash.h>
#include <algorithm>
#include <array>
#include <cstring>
#include <exception>
#include <iterator>
#include <tuple>
#include <atomic>
#include <limits>
#include <memory>
#include <mutex>
#include <cmath>
#include <utility>
#include <core/utf8.h>
#include <trace_helpers.h>
#include <wx/log.h>
#include "opengl/gl_resources.h"

Go to the source code of this file.

Functions

static uint8_t packColorChannel (double aValue)
 
static void hashBytes (MMH3_HASH &aHash, const void *aData, size_t aSize)
 
static std::array< uint64_t, 2 > hashDigest (MMH3_HASH &aHash)
 
template<typename T, typename COUNT>
static void updateRuns (std::vector< RHI_RUN_BOUNDS > &aRuns, const std::vector< T > &aElements, const std::vector< std::pair< uint32_t, uint32_t > > &aDirty, size_t aCounted, bool aAll, size_t aRunLength, COUNT aCount)
 
static uint16_t relativeDepth (uint16_t aDepth, float aBase)
 
template<typename POOL>
static void hashPool (MMH3_HASH &aHash, const POOL &aPool, const std::vector< LAYER_RANGE > &aRanges)
 
template<typename IT>
static void drawPolylineSegments (GAL_MODERN &aGal, IT aBegin, IT aEnd)
 
template<typename IT>
static SHAPE_LINE_CHAIN roundedOutline (IT aBegin, IT aEnd)
 
static RHI_INSTANCE deadInstance ()
 
static RHI_VERTEX deadVertex ()
 
static void fillDead (RHI_INSTANCE *aFirst, uint32_t aCount)
 
static void fillDead (RHI_VERTEX *aFirst, uint32_t aCount)
 
template<typename ARENA>
static void markSceneDirty (ARENA &aArena, uint32_t aStart, uint32_t aCount)
 
static size_t retainedPrefixHash (const RETAINED_GROUP_ORDER &aOrder)
 
template<typename GROUP, typename INSTANCE_FN, typename VERTEX_FN>
static void forEachElement (GROUP &aGroup, INSTANCE_FN aInstance, VERTEX_FN aVertex)
 
static void toFloat4 (float *aDest, const COLOR4D &aColor)
 
template<typename QUADS>
static void appendBitmapDraws (FRAME_DRAW_DESC &aDesc, const QUADS &aQuads)
 
template<typename POOL>
static void appendPoolRanges (FRAME_DRAW_DESC &aDesc, const POOL &aPool, const std::vector< LAYER_RANGE > &aRanges, std::vector< LAYER_RANGE > &aDest, size_t aAt, uint32_t aBitmapBase)
 
static void buildDescForPool (FRAME_DRAW_DESC &aDesc, const auto &aPool, const std::vector< LAYER_RANGE > &aRanges)
 

Function Documentation

◆ appendBitmapDraws()

template<typename QUADS>
static void appendBitmapDraws ( FRAME_DRAW_DESC & aDesc,
const QUADS & aQuads )
static

◆ appendPoolRanges()

template<typename POOL>
static void appendPoolRanges ( FRAME_DRAW_DESC & aDesc,
const POOL & aPool,
const std::vector< LAYER_RANGE > & aRanges,
std::vector< LAYER_RANGE > & aDest,
size_t aAt,
uint32_t aBitmapBase )
static

◆ buildDescForPool()

◆ deadInstance()

static RHI_INSTANCE deadInstance ( )
static

Definition at line 2422 of file gal_modern.cpp.

References RHI_INSTANCE::scaleX, RHI_INSTANCE::scaleY, and RHI_INSTANCE::SetColor().

Referenced by fillDead().

◆ deadVertex()

static RHI_VERTEX deadVertex ( )
static

Definition at line 2433 of file gal_modern.cpp.

References RHI_VERTEX::SetColor().

Referenced by fillDead().

◆ drawPolylineSegments()

template<typename IT>
static void drawPolylineSegments ( GAL_MODERN & aGal,
IT aBegin,
IT aEnd )
static

◆ fillDead() [1/2]

static void fillDead ( RHI_INSTANCE * aFirst,
uint32_t aCount )
static

Definition at line 2441 of file gal_modern.cpp.

References deadInstance().

Referenced by KIGFX::GAL_MODERN::freeSceneSlot().

◆ fillDead() [2/2]

static void fillDead ( RHI_VERTEX * aFirst,
uint32_t aCount )
static

Definition at line 2447 of file gal_modern.cpp.

References deadVertex().

◆ forEachElement()

template<typename GROUP, typename INSTANCE_FN, typename VERTEX_FN>
static void forEachElement ( GROUP & aGroup,
INSTANCE_FN aInstance,
VERTEX_FN aVertex )
static

◆ hashBytes()

static void hashBytes ( MMH3_HASH & aHash,
const void * aData,
size_t aSize )
static

◆ hashDigest()

static std::array< uint64_t, 2 > hashDigest ( MMH3_HASH & aHash)
static

◆ hashPool()

template<typename POOL>
static void hashPool ( MMH3_HASH & aHash,
const POOL & aPool,
const std::vector< LAYER_RANGE > & aRanges )
static

Definition at line 131 of file gal_modern.cpp.

References MMH3_HASH::add(), and hashBytes().

Referenced by KIGFX::GAL_MODERN::Flush().

◆ markSceneDirty()

template<typename ARENA>
static void markSceneDirty ( ARENA & aArena,
uint32_t aStart,
uint32_t aCount )
static

◆ packColorChannel()

◆ relativeDepth()

static uint16_t relativeDepth ( uint16_t aDepth,
float aBase )
static

◆ retainedPrefixHash()

◆ roundedOutline()

template<typename IT>
static SHAPE_LINE_CHAIN roundedOutline ( IT aBegin,
IT aEnd )
static

◆ toFloat4()

◆ updateRuns()

template<typename T, typename COUNT>
static void updateRuns ( std::vector< RHI_RUN_BOUNDS > & aRuns,
const std::vector< T > & aElements,
const std::vector< std::pair< uint32_t, uint32_t > > & aDirty,
size_t aCounted,
bool aAll,
size_t aRunLength,
COUNT aCount )
static

Definition at line 90 of file gal_modern.cpp.

References COUNT, and end.

Referenced by KIGFX::GAL_MODERN::Flush(), and KIGFX::GAL_MODERN::updateSceneCullRuns().