|
KiCad PCB EDA Suite
|
GAL that turns drawing commands into instanced primitives for the RHI device. More...
#include <gal_modern.h>
Classes | |
| struct | BITMAP_CACHE_ENTRY |
| GPU texture per bitmap, keyed on the image KIID so redrawing reuses the upload. More... | |
| struct | BITMAP_QUAD |
| struct | GAL_GROUP |
| struct | GEOMETRY_BUFFER_SET |
| struct | PATCH_SPAN |
| Half-open index span touched by patches since the last upload, empty when end <= begin. More... | |
| struct | POLARITY_MARK |
| A point in a pool's drawing order where the polarity of what is drawn changes. More... | |
| struct | SCENE_ARENA |
| Retained scene arena holding one slot per placed group, patched in place so changing one item uploads only that item. More... | |
| struct | SCENE_LAYER |
| struct | STATIC_GROUP_SLOT |
| Where a cached group landed in the static pool at the last full build, so a colour or depth change is patched in place instead of rebuilding and uploading the whole board. More... | |
Public Types | |
| using | SHAPE_INSTANCES = std::array<std::vector<RHI_INSTANCE>, RHI_INSTANCED_SHAPES> |
| Instances of each instanced shape, indexed by RHI_SHAPE. | |
Public Member Functions | |
| GAL_MODERN (GAL_DISPLAY_OPTIONS &aOptions, RHI_DEVICE_PROXY &aDeviceProxy) | |
| ~GAL_MODERN () override | |
| bool | IsInitialized () const override |
| Return the initialization status for the canvas. | |
| bool | IsDrawingMode () const override |
| Return true if the GAL is inside a BeginDrawing/EndDrawing pair. | |
| bool | HasStaticRebuildPending () const override |
| Return true if the backend dropped its cached geometry and VIEW must draw the cached layers again, even when its own TARGET_CACHED is clean. | |
| bool | HasRetainedScene () const override |
| Return true if the backend keeps cached groups in a persistent scene that it patches in place, so one changed item does not make VIEW emit every cached layer again. | |
| bool | RefillsNonCachedTargets () const override |
| Return true if the backend empties every non-cached target each frame, so VIEW must emit them again even when clean. | |
| bool | SupportsTypedPads () const override |
| Return true if DrawPad() renders every standard pad shape. | |
| bool | UsesPolygonTriangulationCache () const override |
| Return true if filled polygons are drawn from the SHAPE_POLY_SET triangulation cache, which painters should then fill before calling DrawPolygon. | |
| void | BeginDrawing () override |
| Start/end drawing functions, draw calls can be only made in between the calls to BeginDrawing()/EndDrawing(). | |
| void | EndDrawing () override |
| End the drawing, needs to be called for every new frame. | |
| void | ResizeScreen (int aWidth, int aHeight) override |
| Resize the canvas. | |
| void | Flush () override |
| Force all remaining objects to be drawn. | |
| void | ClearScreen () override |
| Clear the screen. | |
| void | SetTarget (RENDER_TARGET aTarget) override |
| Set the target for rendering. | |
| RENDER_TARGET | GetTarget () const override |
| Get the currently used target for rendering. | |
| void | ClearTarget (RENDER_TARGET aTarget) override |
| Clear the target for rendering. | |
| void | StartDiffLayer () override |
| Begins rendering of a differential layer. | |
| void | EndDiffLayer () override |
| Ends rendering of a differential layer. | |
| void | StartNegativesLayer () override |
| Begins rendering in a new layer that will be copied to the main layer in EndNegativesLayer(). | |
| void | EndNegativesLayer () override |
| Ends rendering of a negatives layer and draws it to the main layer. | |
| void | SetNegativeDrawMode (bool aSetting) override |
| Set negative draw mode in the renderer. | |
| void | SetScreenSpaceMode (bool aEnabled) override |
| Store sizes of what is drawn next in pixels rather than world units, so it keeps its pixel size through a zoom without being drawn again. | |
| bool | SupportsStrokePixelPad () const override |
| Tell whether strokes can carry part of their width in pixels, see SetStrokePixelPad(). | |
| bool | SupportsStrokeLengthPad () const override |
| Tell whether strokes can be longer by a number of pixels, see SetStrokeLengthPad(). | |
| void | SetStrokeLengthPad (double aPixels) override |
| Extend every stroke drawn from now on by aPixels at each end. | |
| void | SetStrokePixelPad (double aPixels) override |
| Widen every stroke, circle and pad drawn from now on by aPixels. | |
| bool | SupportsStrokeLevelOfDetail () const override |
| Tell whether strokes can carry a level of detail, see SetStrokeLevelOfDetail(). | |
| void | SetStrokeLevelOfDetail (double aLod) override |
| Show every stroke drawn from now on only while the view scale is above aLod, as VIEW::IsShownAtScale() decides. | |
| void | BitmapText (const wxString &aText, const VECTOR2I &aPosition, const EDA_ANGLE &aAngle) override |
| Draw a text using a bitmap font. | |
| void | SetBitmapGlyphs (bool aEnable) |
| Draw bitmap text as one font atlas glyph per quad, for editors whose track shader supports it. | |
| void | DrawGrid () override |
| Draw the grid. | |
| void | DrawCursor (const VECTOR2D &aCursorPosition) override |
| Draw the cursor. | |
| int | BeginGroup () override |
| Begin a group. | |
| void | EndGroup () override |
| End the group. | |
| std::array< uint64_t, 2 > | GroupContentFingerprint (int aGroupNumber) const override |
| void | DrawGroup (int aGroupNumber) override |
| Draw the stored group. | |
| void | ChangeGroupColor (int aGroupNumber, const COLOR4D &aNewColor) override |
| Change the color used to draw the group. | |
| void | ChangeGroupDepth (int aGroupNumber, int aDepth) override |
| Change the depth (Z-axis position) of the group. | |
| void | ChangeGroupUndimmed (int aGroupNumber, bool aUndimmed) override |
| Exempt the group from its layer's dim, see SetSceneLayerDim(). | |
| void | DeleteGroup (int aGroupNumber) override |
| Delete the group from the memory. | |
| void | ClearCache () override |
| Delete all data created during caching of graphic items. | |
| void | SetSceneLayerState (int aLayer, int aOrder, bool aVisible, bool aHasNegatives) override |
| Describe a cached layer to the retained scene. | |
| void | SetSceneLayerDim (int aLayer, const COLOR4D &aToward, double aKeep) override |
| Fade a cached layer towards a colour in the shader, so dimming it recolours none of its groups. | |
| void | SetSceneLayerOverlayAlpha (int aLayer) override |
| Blend a cached layer the way the other canvases blend the overlay they draw it in. | |
| void | SetSceneDrawOrdered (bool aOrdered) override |
| Tell the retained scene whether cached groups are placed in an order that matters. | |
| void | BeginSceneLayer (int aLayer) override |
| Open a cached layer of the retained scene during a rebuild. | |
| void | SetGroupPlacement (int aGroup, int aLayer, double aLodScale, bool aShown, const RETAINED_GROUP_ORDER &aOrder) override |
| Declare where a cached group belongs in the retained scene. | |
| void | SetSceneScale (double aScale) override |
| Set the view scale that group placements are tested against. | |
| bool | SyncScene () |
| Upload scene changes made outside a drawing context, such as groups crossing their level of detail on a zoom that redraws nothing. | |
| void | Save () override |
| Save the context. | |
| void | Restore () override |
| Restore the context. | |
| void | Transform (const MATRIX3x3D &aTransformation) override |
| Transform the context. | |
| void | Rotate (double aAngle) override |
| Rotate the context. | |
| void | Translate (const VECTOR2D &aTranslation) override |
| Translate the context. | |
| void | Scale (const VECTOR2D &aScale) override |
| Scale the context. | |
| void | SetLayerDepth (double aLayerDepth) override |
| Set the depth of the layer (position on the z-axis) | |
| int | GetSwapInterval () const override |
| Return the swap interval. -1 for adaptive, 0 for disabled/unknown. | |
| void | SetRenderThread (RENDER_THREAD *aThread) |
| Render thread used for fence-based synchronization. | |
| void | SetDpiScale (float aScale) |
| Backing-store scale factor, 2.0 on Retina. | |
| void | SetCentringPad (int aPad) |
| The other canvases lay the view out this many pixels larger than the client area. | |
| VECTOR2I | GetLayoutPixelSize () const override |
| Return the size the view is centred in and panned by. | |
| void | DestroyBuffers () |
| Destroy every GPU resource this GAL holds and forget the handles. | |
| void | ReleaseBuffers () |
| Drop all GPU handles without destroying them. | |
| void | DrawLine (const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint) override |
| Draw a line. | |
| void | DrawSegment (const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint, double aWidth) override |
| Draw a rounded segment. | |
| void | DrawTrack (const VECTOR2D &aStart, const VECTOR2D &aEnd, double aWidth, const COLOR4D &aColor) override |
| Draw a filled track capsule in aColor without touching the fill and stroke state. | |
| void | DrawPad (const VECTOR2D &aCenter, double aHalfWidth, double aHalfHeight, double aCornerRadius, float aShapeType, double aRotation, const COLOR4D &aColor) override |
| Draw a filled pad as one primitive in aColor. | |
| void | DrawSegmentChain (const std::vector< VECTOR2D > &aPointList, double aWidth) override |
| Draw a chain of rounded segments. | |
| void | DrawSegmentChain (const SHAPE_LINE_CHAIN &aLineChain, double aWidth) override |
| void | DrawArc (const VECTOR2D &aCenterPoint, double aRadius, const EDA_ANGLE &aStartAngle, const EDA_ANGLE &aAngle) override |
| Draw an arc. | |
| void | DrawArcSegment (const VECTOR2D &aCenterPoint, double aRadius, const EDA_ANGLE &aStartAngle, const EDA_ANGLE &aAngle, double aWidth, double aMaxError) override |
| Draw an arc segment. | |
| void | DrawCircle (const VECTOR2D &aCenterPoint, double aRadius) override |
| Draw a circle using world coordinates. | |
| void | DrawEllipse (const VECTOR2D &aCenterPoint, double aMajorRadius, double aMinorRadius, const EDA_ANGLE &aRotation) override |
| Draw a closed ellipse. | |
| void | DrawEllipseArc (const VECTOR2D &aCenterPoint, double aMajorRadius, double aMinorRadius, const EDA_ANGLE &aRotation, const EDA_ANGLE &aStartAngle, const EDA_ANGLE &aEndAngle) override |
| Draw an elliptical arc in world coordinates. | |
| void | DrawHoleWall (const VECTOR2D &aCenterPoint, double aHoleRadius, double aWallWidth) override |
| Draw a hole wall ring. | |
| void | DrawRectangle (const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint) override |
| Draw a rectangle. | |
| void | DrawPolygon (const std::deque< VECTOR2D > &aPointList) override |
| Draw a polygon. | |
| void | DrawPolygon (const VECTOR2D aPointList[], int aListSize) override |
| void | DrawPolygon (const SHAPE_POLY_SET &aPolySet, bool aStrokeTriangulation=false) override |
| void | DrawPolygon (const SHAPE_LINE_CHAIN &aPolySet) override |
| void | DrawCurve (const VECTOR2D &aStartPoint, const VECTOR2D &aControlPointA, const VECTOR2D &aControlPointB, const VECTOR2D &aEndPoint, double aFilterValue=0.0) override |
| Draw a cubic bezier spline. | |
| void | DrawBitmap (const BITMAP_BASE &aBitmap, double alphaBlend=1.0) override |
| Draw a bitmap image. | |
| void | DrawPolyline (const std::deque< VECTOR2D > &aPointList) override |
| Draw a polyline. | |
| void | DrawPolyline (const std::vector< VECTOR2D > &aPointList) override |
| void | DrawPolyline (const VECTOR2D aPointList[], int aListSize) override |
| void | DrawPolyline (const SHAPE_LINE_CHAIN &aLineChain) override |
| void | DrawPolylines (const std::vector< std::vector< VECTOR2D > > &aPointLists) override |
| Draw multiple polylines. | |
| void | DrawGlyph (const KIFONT::GLYPH &aGlyph, int aNth=0, int aTotal=1) override |
| Draw a polygon representing a font glyph. | |
| void | ReleaseRetiredBuffers (uint64_t aConsumedGeneration) |
| Free retired buffers and textures once the render thread has consumed a frame built after them. | |
| KIGFX::FRAME_DRAW_DESC | GetDrawDesc () const |
| Snapshot buffer handles, draw counts and grid and cursor uniforms after EndDrawing() | |
| void | PopulateCursorUBO (KIGFX::FRAME_DRAW_DESC &aDesc) const |
| Update only the cursor UBO fields, for overlay-only frames that reuse the scene geometry. | |
| void | SetPersistentTargets (bool aPersistent) |
| Keep the non-cached and overlay pools across frames until ClearTarget() empties one, as the other backends do, so moving an overlay item re-emits only the overlay. | |
| void | MarkStaticDirty () override |
| Force the next Flush() to rebuild the static pool from scratch. | |
| KIGFX::FRAME_DRAW_DESC | GetStaticDrawDesc () const |
| Draw descriptor of the static pool. | |
| KIGFX::FRAME_DRAW_DESC | GetDynamicDrawDesc () const |
| Draw descriptor of the current dynamic ring slot, which is rebuilt every frame. | |
| bool | TakeStaticChanged () |
| Whether the last Flush() rebuilt the static pool. | |
| void | PopulateCameraUBOs (KIGFX::FRAME_DRAW_DESC &aDesc) const |
| Update the camera-dependent UBOs of an existing descriptor. | |
| virtual bool | IsVisible () const |
| Return true if the GAL canvas is visible on the screen. | |
| virtual bool | IsCairoEngine () |
| Return true if the GAL engine is a Cairo based type. | |
| virtual bool | IsOpenGlEngine () |
| Return true if the GAL engine is a OpenGL based type. | |
| void | DrawRectangle (const BOX2I &aRect) |
| virtual void | DrawGlyphs (const std::vector< std::unique_ptr< KIFONT::GLYPH > > &aGlyphs) |
| Draw polygons representing font glyphs. | |
| virtual bool | Show (bool aShow) |
| Show/hide the GAL canvas. | |
| const VECTOR2I & | GetScreenPixelSize () const |
| Return GAL canvas size in pixels. | |
| void | SetClearColor (const COLOR4D &aColor) |
| const COLOR4D & | GetClearColor () const |
| virtual void | SetIsFill (bool aIsFillEnabled) |
| Enable/disable fill. | |
| bool | GetIsFill () const |
| Get the fill status. | |
| virtual void | SetIsStroke (bool aIsStrokeEnabled) |
| Enable/disable stroked outlines. | |
| bool | GetIsStroke () const |
| Get the stroke status. | |
| virtual void | SetFillColor (const COLOR4D &aColor) |
| Set the fill color. | |
| const COLOR4D & | GetFillColor () const |
| Get the fill color. | |
| virtual void | SetStrokeColor (const COLOR4D &aColor) |
| Set the stroke color. | |
| virtual void | SetHoverColor (const COLOR4D &aColor) |
| const COLOR4D & | GetStrokeColor () const |
| Get the stroke color. | |
| virtual void | SetLineWidth (float aLineWidth) |
| Set the line width. | |
| virtual void | SetMinLineWidth (float aLineWidth) |
| Set the minimum line width in pixels. | |
| float | GetLineWidth () const |
| Get the line width. | |
| float | GetMinLineWidth () const |
| Get the minimum line width in pixels. | |
| void | AdvanceDepth () |
| Change the current depth to deeper, so it is possible to draw objects right beneath other. | |
| void | ResetTextAttributes () |
| Reset text attributes to default styling. | |
| void | SetGlyphSize (const VECTOR2I aSize) |
| const VECTOR2I & | GetGlyphSize () const |
| void | SetFontBold (const bool aBold) |
| bool | IsFontBold () const |
| void | SetFontItalic (bool aItalic) |
| bool | IsFontItalic () const |
| void | SetFontUnderlined (bool aUnderlined) |
| bool | IsFontUnderlined () const |
| void | SetTextMirrored (const bool aMirrored) |
| bool | IsTextMirrored () const |
| void | SetHorizontalJustify (const GR_TEXT_H_ALIGN_T aHorizontalJustify) |
| GR_TEXT_H_ALIGN_T | GetHorizontalJustify () const |
| void | SetVerticalJustify (const GR_TEXT_V_ALIGN_T aVerticalJustify) |
| GR_TEXT_V_ALIGN_T | GetVerticalJustify () const |
| virtual void | ComputeWorldScreenMatrix () |
| Compute the world <-> screen transformation matrix. | |
| const MATRIX3x3D & | GetWorldScreenMatrix () const |
| Get the world <-> screen transformation matrix. | |
| const MATRIX3x3D & | GetScreenWorldMatrix () const |
| Get the screen <-> world transformation matrix. | |
| void | SetWorldScreenMatrix (const MATRIX3x3D &aMatrix) |
| Set the world <-> screen transformation matrix. | |
| BOX2D | GetVisibleWorldExtents () const |
| void | SetWorldUnitLength (double aWorldUnitLength) |
| Set the unit length. | |
| double | GetWorldUnitLength () const |
| void | SetScreenSize (const VECTOR2I &aSize) |
| void | SetScreenDPI (double aScreenDPI) |
| Set the dots per inch of the screen. | |
| double | GetScreenDPI () const |
| void | SetLookAtPoint (const VECTOR2D &aPoint) |
| Get/set the Point in world space to look at. | |
| const VECTOR2D & | GetLookAtPoint () const |
| void | SetZoomFactor (double aZoomFactor) |
| double | GetZoomFactor () const |
| void | SetRotation (double aRotation) |
| Get/set the rotation angle (in radians). | |
| double | GetRotation () const |
| void | SetDepthRange (const VECTOR2D &aDepthRange) |
| Set the range of the layer depth. | |
| double | GetMinDepth () const |
| double | GetMaxDepth () const |
| double | GetWorldScale () const |
| Get the world scale. | |
| double | GetWorldScaleForScreenSpace () const |
| Get the world scale to size something drawn in screen space mode. | |
| bool | WorldScaleBelow (double aLimit) const |
| Tell whether the world scale is below a limit. | |
| void | TakeWorldScaleLimits (double &aBelow, double &aAbove) const |
| Give and forget the nearest limits on either side of the scale passed to WorldScaleBelow(). | |
| bool | TakeWorldScaleRead () const |
| Tell whether GetWorldScale() or a transformation matrix was read since the last call. | |
| void | SetFlip (bool xAxis, bool yAxis) |
| Sets flipping of the screen. | |
| bool | IsFlippedX () const |
| bool | IsFlippedY () const |
| virtual bool | HasTarget (RENDER_TARGET aTarget) |
| Return true if the target exists. | |
| void | SetGridVisibility (bool aVisibility) |
| Set the visibility setting of the grid. | |
| bool | GetGridVisibility () const |
| bool | GetGridSnapping () const |
| void | SetGridOrigin (const VECTOR2D &aGridOrigin) |
| Set the origin point for the grid. | |
| const VECTOR2D & | GetGridOrigin () const |
| void | SetGridSize (const VECTOR2D &aGridSize) |
| Set the grid size. | |
| const VECTOR2D & | GetGridSize () const |
| Return the grid size. | |
| VECTOR2D | GetVisibleGridSize () const |
| Return the visible grid size in x and y directions. | |
| void | SetGridColor (const COLOR4D &aGridColor) |
| Set the grid color. | |
| void | SetAxesColor (const COLOR4D &aAxesColor) |
| Set the axes color. | |
| void | SetAxesEnabled (bool aAxesEnabled) |
| Enable drawing the axes. | |
| void | SetCoarseGrid (int aInterval) |
| Draw every tick line wider. | |
| float | GetGridLineWidth () const |
| Get the grid line width. | |
| void | SetGridSources (std::vector< GRID_SOURCE > aSources) |
| Set the grid-source list rendered alongside the display grid. | |
| const std::vector< GRID_SOURCE > & | GetGridSources () const |
| GRID_STYLE | GetGridStyle () const |
| int | GetCoarseGrid () const |
| const COLOR4D & | GetGridColor () const |
| VECTOR2D | GetGridPoint (const VECTOR2D &aPoint) const |
| For a given point it returns the nearest point belonging to the grid in world coordinates. | |
| VECTOR2D | ToWorld (const VECTOR2D &aPoint) const |
| Compute the point position in world coordinates from given screen coordinates. | |
| VECTOR2D | ToScreen (const VECTOR2D &aPoint) const |
| Compute the point position in screen coordinates from given world coordinates. | |
| virtual bool | SetNativeCursorStyle (KICURSOR aCursor, bool aHiDPI) |
| Set the cursor in the native panel. | |
| void | SetCursorEnabled (bool aCursorEnabled) |
| Enable/disable cursor. | |
| bool | IsCursorEnabled () const |
| Return information about cursor visibility. | |
| void | SetCursorColor (const COLOR4D &aCursorColor) |
| Set the cursor color. | |
| virtual void | EnableDepthTest (bool aEnabled=false) |
| virtual bool | IsContextLocked () |
| Checks the state of the context lock. | |
| virtual bool | IsContextValid () const |
| Check whether the locked context is actually the current one. | |
| virtual GAL_CONTEXT_LOSS | GetContextLoss () const |
| Check whether a GPU reset destroyed this canvas' rendering context. | |
| virtual bool | IsResetSettled () |
| Check whether the driver has finished the reset that destroyed this canvas' context. | |
| virtual void | LockContext (int aClientCookie) |
| Use GAL_CONTEXT_LOCKER RAII object unless you know what you're doing. | |
| virtual void | UnlockContext (int aClientCookie) |
Static Public Member Functions | |
| static std::shared_ptr< RENDER_THREAD > | AcquireRenderThread (bool aEnableValidation) |
| Return the render thread every RHI canvas in the process shares, starting it on first use and replacing one whose device was lost. | |
| static uint32_t | AllocateWindowId () |
| static constexpr int | arenaOf (int aShape, bool aNegative) |
Static Public Attributes | |
| static constexpr int | ARENA_INSTANCE_COUNT = 2 * RHI_INSTANCED_SHAPES |
| Arenas of one retained scene layer. | |
| static constexpr int | ARENA_POLYGON = ARENA_INSTANCE_COUNT |
| static constexpr int | ARENA_COUNT = ARENA_POLYGON + 1 |
Protected Member Functions | |
| void | beginUpdate () override |
| Enable item update mode. | |
| void | endUpdate () override |
| Disable item update mode. | |
| void | computeWorldScale () |
| Compute the scaling factor for the world->screen matrix. | |
| double | computeMinGridSpacing () const |
| Compute minimum grid spacing from the grid settings. | |
| float | gridMinorLineWidth (double aWorldPixelSize, double aScaleFactor) const |
| Compute the world width of a minor grid line. | |
| BOX2D | gridScreenBBox (const GRID_SOURCE &aSrc) const |
| GRID_LATTICE | gridLattice (const GRID_SOURCE &aSrc) const |
| Thin a grid source's pitch out until its lines are far enough apart on screen. | |
| COLOR4D | gridSourceColor (const GRID_SOURCE &aSrc) const |
| The colour a grid source is drawn in, brightened while it is being edited. | |
| void | drawGridCoverageShape (const GRID_SOURCE &aSrc) |
| Draw the area a grid source covers in its own frame with the current fill and stroke. | |
| COLOR4D | getCursorColor () const |
| Get the actual cursor color to draw. | |
| void | OnGalDisplayOptionsChanged (const GAL_DISPLAY_OPTIONS &aOptions) override |
| Handler for observer settings changes. | |
| virtual bool | updatedGalDisplayOptions (const GAL_DISPLAY_OPTIONS &aOptions) |
| Handle updating display options. | |
| template<typename T> | |
| void | normalize (T &a, T &b) |
| Ensure that the first element is smaller than the second. | |
Static Protected Member Functions | |
| static double | calcAngleStep (double aRadius) |
| Compute the angle step when drawing arcs/circles approximated with lines. | |
Protected Attributes | |
| GAL_DISPLAY_OPTIONS & | m_options |
| UTIL::LINK | m_observerLink |
| std::stack< double > | m_depthStack |
| Stored depth values. | |
| VECTOR2I | m_screenSize |
| Screen size in screen (wx logical) coordinates. | |
| double | m_worldUnitLength |
| The unit length of the world coordinates [inch]. | |
| double | m_screenDPI |
| The dots per inch of the screen. | |
| VECTOR2D | m_lookAtPoint |
| Point to be looked at in world space. | |
| double | m_zoomFactor |
| The zoom factor. | |
| double | m_rotation |
| Rotation transformation (radians) | |
| MATRIX3x3D | m_worldScreenMatrix |
| World transformation. | |
| MATRIX3x3D | m_screenWorldMatrix |
| Screen transformation. | |
| double | m_worldScale |
| The scale factor world->screen. | |
| bool | m_worldScaleRead = false |
| see TakeWorldScaleRead() | |
| double | m_scaleLimitBelow = 0.0 |
| see TakeWorldScaleLimits() | |
| double | m_scaleLimitAbove = std::numeric_limits<double>::max() |
| bool | m_globalFlipX |
| Flag for X axis flipping. | |
| bool | m_globalFlipY |
| Flag for Y axis flipping. | |
| float | m_lineWidth |
| The line width. | |
| float | m_minLineWidth |
| Minimum line width in pixels. | |
| bool | m_isFillEnabled |
| Is filling of graphic objects enabled ? | |
| bool | m_isStrokeEnabled |
| Are the outlines stroked ? | |
| COLOR4D | m_fillColor |
| The fill color. | |
| COLOR4D | m_strokeColor |
| The color of the outlines. | |
| COLOR4D | m_clearColor |
| COLOR4D | m_hoverColor |
| Color for hovered (active) links. | |
| double | m_layerDepth |
| The actual layer depth. | |
| VECTOR2D | m_depthRange |
| Range of the depth. | |
| bool | m_gridVisibility |
| Should the grid be shown. | |
| GRID_STYLE | m_gridStyle |
| Grid display style. | |
| VECTOR2D | m_gridSize |
| The grid size. | |
| VECTOR2D | m_gridOrigin |
| The grid origin. | |
| VECTOR2D | m_gridOffset |
| The grid offset to compensate cursor position. | |
| COLOR4D | m_gridColor |
| Color of the grid. | |
| COLOR4D | m_axesColor |
| Color of the axes. | |
| bool | m_axesEnabled |
| Should the axes be drawn. | |
| int | m_gridTick |
| Every tick line gets the double width. | |
| float | m_gridLineWidth |
| Line width of the grid. | |
| int | m_gridMinSpacing |
| Minimum screen size of the grid (pixels) below which the grid is not drawn. | |
| std::vector< GRID_SOURCE > | m_gridSources |
| Sources overlayed on the display grid. | |
| bool | m_isCursorEnabled |
| Is the cursor enabled? | |
| bool | m_forceDisplayCursor |
| Always show cursor. | |
| COLOR4D | m_cursorColor |
| Cursor color. | |
| KIGFX::CROSS_HAIR_MODE | m_crossHairMode |
| Crosshair drawing mode. | |
| VECTOR2D | m_cursorPosition |
| Current cursor position (world coordinates) | |
| KICURSOR | m_currentNativeCursor |
| Current cursor. | |
Static Protected Attributes | |
| static constexpr int | SEG_PER_CIRCLE_COUNT = 64 |
| The default number of segments approximating a full circle. | |
| static const int | MIN_DEPTH = -2*MAX_LAYERS_FOR_VIEW |
| Possible depth range. | |
| static const int | MAX_DEPTH = 2*MAX_LAYERS_FOR_VIEW - 1 |
| static const int | GRID_DEPTH = MAX_DEPTH - 1 |
| Depth level on which the grid is drawn. | |
Private Member Functions | |
| void | recomputeTransformIdentity () |
| Exact comparison is enough since a false negative only takes the slow path. | |
| VECTOR2D | xform (const VECTOR2D &aPt) const |
| double | xformScale () const |
| double | xformAngle () const |
| RHI_INSTANCE | makeInstance (const COLOR4D &aColor) |
An instance in aColor at the layer depth, with the current polarity and padding. | |
| void | emitInstance (RHI_SHAPE aShape, const RHI_INSTANCE &aInstance) |
| Append to the current target's pool. | |
| void | releaseBitmapQuads (std::vector< BITMAP_QUAD > &aQuads, bool aOwnedOnly) |
| Retire the textures and vertex buffers the quads own, then empty the list. | |
| bool | drawBitmapGlyphs (const wxString &aText, const VECTOR2I &aPosition, const EDA_ANGLE &aAngle) |
| Emit bitmap text glyph by glyph. | |
| void | addCapsuleInstance (const VECTOR2D &aStart, const VECTOR2D &aEnd, double aWidth, const COLOR4D &aColor) |
| RHI_INSTANCE & | addArcInstance (const VECTOR2D &aCenter, double aRadius, double aStartAngle, double aSweepAngle, double aWidth, const COLOR4D &aColor) |
| RHI_INSTANCE & | addPadInstance (const VECTOR2D &aCenter, double aHalfWidth, double aHalfHeight, double aCornerRadius, float aShapeType, double aRotation, const COLOR4D &aColor) |
| void | drawEllipseShape (const SHAPE_ELLIPSE &aEllipse) |
| Fill and stroke an ellipse per the current settings, filling an arc as a sector. | |
| void | fillOutline (SHAPE_LINE_CHAIN aOutline, const COLOR4D &aColor) |
| Fill an outline, closed or not, without stroking it. | |
| void | emitTriangulatedPolygon (const SHAPE_POLY_SET &aPolySet, const COLOR4D &aColor) |
| RHI_VERTEX | fillVertex (const COLOR4D &aColor) |
A vertex filled in aColor at the layer depth, for emitTriangle() to place. | |
| void | emitTriangle (const VECTOR2D &aA, const VECTOR2D &aB, const VECTOR2D &aC, const RHI_VERTEX &aFill) |
| Append a triangle given in world coordinates under the current transform. | |
| void | strokeLineChain (const SHAPE_LINE_CHAIN &aChain) |
| Stroke a chain as segments, adding a last-to-first segment when it is closed. | |
| bool | ensureBuffer (RHI_BufferHandle &aBuffer, size_t &aCapacity, size_t aNeeded, size_t aStride) |
Grow aBuffer to hold aNeeded elements. | |
| void | refillDynamicTarget (RENDER_TARGET aTarget) |
| Rotate a dynamic target's ring, empty the new slot and open a range at the current depth. | |
| bool | currentTargetOpen () const |
| Whether drawing to the current target lands in a pool that this frame has emptied. | |
| void | drawGridSources () |
| Draw the grid sources into m_gridPool, each over its own area as the Cairo canvas paints them. | |
| void | drawGridSource (const GRID_SOURCE &aSrc) |
| double | screenPixelSize () const |
| The world size of a screen pixel, which grid lines are measured in. | |
| void | retireBuffer (RHI_BufferHandle aBuffer) |
| void | retireTexture (RHI_TextureHandle aTexture) |
| template<typename T> | |
| void | submitSpan (const std::vector< T > &aElements, RHI_BufferHandle aBuffer, const PATCH_SPAN &aSpan) |
Queue an upload of a span of aElements to the same place in aBuffer. | |
| void | clearStaticSlots () |
| Forget where groups sit in the static pool and the patches pending for it. | |
| template<typename INSTANCE_FN, typename VERTEX_FN> | |
| bool | patchStaticGroup (int aGroup, INSTANCE_FN aInstance, VERTEX_FN aVertex) |
Patch a cached group in place in the static pool, applying aInstance to each instance and aVertex to each polygon vertex, and record the touched spans for a partial upload. | |
| void | rewriteResidentGroup (int aGroupNumber, GAL_GROUP &aGroup) |
| Write a resident group back into its scene layer after its elements changed. | |
| void | buildSceneRuns (SCENE_LAYER &aLayer) |
| Work out a layer's polarity runs again after its residents changed or moved. | |
| bool | gridShown () const |
| void | sortSceneOrder () |
| Put the declared layers back in decreasing depth order after one was added or moved. | |
| template<typename T> | |
| uint32_t | allocSceneSlot (SCENE_ARENA< T > &aArena, uint32_t aCount) |
| template<typename T> | |
| void | freeSceneSlot (SCENE_ARENA< T > &aArena, uint32_t aStart, uint32_t aCount) |
| template<typename T> | |
| void | compactSceneArena (SCENE_LAYER &aLayer, SCENE_ARENA< T > &aArena, int aArenaId) |
| template<typename T> | |
| bool | uploadSceneArena (SCENE_ARENA< T > &aArena) |
| Upload the arena's pending spans, growing its buffer first. | |
| void | placeGroupInScene (int aGroupId, GAL_GROUP &aGroup, SCENE_LAYER &aLayer) |
| void | removeGroupFromScene (int aGroupId, GAL_GROUP &aGroup) |
| void | trackGroupLod (int aGroupId, GAL_GROUP &aGroup, bool aTrack) |
| Keep m_lodGroups to the shown groups whose threshold a zoom can actually cross. | |
| void | writeGroupToScene (const GAL_GROUP &aGroup, SCENE_LAYER &aLayer) |
| Copy a resident group's elements into its slots, applying the layer's hoisted alpha. | |
| bool | retainedTieOrderChanged (int aGroupId, GAL_GROUP &aGroup, SCENE_LAYER &aLayer) |
| void | countGroupAlpha (const GAL_GROUP &aGroup, SCENE_LAYER &aLayer, int aDelta) |
| void | resetScene () |
| Empty every arena and forget residency ahead of a full rebuild. | |
| bool | flushScene () |
| Settle hoisted alpha, compact and upload. | |
| void | appendSceneRanges (FRAME_DRAW_DESC &aDesc) const |
| GEOMETRY_BUFFER_SET & | buf () |
| const GEOMETRY_BUFFER_SET & | buf () const |
| GEOMETRY_BUFFER_SET & | obuf () |
| const GEOMETRY_BUFFER_SET & | obuf () const |
| GEOMETRY_BUFFER_SET & | poolForCurrentTarget () |
| TARGET_CACHED draws to the static pool and every other target to its dynamic ring slot. | |
| const GEOMETRY_BUFFER_SET & | poolForCurrentTarget () const |
| void | countBitmapRefs (const GAL_GROUP &aGroup, int aDelta) |
| Count a group's quads against the cached textures they draw, so a texture a cached group still shows is not evicted for not being drawn again each frame. | |
| bool | assignSlicesByOrder (std::vector< LAYER_RANGE > &aRanges, size_t aFirst) const |
| Give ranges their slices of the depth range from one mapping of layer order, the same for every target. | |
| bool | keepsRelativeDepth (const GEOMETRY_BUFFER_SET &aPool) const |
| The pool is a kept target whose ranges are drawn in depth slices, see Flush() | |
| void | notePolarity (bool aNegative) |
| Note the polarity of what is about to be drawn, so that a pool remembers where it changed. | |
| void | evictBitmapCacheEntries () |
| Evict least recently used entries down to the entry and byte caps, sparing those used this frame since a submitted quad may still reference them. | |
| std::vector< LAYER_RANGE > & | layerRangesForCurrentTarget () |
| const std::vector< LAYER_RANGE > & | layerRangesForCurrentTarget () const |
| void | beginLayerRange (float aDepth) |
| double | getLayerDepth () const |
Static Private Member Functions | |
| static std::shared_ptr< const RHI_RUN_TABLE > | updateSceneCullRuns (SCENE_LAYER &aLayer) |
| Bring a layer's culling bounds up to date, recounting only runs whose elements changed. | |
| static bool | sceneLayerComposited (const SCENE_LAYER &aLayer) |
| Whether a scene layer goes through the temp target and is composited with its alpha. | |
| static std::array< uint64_t, 2 > | computeGroupFingerprint (const GAL_GROUP &aGroup) |
| static void | countGroupArenas (const GAL_GROUP &aGroup, uint32_t *aCounts) |
Fill aCounts with how many of a group's instances go in each instance arena. | |
Private Attributes | |
| RHI_DEVICE_PROXY & | m_deviceProxy |
| RENDER_THREAD * | m_renderThread = nullptr |
| bool | m_rhiInitialized = false |
| bool | m_isDrawing = false |
| bool | m_isUpdating = false |
| RENDER_TARGET | m_currentTarget = TARGET_CACHED |
| int | m_screenWidth = 0 |
| int | m_screenHeight = 0 |
| float | m_dpiScale = 1.0f |
| see SetDpiScale() | |
| int | m_centringPad = 0 |
| see SetCentringPad() | |
| bool | m_negativeMode = false |
| bool | m_screenSpaceMode = false |
| uint16_t | m_strokePixelPad = 0 |
| see SetStrokePixelPad(), in sixteenths of a pixel | |
| float | m_strokeLengthPad = 0.0f |
| see SetStrokeLengthPad(), 0 when off | |
| double | m_strokeLod = 0.0 |
| see SetStrokeLevelOfDetail(), 0 when off | |
| double | m_bitmapTextHeight = 0.0 |
| glyph height while bitmap text is stroked, else 0 | |
| bool | m_bitmapGlyphs = false |
| see SetBitmapGlyphs() | |
| bool | m_diffLayerActive = false |
| bool | m_drawGrid = false |
| bool | m_drawCursor = false |
| bool | m_transformIsIdentity = true |
| The GPU applies world to screen, so most geometry skips the matrix math on the hot path. | |
| GEOMETRY_BUFFER_SET | m_bufferSets [BUFFER_RING_SIZE] |
| The non-cached pool. | |
| int | m_currentBufferSet = 0 |
| GEOMETRY_BUFFER_SET | m_overlaySets [BUFFER_RING_SIZE] |
| int | m_currentOverlaySet = 0 |
| bool | m_persistentTargets = false |
| bool | m_nonCachedRefilled = false |
| non-cached pool was emptied for the frame being drawn | |
| bool | m_overlayRefilled = false |
| GEOMETRY_BUFFER_SET | m_staticPool |
| Pool for TARGET_CACHED. | |
| bool | m_staticDirty = true |
| GEOMETRY_BUFFER_SET | m_gridPool |
| The grids of the grid items, which the static target draws over the grid and under all else. | |
| std::vector< LAYER_RANGE > | m_gridLayerRanges |
| bool | m_gridPoolRefilled = false |
| bool | m_drawingGridSources = false |
| emissions go to m_gridPool | |
| std::array< uint64_t, 2 > | m_gridPoolHash {} |
| hash of what the GPU buffers hold | |
| bool | m_staticRebuiltThisFlush = false |
| see TakeStaticChanged() | |
| uint64_t | m_bufferGeneration = 1 |
| Bumped whenever a resource is retired. | |
| std::vector< std::pair< uint64_t, RHI_BufferHandle > > | m_retiredBuffers |
| std::vector< std::pair< uint64_t, RHI_TextureHandle > > | m_retiredTextures |
| std::unordered_map< int, std::vector< STATIC_GROUP_SLOT > > | m_staticGroupSlots |
| A group may be drawn into the static pool more than once per build, so a patch touches every slot. | |
| std::array< PATCH_SPAN, RHI_SHAPES > | m_staticPatches |
| uint64_t | m_placeSeq = 0 |
| bool | m_sceneDrawOrdered = false |
| std::unordered_map< int, SCENE_LAYER > | m_sceneLayers |
| by VIEW layer id | |
| std::vector< int > | m_sceneOrder |
| layer ids in draw order | |
| std::multimap< double, int > | m_lodGroups |
| groups with a scale threshold, by it | |
| SCENE_LAYER * | m_openSceneLayer = nullptr |
| int | m_openSceneLayerId = -1 |
| double | m_sceneScale = 1.0 |
| bool | m_sceneChanged = false |
| bool | m_sceneOrderStale = false |
| bool | m_negativesLayer = false |
| bool | m_groupNegative = false |
| the group being recorded has drawn a knockout | |
| std::unordered_map< KIID, BITMAP_CACHE_ENTRY > | m_bitmapTextureCache |
| uint64_t | m_bitmapUseCounter = 0 |
| bumped on every cache touch | |
| uint64_t | m_bitmapFrameStartSeq = 0 |
| use counter at frame start, entries used since are pinned | |
| std::unordered_map< int, GAL_GROUP > | m_groups |
| int | m_groupCounter = 0 |
| int | m_currentGroupId = -1 |
| int | m_groupDepth = 0 |
| SHAPE_INSTANCES | m_groupScratchInstances |
| BeginGroup() swaps these with the current pool's vectors and EndGroup() swaps them back. | |
| std::vector< RHI_VERTEX > | m_groupScratchPolygonVertices |
| std::vector< BITMAP_QUAD > | m_groupScratchBitmapQuads |
| MATRIX3x3D | m_currentTransform |
| std::vector< MATRIX3x3D > | m_transformStack |
| std::vector< LAYER_RANGE > | m_staticLayerRanges |
| Kept per pool so static ranges survive BeginDrawing when m_staticDirty is false. | |
| std::vector< LAYER_RANGE > | m_dynamicLayerRanges |
| std::vector< LAYER_RANGE > | m_overlayLayerRanges |
| TEXT_ATTRIBUTES | m_attributes |
Static Private Attributes | |
| static constexpr int | BUFFER_RING_SIZE = 2 |
| static constexpr size_t | BITMAP_CACHE_MAX_ENTRIES = 64 |
GAL that turns drawing commands into instanced primitives for the RHI device.
It has no wxWidgets base so it can run headless. EDA_DRAW_PANEL_GAL_MODERN does the wx integration.
Definition at line 49 of file gal_modern.h.
| using KIGFX::GAL_MODERN::SHAPE_INSTANCES = std::array<std::vector<RHI_INSTANCE>, RHI_INSTANCED_SHAPES> |
Instances of each instanced shape, indexed by RHI_SHAPE.
Definition at line 278 of file gal_modern.h.
| GAL_MODERN::GAL_MODERN | ( | GAL_DISPLAY_OPTIONS & | aOptions, |
| RHI_DEVICE_PROXY & | aDeviceProxy ) |
Definition at line 178 of file gal_modern.cpp.
References BLUE, KIGFX::GAL::GAL(), IsInitialized(), m_currentTransform, m_deviceProxy, m_rhiInitialized, and KIGFX::GAL::SetAxesColor().
|
override |
Definition at line 230 of file gal_modern.cpp.
References DestroyBuffers().
|
static |
Return the render thread every RHI canvas in the process shares, starting it on first use and replacing one whose device was lost.
NVIDIA's DXGI-layered present aborts the process when a second device creates a swapchain. It lives in the GAL library because each kiface links its own copy of the RHI code.
Definition at line 191 of file gal_modern.cpp.
References RhiCreatePlatformDevice().
Referenced by EDA_DRAW_PANEL_GAL::SwitchBackend().
|
private |
Definition at line 1534 of file gal_modern.cpp.
References center, emitInstance(), KIGFX::GAL_MODERN::GEOMETRY_BUFFER_SET::instances, makeInstance(), poolForCurrentTarget(), KIGFX::RHI_SHAPE_ARC, scale, RHI_INSTANCE::SetParam(), RHI_INSTANCE::SetPosition(), xform(), xformAngle(), and xformScale().
Referenced by DrawArc(), DrawArcSegment(), DrawCircle(), DrawHoleWall(), and DrawSegment().
|
private |
Definition at line 1375 of file gal_modern.cpp.
References delta, emitInstance(), end, m_bitmapTextHeight, m_screenSpaceMode, m_strokeLengthPad, m_strokeLod, KIGFX::GAL::m_worldScale, makeInstance(), RHI_INSTANCE_FADE_SMALL, RHI_INSTANCE_LENGTH_PAD, RHI_INSTANCE_SCALE_LOD, RHI_INSTANCE_SCREEN_SPACE, KIGFX::RHI_SHAPE_TRACK, scale, RHI_INSTANCE::SetFlag(), RHI_INSTANCE::SetParam(), RHI_INSTANCE::SetPosition(), RHI_INSTANCE::SetRotation(), VECTOR2< T >::x, xform(), xformScale(), and VECTOR2< T >::y.
Referenced by DrawLine(), DrawRectangle(), DrawSegment(), and DrawTrack().
|
private |
Definition at line 2117 of file gal_modern.cpp.
References center, emitInstance(), KIGFX::GAL_MODERN::GEOMETRY_BUFFER_SET::instances, makeInstance(), poolForCurrentTarget(), KIGFX::RHI_SHAPE_PAD, scale, RHI_INSTANCE::SetParam(), RHI_INSTANCE::SetPosition(), RHI_INSTANCE::SetRotation(), xform(), xformAngle(), and xformScale().
Referenced by DrawCircle(), DrawPad(), and DrawRectangle().
|
inlineinherited |
Change the current depth to deeper, so it is possible to draw objects right beneath other.
If you do this, you should consider using a GAL_SCOPED_ATTR to ensure the depth is reset to the original value.
Definition at line 683 of file graphics_abstraction_layer.h.
References m_layerDepth, and SetLayerDepth().
Referenced by KIGFX::VIEW_GROUP::ViewDraw().
|
static |
Definition at line 222 of file gal_modern.cpp.
Referenced by EDA_DRAW_PANEL_GAL::SwitchBackend().
|
private |
Definition at line 2486 of file gal_modern.cpp.
References KIGFX::GAL_MODERN::SCENE_ARENA< T >::dead, KIGFX::GAL_MODERN::SCENE_ARENA< T >::elements, KIGFX::GAL_MODERN::SCENE_ARENA< T >::freeSlots, and markSceneDirty().
Referenced by placeGroupInScene().
|
private |
Definition at line 3533 of file gal_modern.cpp.
References arenaOf(), assignSlicesByOrder(), KIGFX::GAL_MODERN::SCENE_LAYER::bakedAlpha, KIGFX::FRAME_DRAW_DESC::bitmapDraws, KIGFX::GAL_MODERN::SCENE_LAYER::bitmapResidents, KIGFX::GAL_MODERN::SCENE_ARENA< T >::buffer, KIGFX::FRAME_DRAW_DESC::count, KIGFX::GAL_MODERN::SCENE_LAYER::cullRuns, KIGFX::GAL_MODERN::SCENE_LAYER::depth, KIGFX::LAYER_RANGE::depth, KIGFX::GAL_MODERN::SCENE_LAYER::dim, KIGFX::GAL_MODERN::SCENE_LAYER::hasNegatives, KIGFX::GAL_MODERN::SCENE_LAYER::instances, KIGFX::FRAME_DRAW_DESC::layerRanges, m_groups, m_sceneLayers, m_sceneOrder, KIGFX::FRAME_DRAW_DESC::negCount, KIGFX::GAL_MODERN::SCENE_LAYER::overlayAlpha, KIGFX::FRAME_DRAW_DESC::polarityRuns, KIGFX::GAL_MODERN::SCENE_LAYER::polygons, KIGFX::FRAME_DRAW_DESC::relativeDepth, KIGFX::RHI_INSTANCED_SHAPES, KIGFX::RHI_SHAPE_POLYGON, KIGFX::RHI_SHAPES, KIGFX::GAL_MODERN::SCENE_LAYER::runs, sceneLayerComposited(), KIGFX::TARGET_CACHED, KIGFX::GAL_MODERN::SCENE_LAYER::translucent, and KIGFX::GAL_MODERN::SCENE_LAYER::visible.
Referenced by GetDrawDesc(), and GetStaticDrawDesc().
|
inlinestaticconstexpr |
Definition at line 288 of file gal_modern.h.
Referenced by appendSceneRanges(), buildSceneRuns(), countGroupArenas(), and writeGroupToScene().
|
private |
Give ranges their slices of the depth range from one mapping of layer order, the same for every target.
False if the scene has no declared layers to take the mapping from.
Definition at line 3499 of file gal_modern.cpp.
References m_sceneLayers.
Referenced by appendSceneRanges(), and GetDynamicDrawDesc().
|
overridevirtual |
Start/end drawing functions, draw calls can be only made in between the calls to BeginDrawing()/EndDrawing().
Normally you should create a GAL_DRAWING_CONTEXT RAII object, but I'm leaving these functions public for more precise (i.e. timing/profiling) control of the drawing process - Tom Begin the drawing, needs to be called for every new frame. Use GAL_DRAWING_CONTEXT RAII object unless you know what you're doing.
Reimplemented from KIGFX::GAL.
Definition at line 286 of file gal_modern.cpp.
References clearStaticSlots(), m_bitmapFrameStartSeq, m_bitmapUseCounter, m_currentTransform, m_drawCursor, m_isDrawing, m_nonCachedRefilled, m_overlayRefilled, m_persistentTargets, m_staticDirty, m_staticLayerRanges, m_staticPool, m_transformIsIdentity, m_transformStack, refillDynamicTarget(), releaseBitmapQuads(), resetScene(), KIGFX::TARGET_NONCACHED, and KIGFX::TARGET_OVERLAY.
|
overridevirtual |
Begin a group.
A group is a collection of graphic items. Hierarchical groups are possible, attributes and transformations can be used.
Reimplemented from KIGFX::GAL.
Definition at line 2210 of file gal_modern.cpp.
References KIGFX::GAL_MODERN::GEOMETRY_BUFFER_SET::bitmapQuads, KIGFX::GAL_MODERN::GEOMETRY_BUFFER_SET::instances, m_currentGroupId, m_groupCounter, m_groupDepth, m_groupNegative, m_groupScratchBitmapQuads, m_groupScratchInstances, m_groupScratchPolygonVertices, KIGFX::GAL_MODERN::GEOMETRY_BUFFER_SET::polygonVertices, poolForCurrentTarget(), KIGFX::RHI_INSTANCED_SHAPES, and swap.
|
private |
Definition at line 932 of file gal_modern.cpp.
References KIGFX::GAL_MODERN::GEOMETRY_BUFFER_SET::bitmapQuads, currentTargetOpen(), KIGFX::LAYER_RANGE::depth, layerRangesForCurrentTarget(), m_currentTarget, m_diffLayerActive, m_isDrawing, m_isUpdating, and KIGFX::GAL_MODERN::GEOMETRY_BUFFER_SET::Sizes().
Referenced by drawGridSource(), EndDiffLayer(), refillDynamicTarget(), SetLayerDepth(), SetTarget(), and StartDiffLayer().
|
overridevirtual |
Open a cached layer of the retained scene during a rebuild.
Layers draw in the order they are opened, at the current layer depth.
| aLayer | is the VIEW layer id. |
Reimplemented from KIGFX::GAL.
Definition at line 2992 of file gal_modern.cpp.
References m_isDrawing, KIGFX::GAL::m_layerDepth, m_negativesLayer, m_openSceneLayer, m_openSceneLayerId, m_sceneLayers, m_staticDirty, and SetSceneLayerState().
|
overrideprotectedvirtual |
Enable item update mode.
Private: use GAL_UPDATE_CONTEXT RAII object
Reimplemented from KIGFX::GAL.
Definition at line 4336 of file gal_modern.cpp.
References m_isUpdating.
|
overridevirtual |
Draw a text using a bitmap font.
It should be faster than StrokeText(), but can be used only for non-Gerber elements.
| aText | is the text to be drawn. |
| aPosition | is the text position in world coordinates. |
| aAngle | is the text rotation angle. |
Reimplemented from KIGFX::GAL.
Definition at line 2083 of file gal_modern.cpp.
References KIGFX::GAL::BitmapText(), drawBitmapGlyphs(), KIGFX::GAL::GetGlyphSize(), m_bitmapTextHeight, and VECTOR2< T >::y.
|
inlineprivate |
Definition at line 796 of file gal_modern.h.
References m_bufferSets, and m_currentBufferSet.
Referenced by ClearScreen(), DrawGroup(), Flush(), GetDynamicDrawDesc(), poolForCurrentTarget(), poolForCurrentTarget(), and refillDynamicTarget().
|
inlineprivate |
Definition at line 797 of file gal_modern.h.
References m_bufferSets, and m_currentBufferSet.
|
private |
Work out a layer's polarity runs again after its residents changed or moved.
Definition at line 3400 of file gal_modern.cpp.
References ARENA_POLYGON, arenaOf(), clear(), KIGFX::POLARITY_RUN::count, group, KIGFX::GAL_MODERN::SCENE_LAYER::knockoutGroups, m_groups, m_sceneDrawOrdered, KIGFX::POLARITY_RUN::negative, KIGFX::GAL_MODERN::SCENE_LAYER::residents, KIGFX::RHI_INSTANCED_SHAPES, KIGFX::RHI_SHAPE_POLYGON, KIGFX::RHI_SHAPES, KIGFX::GAL_MODERN::SCENE_LAYER::runs, KIGFX::GAL_MODERN::SCENE_LAYER::runsStale, and KIGFX::POLARITY_RUN::start.
Referenced by flushScene().
|
inlinestaticprotectedinherited |
Compute the angle step when drawing arcs/circles approximated with lines.
Bigger arcs need smaller alpha increment to make them look smooth
Definition at line 1469 of file graphics_abstraction_layer.h.
References M_PI, and SEG_PER_CIRCLE_COUNT.
Referenced by KIGFX::GAL_MODERN::DrawArc(), KIGFX::OPENGL_GAL::DrawArc(), KIGFX::OPENGL_GAL::DrawEllipse(), and KIGFX::OPENGL_GAL::DrawEllipseArc().
|
overridevirtual |
Change the color used to draw the group.
| aGroupNumber | is the group number. |
| aNewColor | is the new color. |
Reimplemented from KIGFX::GAL.
Definition at line 3700 of file gal_modern.cpp.
References KIGFX::COLOR4D::a, KIGFX::GAL_MODERN::SCENE_LAYER::alphaStale, KIGFX::COLOR4D::b, countGroupAlpha(), forEachElement(), KIGFX::COLOR4D::g, group, GroupContentFingerprint(), RHI_INSTANCE::HasFlag(), m_groups, m_sceneLayers, m_staticDirty, packColorChannel(), patchStaticGroup(), KIGFX::COLOR4D::r, rewriteResidentGroup(), RHI_INSTANCE_NEGATIVE, and RHI_INSTANCE::SetColor().
|
overridevirtual |
Change the depth (Z-axis position) of the group.
| aGroupNumber | is the group number. |
| aDepth | is the new depth. |
Reimplemented from KIGFX::GAL.
Definition at line 3770 of file gal_modern.cpp.
References forEachElement(), group, GroupContentFingerprint(), m_groups, m_staticDirty, patchStaticGroup(), and rewriteResidentGroup().
|
overridevirtual |
Exempt the group from its layer's dim, see SetSceneLayerDim().
| aGroupNumber | is the group number. |
| aUndimmed | is true to keep the group's colour while its layer is dimmed. |
Reimplemented from KIGFX::GAL.
Definition at line 3809 of file gal_modern.cpp.
References RHI_INSTANCE::ClearFlag(), forEachElement(), group, GroupContentFingerprint(), m_groups, rewriteResidentGroup(), RHI_INSTANCE_UNDIMMED, and RHI_INSTANCE::SetFlag().
|
overridevirtual |
Delete all data created during caching of graphic items.
Reimplemented from KIGFX::GAL.
Definition at line 3924 of file gal_modern.cpp.
References clearStaticSlots(), group, m_bitmapTextureCache, m_groups, m_lodGroups, m_staticDirty, releaseBitmapQuads(), resetScene(), and retireTexture().
|
overridevirtual |
Clear the screen.
Reimplemented from KIGFX::GAL.
Definition at line 870 of file gal_modern.cpp.
References buf(), clearStaticSlots(), m_drawCursor, m_drawGrid, m_dynamicLayerRanges, m_gridLayerRanges, m_gridPool, m_gridPoolRefilled, m_overlayLayerRanges, m_staticDirty, m_staticLayerRanges, m_staticPool, obuf(), releaseBitmapQuads(), and resetScene().
|
inlineprivate |
Forget where groups sit in the static pool and the patches pending for it.
Definition at line 641 of file gal_modern.h.
References m_staticGroupSlots, and m_staticPatches.
Referenced by BeginDrawing(), ClearCache(), and ClearScreen().
|
overridevirtual |
Clear the target for rendering.
| aTarget | is the target to be cleared. |
Reimplemented from KIGFX::GAL.
Definition at line 962 of file gal_modern.cpp.
References m_isDrawing, m_nonCachedRefilled, m_overlayRefilled, m_persistentTargets, refillDynamicTarget(), KIGFX::TARGET_NONCACHED, and KIGFX::TARGET_OVERLAY.
|
private |
Definition at line 2532 of file gal_modern.cpp.
References KIGFX::GAL_MODERN::SCENE_ARENA< T >::dead, KIGFX::GAL_MODERN::SCENE_ARENA< T >::dirty, KIGFX::GAL_MODERN::SCENE_ARENA< T >::elements, KIGFX::GAL_MODERN::SCENE_ARENA< T >::freeSlots, group, m_groups, KIGFX::GAL_MODERN::SCENE_LAYER::residents, and KIGFX::GAL_MODERN::SCENE_ARENA< T >::uploadAll.
Referenced by flushScene().
|
staticprivate |
Definition at line 2273 of file gal_modern.cpp.
References KIGFX::GAL_MODERN::BITMAP_QUAD::alpha, KIGFX::GAL_MODERN::GAL_GROUP::baseDepth, KIGFX::GAL_MODERN::GAL_GROUP::bitmapQuads, KIGFX::GAL_MODERN::BITMAP_QUAD::contentHash, hashBytes(), hashDigest(), KIGFX::GAL_MODERN::GAL_GROUP::instances, KIGFX::GAL_MODERN::GAL_GROUP::negative, KIGFX::GAL_MODERN::GAL_GROUP::polygonVertices, KIGFX::GAL_MODERN::GAL_GROUP::undimmed, and KIGFX::GAL_MODERN::BITMAP_QUAD::vertices.
Referenced by GroupContentFingerprint().
|
protectedinherited |
Compute minimum grid spacing from the grid settings.
Definition at line 266 of file graphics_abstraction_layer.cpp.
References m_gridMinSpacing.
Referenced by GetVisibleGridSize(), and gridLattice().
|
inlineprotectedinherited |
Compute the scaling factor for the world->screen matrix.
Definition at line 1436 of file graphics_abstraction_layer.h.
References PGM_BASE::GetCommonSettings(), COMMON_SETTINGS::m_Appearance, m_screenDPI, m_worldScale, m_worldUnitLength, m_zoomFactor, PgmOrNull(), and COMMON_SETTINGS::APPEARANCE::zoom_correction_factor.
Referenced by ComputeWorldScreenMatrix(), KIGFX::OPENGL_GAL::ComputeWorldScreenMatrix(), and GAL().
|
virtualinherited |
Compute the world <-> screen transformation matrix.
Reimplemented in KIGFX::CAIRO_PRINT_GAL, and KIGFX::OPENGL_GAL.
Definition at line 220 of file graphics_abstraction_layer.cpp.
References computeWorldScale(), GetLayoutPixelSize(), m_globalFlipX, m_globalFlipY, m_lookAtPoint, m_rotation, m_screenWorldMatrix, m_worldScale, m_worldScreenMatrix, scale, MATRIX3x3< T >::SetIdentity(), MATRIX3x3< T >::SetRotation(), MATRIX3x3< T >::SetScale(), MATRIX3x3< T >::SetTranslation(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by KIGFX::OPENGL_GAL::ComputeWorldScreenMatrix(), KIGFX::CAIRO_GAL_BASE::resetContext(), and KIGFX::GAL_MODERN::ResizeScreen().
|
private |
Count a group's quads against the cached textures they draw, so a texture a cached group still shows is not evicted for not being drawn again each frame.
Definition at line 3865 of file gal_modern.cpp.
References KIGFX::GAL_MODERN::GAL_GROUP::bitmapQuads, m_bitmapTextureCache, KIGFX::GAL_MODERN::BITMAP_QUAD::ownsTexture, and KIGFX::GAL_MODERN::BITMAP_QUAD::texture.
Referenced by DeleteGroup(), and EndGroup().
|
private |
Definition at line 2571 of file gal_modern.cpp.
References RHI_VERTEX::a, KIGFX::GAL_MODERN::SCENE_LAYER::alphaCount, KIGFX::GAL_MODERN::GAL_GROUP::instances, KIGFX::GAL_MODERN::GAL_GROUP::negative, KIGFX::GAL_MODERN::GAL_GROUP::polygonVertices, and RHI_INSTANCE_NEGATIVE.
Referenced by ChangeGroupColor(), placeGroupInScene(), and removeGroupFromScene().
|
staticprivate |
Fill aCounts with how many of a group's instances go in each instance arena.
Definition at line 2594 of file gal_modern.cpp.
References arenaOf(), RHI_INSTANCE::HasFlag(), KIGFX::GAL_MODERN::GAL_GROUP::instances, RHI_INSTANCE_NEGATIVE, and KIGFX::RHI_INSTANCED_SHAPES.
Referenced by placeGroupInScene(), and retainedTieOrderChanged().
|
inlineprivate |
Whether drawing to the current target lands in a pool that this frame has emptied.
Definition at line 555 of file gal_modern.h.
References m_currentTarget, m_drawingGridSources, m_nonCachedRefilled, m_overlayRefilled, m_persistentTargets, KIGFX::TARGET_CACHED, and KIGFX::TARGET_OVERLAY.
Referenced by beginLayerRange(), EndDiffLayer(), poolForCurrentTarget(), and StartDiffLayer().
|
overridevirtual |
Delete the group from the memory.
| aGroupNumber | is the group number. |
Reimplemented from KIGFX::GAL.
Definition at line 3847 of file gal_modern.cpp.
References countBitmapRefs(), m_groups, releaseBitmapQuads(), removeGroupFromScene(), and trackGroupLod().
| void GAL_MODERN::DestroyBuffers | ( | ) |
Destroy every GPU resource this GAL holds and forget the handles.
The render thread is shared with other canvases, so nothing else would free them.
Definition at line 236 of file gal_modern.cpp.
References KIGFX::GAL_MODERN::SCENE_ARENA< T >::buffer, m_bitmapTextureCache, m_bufferSets, m_deviceProxy, m_gridPool, m_overlaySets, m_persistentTargets, m_sceneLayers, m_staticPool, releaseBitmapQuads(), ReleaseBuffers(), and ReleaseRetiredBuffers().
Referenced by ~GAL_MODERN().
|
overridevirtual |
Draw an arc.
| aCenterPoint | is the center point of the arc. |
| aRadius | is the arc radius. |
| aStartAngle | is the start angle of the arc. |
| aAngle | is the angle of the arc. |
Reimplemented from KIGFX::GAL.
Definition at line 1452 of file gal_modern.cpp.
References addArcInstance(), EDA_ANGLE::AsRadians(), KIGFX::GAL::calcAngleStep(), fillOutline(), KIGFX::GAL::m_fillColor, KIGFX::GAL::m_isFillEnabled, KIGFX::GAL::m_isStrokeEnabled, KIGFX::GAL::m_lineWidth, KIGFX::GAL::m_strokeColor, KIGFX::GAL::normalize(), roundedOutline(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by drawGridSource().
|
overridevirtual |
Draw an arc segment.
This method differs from DrawArc() in what happens when fill/stroke are on or off. DrawArc() draws a "pie piece" when fill is turned on, and a thick stroke when fill is off. DrawArcSegment() with fill on behaves like DrawArc() with fill off. DrawArcSegment() with fill off draws the outline of what it would have drawn with fill on.
This has meaning only for back ends that can't draw a true arc, and use segments to approximate.
TODO: Unify Arc routines
| aCenterPoint | is the center point of the arc. |
| aRadius | is the arc radius. |
| aStartAngle | is the start angle of the arc. |
| aAngle | is the angle of the arc. |
| aWidth | is the thickness of the arc (pen size). |
| aMaxError | is the max allowed error to create segments to approximate a circle. |
Reimplemented from KIGFX::GAL.
Definition at line 1492 of file gal_modern.cpp.
References addArcInstance(), EDA_ANGLE::AsRadians(), DrawCircle(), KIGFX::GAL::m_fillColor, KIGFX::GAL::m_isFillEnabled, KIGFX::GAL::m_isStrokeEnabled, KIGFX::GAL::m_lineWidth, M_PI, KIGFX::GAL::m_strokeColor, KIGFX::GAL::normalize(), VECTOR2< T >::x, and VECTOR2< T >::y.
|
overridevirtual |
Draw a bitmap image.
Reimplemented from KIGFX::GAL.
Definition at line 1748 of file gal_modern.cpp.
References MMH3_HASH::add(), KIGFX::GAL_MODERN::BITMAP_QUAD::alpha, BILINEAR, KIGFX::GAL_MODERN::GEOMETRY_BUFFER_SET::bitmapQuads, KIGFX::GAL_MODERN::BITMAP_CACHE_ENTRY::bytes, KIGFX::GAL_MODERN::BITMAP_CACHE_ENTRY::contentHash, KIGFX::GAL_MODERN::BITMAP_QUAD::contentHash, EDA_ANGLE::Cos(), evictBitmapCacheEntries(), RHI_TEXTURE_DESC::filter, KIGFX::FitImageToTexture(), RHI_TEXTURE_DESC::format, BITMAP_BASE::GetImageID(), BITMAP_BASE::GetOriginalImageData(), BITMAP_BASE::GetPPI(), BITMAP_BASE::GetSizePixels(), hashBytes(), hashDigest(), RHI_TEXTURE_DESC::height, image, KIGFX::ImageToRgba(), BITMAP_BASE::IsMirroredX(), BITMAP_BASE::IsMirroredY(), KIGFX::GAL_MODERN::BITMAP_CACHE_ENTRY::lastUse, m_bitmapTextureCache, m_bitmapUseCounter, m_deviceProxy, KIGFX::GAL::m_worldUnitLength, KIGFX::GAL_MODERN::BITMAP_QUAD::ownsTexture, packColorChannel(), poolForCurrentTarget(), RGBA8, BITMAP_BASE::Rotation(), scale, RHI_VERTEX::SetColor(), RHI_VERTEX::SetPosition(), RHI_VERTEX::SetUV(), EDA_ANGLE::Sin(), RHI_BUFFER_DESC::sizeBytes, KIGFX::GAL_MODERN::BITMAP_CACHE_ENTRY::texture, KIGFX::GAL_MODERN::BITMAP_QUAD::texture, RHI_BUFFER_DESC::type, VERTEX, KIGFX::GAL_MODERN::BITMAP_QUAD::vertexBuffer, KIGFX::GAL_MODERN::BITMAP_QUAD::vertices, RHI_TEXTURE_DESC::width, VECTOR2< T >::x, xform(), and VECTOR2< T >::y.
|
private |
Emit bitmap text glyph by glyph.
False for text the font quads do not cover.
Definition at line 1962 of file gal_modern.cpp.
References KIGFX::COLOR4D::a, EDA_ANGLE::AsRadians(), KIGFX::COLOR4D::b, center, end, KIGFX::COLOR4D::g, KIGFX::GAL::GetGlyphSize(), KIGFX::GAL::GetHorizontalJustify(), KIGFX::GAL::GetVerticalJustify(), GR_TEXT_H_ALIGN_CENTER, GR_TEXT_H_ALIGN_RIGHT, GR_TEXT_V_ALIGN_BOTTOM, GR_TEXT_V_ALIGN_CENTER, KIGFX::GAL_MODERN::GEOMETRY_BUFFER_SET::instances, KIGFX::GAL::IsTextMirrored(), m_bitmapGlyphs, m_currentTarget, m_currentTransform, KIGFX::GAL::m_globalFlipX, KIGFX::GAL::m_globalFlipY, m_groupDepth, KIGFX::GAL::m_layerDepth, m_negativeMode, m_renderThread, m_screenSpaceMode, KIGFX::GAL::m_strokeColor, m_strokeLod, m_strokePixelPad, notePolarity(), packColorChannel(), poolForCurrentTarget(), KIGFX::COLOR4D::r, RHI_INSTANCE_BITMAP_GLYPH, RHI_INSTANCE_OVERLAY_ALPHA, RHI_INSTANCE_SCALE_LOD, KIGFX::RHI_SHAPE_TRACK, scale, RHI_INSTANCE::SetColor(), RHI_INSTANCE::SetDepth(), RHI_INSTANCE::SetFlag(), RHI_INSTANCE::SetParam(), RHI_INSTANCE::SetPosition(), RHI_INSTANCE::SetRotation(), KIGFX::TARGET_OVERLAY, text, VECTOR2< T >::x, xform(), xformAngle(), xformScale(), and VECTOR2< T >::y.
Referenced by BitmapText().
|
overridevirtual |
Draw a circle using world coordinates.
| aCenterPoint | is the center point of the circle. |
| aRadius | is the radius of the circle. |
Reimplemented from KIGFX::GAL.
Definition at line 1552 of file gal_modern.cpp.
References addArcInstance(), addPadInstance(), KIGFX::GAL::m_fillColor, KIGFX::GAL::m_isFillEnabled, KIGFX::GAL::m_isStrokeEnabled, KIGFX::GAL::m_lineWidth, M_PI, KIGFX::GAL::m_strokeColor, RHI_INSTANCE_PIXEL_CIRCLE, and RHI_INSTANCE::SetFlag().
Referenced by DrawArcSegment(), and DrawSegment().
|
overridevirtual |
Draw the cursor.
| aCursorPosition | is the cursor position in screen coordinates. |
Reimplemented from KIGFX::GAL.
Definition at line 1293 of file gal_modern.cpp.
References KIGFX::GAL::m_cursorPosition, and m_drawCursor.
|
overridevirtual |
Draw a cubic bezier spline.
| startPoint | is the start point of the spline. |
| controlPointA | is the first control point. |
| controlPointB | is the second control point. |
| endPoint | is the end point of the spline. |
| aFilterValue | is used by Bezier to segments approximation, if the Bezier curve is not supported and needs a curve to polyline conversion. aFilterValue = 0 means no filtering. |
Reimplemented from KIGFX::GAL.
Definition at line 1728 of file gal_modern.cpp.
References DrawLine(), and BEZIER_POLY::GetPoly().
|
overridevirtual |
Draw a closed ellipse.
| aCenterPoint | center of the ellipse. |
| aMajorRadius | major semi-axis length. |
| aMinorRadius | minor semi-axis length. |
| aRotation | rotation of the major axis from world X, CCW. |
Reimplemented from KIGFX::GAL.
Definition at line 1571 of file gal_modern.cpp.
References drawEllipseShape(), and KiROUND().
|
overridevirtual |
Draw an elliptical arc in world coordinates.
| aCenterPoint | center of the parent ellipse. |
| aMajorRadius | major semi-axis length. |
| aMinorRadius | minor semi-axis length. |
| aRotation | rotation of the major axis from world X, CCW. |
| aStartAngle | sweep start angle in the ellipse local frame, CCW. |
| aEndAngle | sweep end angle in the ellipse local frame, CCW. |
Reimplemented from KIGFX::GAL.
Definition at line 1582 of file gal_modern.cpp.
References drawEllipseShape(), and KiROUND().
|
private |
Fill and stroke an ellipse per the current settings, filling an arc as a sector.
Definition at line 1594 of file gal_modern.cpp.
References SHAPE_ELLIPSE::ConvertToPolyline(), fillOutline(), SHAPE_ELLIPSE::GetCenter(), SHAPE_ELLIPSE::GetMajorRadius(), SHAPE_LINE_CHAIN::Insert(), SHAPE_ELLIPSE::IsArc(), KiROUND(), KIGFX::GAL::m_fillColor, KIGFX::GAL::m_isFillEnabled, KIGFX::GAL::m_isStrokeEnabled, and strokeLineChain().
Referenced by DrawEllipse(), and DrawEllipseArc().
|
overridevirtual |
Draw a polygon representing a font glyph.
Reimplemented from KIGFX::GAL.
Definition at line 2096 of file gal_modern.cpp.
References DrawPolylines(), emitTriangle(), fillVertex(), KIFONT::GLYPH::IsOutline(), KIFONT::GLYPH::IsStroke(), and KIGFX::GAL::m_fillColor.
|
inlinevirtualinherited |
Draw polygons representing font glyphs.
Reimplemented in KIGFX::CAIRO_GAL_BASE, and KIGFX::OPENGL_GAL.
Definition at line 428 of file graphics_abstraction_layer.h.
References DrawGlyph(), GetFillColor(), GetStrokeColor(), m_hoverColor, SetFillColor(), and SetStrokeColor().
Referenced by KIGFX::drawCache(), KIFONT::FONT::drawSingleLineText(), EDA_TEXT::GetEffectiveTextShape(), BRDITEMS_PLOTTER::PlotText(), PCB_TEXT::TransformTextToPolySet(), and PCB_TEXTBOX::TransformTextToPolySet().
|
overridevirtual |
Draw the grid.
Reimplemented from KIGFX::GAL.
Definition at line 1063 of file gal_modern.cpp.
References drawGridSources(), gridShown(), KIGFX::GAL::m_axesEnabled, and m_drawGrid.
|
protectedinherited |
Draw the area a grid source covers in its own frame with the current fill and stroke.
An unbounded source covers the screen.
Definition at line 359 of file graphics_abstraction_layer.cpp.
References GRID_GEOMETRY::CARTESIAN, DrawCircle(), DrawPolygon(), DrawRectangle(), GRID_GEOMETRY::extent, BOX2< Vec >::GetEnd(), BOX2< Vec >::GetOrigin(), gridScreenBBox(), GRID_GEOMETRY::kind, M_PI, GRID_GEOMETRY::orientation, GRID_GEOMETRY::origin, Restore(), Rotate(), Save(), Translate(), KIGFX::GRID_SOURCE::unbounded, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by KIGFX::CAIRO_GAL_BASE::drawGridSource(), KIGFX::GAL_MODERN::drawGridSource(), and KIGFX::OPENGL_GAL::drawGridSources().
|
private |
Definition at line 1122 of file gal_modern.cpp.
References KIGFX::COLOR4D::a, ANGLE_0, beginLayerRange(), GRID_GEOMETRY::CARTESIAN, BOX2< Vec >::Contains(), KIGFX::COLOR4D::Darkened(), KIGFX::DOTS, DrawArc(), KIGFX::GAL::drawGridCoverageShape(), DrawLine(), DrawRectangle(), GRID_GEOMETRY::extent, BOX2< Vec >::GetBottom(), BOX2< Vec >::GetHeight(), BOX2< Vec >::GetLeft(), BOX2< Vec >::GetRight(), BOX2< Vec >::GetTop(), BOX2< Vec >::GetWidth(), KIGFX::GRID_DIM_ALPHA, KIGFX::GRID_EDGE_DARKEN, KIGFX::GAL::gridLattice(), KIGFX::GAL::gridMinorLineWidth(), KIGFX::GAL::gridScreenBBox(), KIGFX::GAL::gridSourceColor(), KIGFX::GRID_SOURCE::highlighted, KIGFX::GAL::GRID_LATTICE::IsMajor(), GRID_GEOMETRY::kind, left, KIGFX::LINES, KIGFX::GAL::m_clearColor, m_dpiScale, GRID_GEOMETRY::orientation, GRID_GEOMETRY::origin, KIGFX::GAL::GRID_LATTICE::pitch, GRID_GEOMETRY::POLAR, RADIANS_T, Restore(), right, Rotate(), Save(), screenPixelSize(), KIGFX::GAL::SetFillColor(), KIGFX::GAL::SetIsFill(), KIGFX::GAL::SetIsStroke(), KIGFX::GAL::SetLayerDepth(), KIGFX::GAL::SetLineWidth(), KIGFX::GAL::SetStrokeColor(), KIGFX::GRID_SOURCE::style, top(), Translate(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by drawGridSources().
|
private |
Draw the grid sources into m_gridPool, each over its own area as the Cairo canvas paints them.
Definition at line 1083 of file gal_modern.cpp.
References drawGridSource(), KIGFX::GAL::GAL_SCOPED_ATTRS, m_currentTarget, m_drawingGridSources, m_gridLayerRanges, m_gridPool, m_gridPoolRefilled, KIGFX::GAL::m_gridSources, KIGFX::GAL::m_layerDepth, KIGFX::GAL::SetLayerDepth(), KIGFX::GAL_SCOPED_ATTRS::STROKE_FILL, and KIGFX::TARGET_CACHED.
Referenced by DrawGrid().
|
overridevirtual |
Draw the stored group.
| aGroupNumber | is the group number. |
Reimplemented from KIGFX::GAL.
Definition at line 2330 of file gal_modern.cpp.
References KIGFX::GAL_MODERN::GEOMETRY_BUFFER_SET::bitmapQuads, buf(), copy, KIGFX::GAL_MODERN::STATIC_GROUP_SLOT::count, group, KIGFX::GAL_MODERN::GEOMETRY_BUFFER_SET::instances, m_currentTarget, m_groupDepth, m_groups, KIGFX::GAL::m_layerDepth, m_nonCachedRefilled, m_overlayRefilled, m_persistentTargets, m_staticGroupSlots, m_staticPool, notePolarity(), obuf(), overlay, KIGFX::GAL_MODERN::GEOMETRY_BUFFER_SET::polygonVertices, poolForCurrentTarget(), RHI_INSTANCE_OVERLAY_ALPHA, KIGFX::RHI_INSTANCED_SHAPES, KIGFX::RHI_SHAPE_POLYGON, KIGFX::GAL_MODERN::GEOMETRY_BUFFER_SET::Sizes(), KIGFX::GAL_MODERN::STATIC_GROUP_SLOT::start, KIGFX::TARGET_OVERLAY, and traceGalGroups.
|
overridevirtual |
Draw a hole wall ring.
| aCenterPoint | is the center point of the hole. |
| aHoleRadius | is the radius of the hole. |
| aWallWidth | is the wall thickness. |
Reimplemented from KIGFX::GAL.
Definition at line 1615 of file gal_modern.cpp.
References addArcInstance(), KIGFX::GAL::m_fillColor, KIGFX::GAL::m_isFillEnabled, M_PI, RHI_INSTANCE_GROW_OUTWARD, RHI_INSTANCE_PIXEL_CIRCLE, and RHI_INSTANCE::SetFlag().
|
overridevirtual |
Draw a line.
Start and end points are defined as 2D-Vectors.
| aStartPoint | is the start point of the line. |
| aEndPoint | is the end point of the line. |
Reimplemented from KIGFX::GAL.
Definition at line 1300 of file gal_modern.cpp.
References addCapsuleInstance(), KIGFX::GAL::m_lineWidth, and KIGFX::GAL::m_strokeColor.
Referenced by DrawCurve(), drawGridSource(), drawPolylineSegments(), and strokeLineChain().
|
overridevirtual |
Draw a filled pad as one primitive in aColor.
Only called when SupportsTypedPads().
| aShapeType | is 0 circle, 1 rect, 2 roundrect, 3 chamfered, 4 oval or 5 trapezoid. |
Reimplemented from KIGFX::GAL.
Definition at line 1343 of file gal_modern.cpp.
References addPadInstance().
|
overridevirtual |
Reimplemented from KIGFX::GAL.
Definition at line 1715 of file gal_modern.cpp.
References fillOutline(), KIGFX::GAL::m_fillColor, KIGFX::GAL::m_isFillEnabled, KIGFX::GAL::m_isStrokeEnabled, SHAPE_LINE_CHAIN::PointCount(), and strokeLineChain().
|
overridevirtual |
Reimplemented from KIGFX::GAL.
Definition at line 1685 of file gal_modern.cpp.
References SHAPE_POLY_SET::CacheTriangulation(), SHAPE_POLY_SET::CHole(), SHAPE_POLY_SET::COutline(), emitTriangulatedPolygon(), SHAPE_POLY_SET::HoleCount(), SHAPE_POLY_SET::IsTriangulationUpToDate(), KIGFX::GAL::m_fillColor, KIGFX::GAL::m_isFillEnabled, KIGFX::GAL::m_isStrokeEnabled, SHAPE_POLY_SET::OutlineCount(), and strokeLineChain().
|
overridevirtual |
Draw a polygon.
| aPointList | is the list of the polygon points. |
Reimplemented from KIGFX::GAL.
Definition at line 1657 of file gal_modern.cpp.
References drawPolylineSegments(), fillOutline(), KIGFX::GAL::m_fillColor, KIGFX::GAL::m_isFillEnabled, KIGFX::GAL::m_isStrokeEnabled, and roundedOutline().
|
overridevirtual |
Reimplemented from KIGFX::GAL.
Definition at line 1672 of file gal_modern.cpp.
References drawPolylineSegments(), fillOutline(), KIGFX::GAL::m_fillColor, KIGFX::GAL::m_isFillEnabled, KIGFX::GAL::m_isStrokeEnabled, and roundedOutline().
|
overridevirtual |
Reimplemented from KIGFX::GAL.
Definition at line 1901 of file gal_modern.cpp.
References strokeLineChain().
|
overridevirtual |
Draw a polyline.
| aPointList | is a list of 2D-Vectors containing the polyline points. |
Reimplemented from KIGFX::GAL.
Definition at line 1880 of file gal_modern.cpp.
References drawPolylineSegments().
Referenced by DrawPolylines().
|
overridevirtual |
Reimplemented from KIGFX::GAL.
Definition at line 1886 of file gal_modern.cpp.
References drawPolylineSegments().
|
overridevirtual |
Reimplemented from KIGFX::GAL.
Definition at line 1892 of file gal_modern.cpp.
References drawPolylineSegments().
|
overridevirtual |
Draw multiple polylines.
| aPointLists | are lists of 2D-Vectors containing the polyline points. |
Reimplemented from KIGFX::GAL.
Definition at line 1907 of file gal_modern.cpp.
References DrawPolyline().
Referenced by DrawGlyph().
|
inlineinherited |
Definition at line 415 of file graphics_abstraction_layer.h.
References DrawRectangle(), BOX2< Vec >::GetEnd(), and BOX2< Vec >::GetOrigin().
|
overridevirtual |
Draw a rectangle.
| aStartPoint | is the start point of the rectangle. |
| aEndPoint | is the end point of the rectangle. |
Reimplemented from KIGFX::GAL.
Definition at line 1630 of file gal_modern.cpp.
References std::abs(), addCapsuleInstance(), addPadInstance(), center, KIGFX::GAL::m_fillColor, KIGFX::GAL::m_isFillEnabled, KIGFX::GAL::m_isStrokeEnabled, KIGFX::GAL::m_lineWidth, KIGFX::GAL::m_strokeColor, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by drawGridSource().
|
overridevirtual |
Draw a rounded segment.
Start and end points are defined as 2D-Vectors.
| aStartPoint | is the start point of the segment. |
| aEndPoint | is the end point of the segment. |
| aWidth | is a width of the segment |
Reimplemented from KIGFX::GAL.
Definition at line 1306 of file gal_modern.cpp.
References addArcInstance(), addCapsuleInstance(), delta, DrawCircle(), KIGFX::GAL::m_fillColor, KIGFX::GAL::m_isFillEnabled, M_PI, KIGFX::GAL::m_strokeColor, VECTOR2< T >::Resize(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by DrawSegmentChain(), and DrawSegmentChain().
|
overridevirtual |
Reimplemented from KIGFX::GAL.
Definition at line 1361 of file gal_modern.cpp.
References SEG::A, SEG::B, SHAPE_LINE_CHAIN::CSegment(), DrawSegment(), SHAPE_LINE_CHAIN::PointCount(), and SHAPE_LINE_CHAIN::SegmentCount().
|
overridevirtual |
Draw a chain of rounded segments.
| aPointList | is a list of 2D-Vectors containing the chain points. |
| aWidth | is a width of the segments |
Reimplemented from KIGFX::GAL.
Definition at line 1352 of file gal_modern.cpp.
References DrawSegment().
|
overridevirtual |
Draw a filled track capsule in aColor without touching the fill and stroke state.
Backends may override it to skip that overhead on the track hot path.
Reimplemented from KIGFX::GAL.
Definition at line 1336 of file gal_modern.cpp.
References addCapsuleInstance().
|
inlineprivate |
Append to the current target's pool.
Definition at line 430 of file gal_modern.h.
References poolForCurrentTarget().
Referenced by addArcInstance(), addCapsuleInstance(), and addPadInstance().
|
private |
Append a triangle given in world coordinates under the current transform.
Definition at line 2196 of file gal_modern.cpp.
References KIGFX::GAL_MODERN::GEOMETRY_BUFFER_SET::polygonVertices, poolForCurrentTarget(), VECTOR2< T >::x, xform(), and VECTOR2< T >::y.
Referenced by DrawGlyph(), and emitTriangulatedPolygon().
|
private |
Definition at line 2165 of file gal_modern.cpp.
References emitTriangle(), fillVertex(), SHAPE_POLY_SET::TriangulatedPolyCount(), and SHAPE_POLY_SET::TriangulatedPolygon().
Referenced by DrawPolygon(), and fillOutline().
|
inlinevirtualinherited |
Reimplemented in KIGFX::CAIRO_GAL_BASE, and KIGFX::OPENGL_GAL.
Definition at line 1362 of file graphics_abstraction_layer.h.
|
overridevirtual |
Ends rendering of a differential layer.
Objects drawn after the StartDiffLayer() will be drawn and composited with a differential blend mode, then drawing is returned to normal.
Reimplemented from KIGFX::GAL.
Definition at line 998 of file gal_modern.cpp.
References beginLayerRange(), currentTargetOpen(), layerRangesForCurrentTarget(), m_diffLayerActive, m_isDrawing, and KIGFX::GAL::m_layerDepth.
|
overridevirtual |
End the drawing, needs to be called for every new frame.
Use GAL_DRAWING_CONTEXT RAII object unless you know what you're doing.
Reimplemented from KIGFX::GAL.
Definition at line 358 of file gal_modern.cpp.
References Flush(), and m_isDrawing.
|
overridevirtual |
End the group.
Reimplemented from KIGFX::GAL.
Definition at line 2239 of file gal_modern.cpp.
References KIGFX::GAL_MODERN::GEOMETRY_BUFFER_SET::bitmapQuads, countBitmapRefs(), group, KIGFX::GAL_MODERN::GEOMETRY_BUFFER_SET::instances, m_currentGroupId, m_groupDepth, m_groupNegative, m_groups, m_groupScratchBitmapQuads, m_groupScratchInstances, m_groupScratchPolygonVertices, KIGFX::GAL::m_layerDepth, KIGFX::GAL_MODERN::GEOMETRY_BUFFER_SET::polygonVertices, poolForCurrentTarget(), KIGFX::RHI_INSTANCED_SHAPES, and swap.
|
overridevirtual |
Ends rendering of a negatives layer and draws it to the main layer.
No-op in OpenGL.
Reimplemented from KIGFX::GAL.
Definition at line 1025 of file gal_modern.cpp.
References m_negativeMode, and m_negativesLayer.
|
overrideprotectedvirtual |
Disable item update mode.
Reimplemented from KIGFX::GAL.
Definition at line 4342 of file gal_modern.cpp.
References m_isUpdating.
|
private |
Grow aBuffer to hold aNeeded elements.
On allocation failure return false and leave the buffer intact, so the caller can take the GPU out-of-memory fallback instead of dropping geometry.
Definition at line 443 of file gal_modern.cpp.
References m_deviceProxy, retireBuffer(), RHI_BUFFER_DESC::sizeBytes, RHI_BUFFER_DESC::type, and VERTEX.
Referenced by Flush(), and uploadSceneArena().
|
private |
Evict least recently used entries down to the entry and byte caps, sparing those used this frame since a submitted quad may still reference them.
Definition at line 3884 of file gal_modern.cpp.
References KIGFX::BITMAP_CACHE_MAX_BYTES, BITMAP_CACHE_MAX_ENTRIES, m_bitmapFrameStartSeq, m_bitmapTextureCache, and retireTexture().
Referenced by DrawBitmap().
|
private |
Fill an outline, closed or not, without stroking it.
Definition at line 2151 of file gal_modern.cpp.
References SHAPE_POLY_SET::CacheTriangulation(), emitTriangulatedPolygon(), SHAPE_LINE_CHAIN::PointCount(), and SHAPE_LINE_CHAIN::SetClosed().
Referenced by DrawArc(), drawEllipseShape(), DrawPolygon(), DrawPolygon(), and DrawPolygon().
|
private |
A vertex filled in aColor at the layer depth, for emitTriangle() to place.
Definition at line 2183 of file gal_modern.cpp.
References KIGFX::COLOR4D::a, KIGFX::COLOR4D::b, KIGFX::COLOR4D::g, KIGFX::GAL::m_layerDepth, m_negativeMode, notePolarity(), packColorChannel(), KIGFX::COLOR4D::r, RHI_VERTEX::SetColor(), and RHI_VERTEX::SetUV().
Referenced by DrawGlyph(), and emitTriangulatedPolygon().
|
overridevirtual |
Force all remaining objects to be drawn.
Reimplemented from KIGFX::GAL.
Definition at line 479 of file gal_modern.cpp.
References KIGFX::LAYER_RANGE::alpha, KIGFX::GAL_MODERN::POLARITY_MARK::at, KIGFX::LAYER_RANGE::bitmapCount, KIGFX::GAL_MODERN::GEOMETRY_BUFFER_SET::bitmapQuads, KIGFX::LAYER_RANGE::bitmapStart, buf(), KIGFX::GAL_MODERN::GEOMETRY_BUFFER_SET::buffer, KIGFX::GAL_MODERN::GEOMETRY_BUFFER_SET::capacity, KIGFX::LAYER_RANGE::count, KIGFX::POLARITY_RUN::count, KIGFX::GAL_MODERN::GEOMETRY_BUFFER_SET::cullRuns, KIGFX::LAYER_RANGE::depth, RHI_INSTANCE::depth, KIGFX::LAYER_RANGE::depthKnockout, KIGFX::GAL_MODERN::GEOMETRY_BUFFER_SET::Empty(), KIGFX::POLARITY_RUN::Empty(), end, ensureBuffer(), flushScene(), RHI_INSTANCE::HasFlag(), hashDigest(), hashPool(), KIGFX::LAYER_RANGE::hasNegatives, KIGFX::GAL_MODERN::GEOMETRY_BUFFER_SET::instances, keepsRelativeDepth(), KIGFX::GAL_MODERN::GEOMETRY_BUFFER_SET::lastCount, KIGFX::GAL_MODERN::GEOMETRY_BUFFER_SET::lastNegCount, m_currentTarget, m_dynamicLayerRanges, m_gridLayerRanges, m_gridPool, m_gridPoolHash, m_gridPoolRefilled, m_nonCachedRefilled, m_overlayLayerRanges, m_overlayRefilled, m_renderThread, m_sceneChanged, m_staticDirty, m_staticLayerRanges, m_staticPatches, m_staticPool, m_staticRebuiltThisFlush, KIGFX::GAL_MODERN::POLARITY_MARK::negative, KIGFX::POLARITY_RUN::negative, KIGFX::LAYER_RANGE::negCount, KIGFX::LAYER_RANGE::negStart, obuf(), KIGFX::GAL_MODERN::GEOMETRY_BUFFER_SET::polarityMarks, KIGFX::GAL_MODERN::GEOMETRY_BUFFER_SET::polarityRuns, KIGFX::GAL_MODERN::GEOMETRY_BUFFER_SET::polygonVertices, relativeDepth(), KIGFX::RHI_CULL_RUN_LENGTH, KIGFX::RHI_CULL_VERTEX_RUN_LENGTH, RHI_INSTANCE_HARD_EDGE, RHI_INSTANCE_NEGATIVE, KIGFX::RHI_INSTANCED_SHAPES, KIGFX::RHI_SHAPE_POLYGON, KIGFX::RHI_SHAPES, RhiUploadAdoptStaging(), RhiUploadCopyStaging(), KIGFX::RhiVertexRun(), KIGFX::LAYER_RANGE::runCount, KIGFX::LAYER_RANGE::runStart, RHI_INSTANCE::SetFlag(), KIGFX::LAYER_RANGE::singleCoverage, KIGFX::GAL_MODERN::GEOMETRY_BUFFER_SET::Sizes(), KIGFX::LAYER_RANGE::start, KIGFX::POLARITY_RUN::start, submitSpan(), table, KIGFX::LAYER_RANGE::target, RHI_GEOMETRY_UPLOAD::targetBuffer, RHI_GEOMETRY_UPLOAD::targetOffset, and updateRuns().
Referenced by EndDrawing().
|
private |
Settle hoisted alpha, compact and upload.
False on allocation failure.
Definition at line 3284 of file gal_modern.cpp.
References KIGFX::GAL_MODERN::SCENE_LAYER::alphaCount, KIGFX::GAL_MODERN::SCENE_LAYER::alphaStale, ARENA_INSTANCE_COUNT, ARENA_POLYGON, KIGFX::GAL_MODERN::SCENE_LAYER::bakedAlpha, buildSceneRuns(), compactSceneArena(), KIGFX::GAL_MODERN::SCENE_LAYER::cullRuns, KIGFX::GAL_MODERN::SCENE_LAYER::instances, m_groups, m_openSceneLayer, m_openSceneLayerId, m_sceneLayers, m_sceneOrder, m_sceneOrderStale, KIGFX::GAL_MODERN::SCENE_LAYER::polygons, KIGFX::GAL_MODERN::SCENE_LAYER::residents, KIGFX::GAL_MODERN::SCENE_LAYER::runsStale, sceneLayerComposited(), sortSceneOrder(), KIGFX::GAL_MODERN::SCENE_LAYER::translucent, updateSceneCullRuns(), uploadSceneArena(), KIGFX::GAL_MODERN::SCENE_LAYER::visible, and writeGroupToScene().
Referenced by Flush(), and SyncScene().
|
private |
Definition at line 2512 of file gal_modern.cpp.
References KIGFX::GAL_MODERN::SCENE_ARENA< T >::dead, KIGFX::GAL_MODERN::SCENE_ARENA< T >::elements, fillDead(), KIGFX::GAL_MODERN::SCENE_ARENA< T >::freeSlots, and markSceneDirty().
Referenced by removeGroupFromScene().
|
inlineinherited |
Definition at line 519 of file graphics_abstraction_layer.h.
References m_clearColor.
Referenced by EDIT_POINTS::ViewDraw().
|
inlineinherited |
Definition at line 1280 of file graphics_abstraction_layer.h.
References m_gridTick.
|
inlinevirtualinherited |
Check whether a GPU reset destroyed this canvas' rendering context.
A lost canvas cannot draw or update cached items until its owner rebuilds it.
Reimplemented in KIGFX::OPENGL_GAL.
Definition at line 1391 of file graphics_abstraction_layer.h.
References KIGFX::NONE.
|
protectedinherited |
Get the actual cursor color to draw.
Definition at line 437 of file graphics_abstraction_layer.cpp.
References KIGFX::COLOR4D::a, m_cursorColor, and m_isCursorEnabled.
Referenced by KIGFX::CAIRO_GAL_BASE::blitCursor(), KIGFX::OPENGL_GAL::blitCursor(), and KIGFX::GAL_MODERN::PopulateCursorUBO().
| FRAME_DRAW_DESC GAL_MODERN::GetDrawDesc | ( | ) | const |
Snapshot buffer handles, draw counts and grid and cursor uniforms after EndDrawing()
Definition at line 4168 of file gal_modern.cpp.
References appendBitmapDraws(), appendSceneRanges(), KIGFX::FRAME_DRAW_DESC::count, GetDynamicDrawDesc(), KIGFX::FRAME_DRAW_DESC::layerRanges, m_staticLayerRanges, m_staticPool, KIGFX::FRAME_DRAW_DESC::negCount, and KIGFX::RHI_SHAPES.
| FRAME_DRAW_DESC GAL_MODERN::GetDynamicDrawDesc | ( | ) | const |
Draw descriptor of the current dynamic ring slot, which is rebuilt every frame.
Definition at line 4111 of file gal_modern.cpp.
References appendBitmapDraws(), appendPoolRanges(), assignSlicesByOrder(), KIGFX::FRAME_DRAW_DESC::backgroundColor, KIGFX::FRAME_DRAW_DESC::bitmapDraws, buf(), KIGFX::FRAME_DRAW_DESC::bufferGeneration, buildDescForPool(), KIGFX::GAL_MODERN::GEOMETRY_BUFFER_SET::cullRuns, KIGFX::FRAME_DRAW_DESC::drawCursor, KIGFX::FRAME_DRAW_DESC::drawGrid, keepsRelativeDepth(), KIGFX::FRAME_DRAW_DESC::layerRanges, m_bufferGeneration, KIGFX::GAL::m_clearColor, m_drawCursor, m_drawGrid, m_dynamicLayerRanges, m_overlayLayerRanges, m_persistentTargets, obuf(), overlay, PopulateCameraUBOs(), PopulateCursorUBO(), KIGFX::FRAME_DRAW_DESC::relativeDepth, KIGFX::FRAME_DRAW_DESC::testAgainstStatic, and toFloat4().
Referenced by GetDrawDesc().
|
inlineinherited |
Get the fill color.
Definition at line 588 of file graphics_abstraction_layer.h.
References m_fillColor.
Referenced by DrawGlyphs().
|
inlineinherited |
Definition at line 712 of file graphics_abstraction_layer.h.
References m_attributes.
Referenced by KIGFX::GAL_MODERN::BitmapText(), KIGFX::OPENGL_GAL::BitmapText(), KIGFX::GAL_MODERN::drawBitmapGlyphs(), and KIGFX::PREVIEW::ANGLE_ITEM::drawPreviewShape().
|
inlineinherited |
Definition at line 1281 of file graphics_abstraction_layer.h.
References m_gridColor.
|
inlineinherited |
Get the grid line width.
Definition at line 1263 of file graphics_abstraction_layer.h.
References m_gridLineWidth.
|
inlineinherited |
Definition at line 1161 of file graphics_abstraction_layer.h.
References m_gridOrigin.
For a given point it returns the nearest point belonging to the grid in world coordinates.
| aPoint | is the point for which the grid point is searched. |
Definition at line 405 of file graphics_abstraction_layer.cpp.
References KiROUND(), m_gridOffset, m_gridSize, m_gridSources, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by KIGFX::WX_VIEW_CONTROLS::GetRawCursorPosition().
|
inlineinherited |
Return the grid size.
Definition at line 1188 of file graphics_abstraction_layer.h.
References m_gridSize.
Referenced by COMMON_TOOLS::CursorControl(), GERBVIEW_FRAME::DisplayGridMsg(), EDA_DRAW_FRAME::GetNearestGridPosition(), EDA_DRAW_FRAME::GetNearestHalfGridPosition(), DIALOG_FP_EDIT_PAD_TABLE::OnAddRow(), COMMON_TOOLS::PanControl(), and SCH_DRAWING_TOOLS::sizeSheet().
|
inlineinherited |
Definition at line 1135 of file graphics_abstraction_layer.h.
References KIGFX::ALWAYS, m_gridVisibility, m_options, and KIGFX::WITH_GRID.
Referenced by KIGFX::WX_VIEW_CONTROLS::GetRawCursorPosition(), ROUTER_TOOL::InlineBreakTrack(), ROUTER_TOOL::InlineDrag(), PNS::TOOL_BASE::updateEndItem(), and PNS::TOOL_BASE::updateStartItem().
|
inlineinherited |
Definition at line 1277 of file graphics_abstraction_layer.h.
References m_gridSources.
|
inlineinherited |
Definition at line 1279 of file graphics_abstraction_layer.h.
References m_gridStyle.
|
inlineinherited |
Definition at line 1133 of file graphics_abstraction_layer.h.
References m_gridVisibility.
|
inlineinherited |
Definition at line 731 of file graphics_abstraction_layer.h.
References m_attributes.
Referenced by KIGFX::OPENGL_GAL::BitmapText(), and KIGFX::GAL_MODERN::drawBitmapGlyphs().
|
inlineinherited |
Get the fill status.
Definition at line 548 of file graphics_abstraction_layer.h.
References m_isFillEnabled.
|
inlineinherited |
Get the stroke status.
Definition at line 568 of file graphics_abstraction_layer.h.
References m_isStrokeEnabled.
|
inlineprivateinherited |
Definition at line 1613 of file graphics_abstraction_layer.h.
References m_layerDepth.
|
inlineoverridevirtual |
Return the size the view is centred in and panned by.
It is the canvas size unless the canvas lays its view out like one of another size.
Reimplemented from KIGFX::GAL.
Definition at line 157 of file gal_modern.h.
References m_centringPad, and KIGFX::GAL::m_screenSize.
|
inlineinherited |
Get the line width.
Definition at line 643 of file graphics_abstraction_layer.h.
References m_lineWidth.
Referenced by BitmapText(), CALLBACK_GAL::DrawGlyph(), ROUTER_PREVIEW_ITEM::drawLineChain(), and RATSNEST_VIEW_ITEM::ViewDraw().
|
inlineinherited |
Definition at line 917 of file graphics_abstraction_layer.h.
References m_lookAtPoint.
Referenced by GetVisibleWorldExtents().
|
inlineinherited |
Definition at line 938 of file graphics_abstraction_layer.h.
References m_depthRange.
|
inlineinherited |
Definition at line 937 of file graphics_abstraction_layer.h.
References m_depthRange.
Referenced by EDIT_POINTS::ViewDraw(), KIGFX::PREVIEW::RULER_ITEM::ViewDraw(), and KIGFX::VIEW_OVERLAY::ViewDraw().
|
inlineinherited |
Get the minimum line width in pixels.
Definition at line 653 of file graphics_abstraction_layer.h.
References m_minLineWidth.
Referenced by KIGFX::OPENGL_GAL::BeginDrawing().
|
inlineinherited |
Definition at line 926 of file graphics_abstraction_layer.h.
References m_rotation.
|
inlineinherited |
Definition at line 909 of file graphics_abstraction_layer.h.
References m_screenDPI.
|
inlineinherited |
Return GAL canvas size in pixels.
Definition at line 494 of file graphics_abstraction_layer.h.
References m_screenSize.
Referenced by BOARD_PRINTOUT::DrawPage(), DIALOG_VIA_STITCH_PROPERTIES::fitPreview(), SCH_PRINTOUT::PrintPage(), and KIGFX::PREVIEW::RULER_ITEM::ViewDraw().
|
inlineinherited |
Get the screen <-> world transformation matrix.
The matrix carries the world scale, so this counts as a read of it, see TakeWorldScaleRead().
Definition at line 868 of file graphics_abstraction_layer.h.
References m_screenWorldMatrix, and m_worldScaleRead.
Referenced by GetVisibleWorldExtents(), KIGFX::OPENGL_GAL::getWorldPixelSize(), screenSpaceCircle(), screenSpaceLine(), ROUTER_STATUS_VIEW_ITEM::ViewDraw(), and TUNING_STATUS_VIEW_ITEM::ViewDraw().
| FRAME_DRAW_DESC GAL_MODERN::GetStaticDrawDesc | ( | ) | const |
Draw descriptor of the static pool.
Safe to call at any time.
Definition at line 4080 of file gal_modern.cpp.
References appendPoolRanges(), appendSceneRanges(), KIGFX::FRAME_DRAW_DESC::backgroundColor, KIGFX::FRAME_DRAW_DESC::bufferGeneration, buildDescForPool(), KIGFX::FRAME_DRAW_DESC::drawGrid, KIGFX::FRAME_DRAW_DESC::gridFirst, KIGFX::FRAME_DRAW_DESC::layerRanges, m_bufferGeneration, KIGFX::GAL::m_clearColor, m_drawGrid, m_gridLayerRanges, m_gridPool, m_persistentTargets, m_staticLayerRanges, m_staticPool, PopulateCameraUBOs(), and toFloat4().
|
inlineinherited |
Get the stroke color.
Definition at line 613 of file graphics_abstraction_layer.h.
References m_strokeColor.
Referenced by DrawGlyphs(), KIGFX::PREVIEW::DrawTextNextToCursor(), and KIGFX::PREVIEW::RULER_ITEM::ViewDraw().
|
overridevirtual |
Return the swap interval. -1 for adaptive, 0 for disabled/unknown.
Reimplemented from KIGFX::GAL.
Definition at line 4007 of file gal_modern.cpp.
|
overridevirtual |
Get the currently used target for rendering.
Reimplemented from KIGFX::GAL.
Definition at line 956 of file gal_modern.cpp.
References m_currentTarget.
|
inlineinherited |
Definition at line 738 of file graphics_abstraction_layer.h.
References m_attributes.
Referenced by KIGFX::OPENGL_GAL::BitmapText(), and KIGFX::GAL_MODERN::drawBitmapGlyphs().
|
inlineinherited |
Return the visible grid size in x and y directions.
Definition at line 1198 of file graphics_abstraction_layer.h.
References KIGFX::AutoSparsePitch(), computeMinGridSpacing(), m_gridSize, m_gridStyle, m_gridTick, m_worldScale, minSize, KIGFX::SMALL_CROSS, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by KIGFX::CAIRO_GAL_BASE::DrawGrid(), KIGFX::OPENGL_GAL::DrawGrid(), KIGFX::GAL_MODERN::PopulateCameraUBOs(), and ViaSnapRange().
|
inherited |
Definition at line 251 of file graphics_abstraction_layer.cpp.
References GetLookAtPoint(), MATRIX3x3< T >::GetScale(), GetScreenWorldMatrix(), m_screenSize, BOX2< Vec >::SetOrigin(), BOX2< Vec >::SetSize(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by ROUTER_TOOL::handleCommonEvents(), and ROUTER_TOOL::InlineDrag().
|
inlineinherited |
Get the world scale.
Definition at line 945 of file graphics_abstraction_layer.h.
References m_worldScale, and m_worldScaleRead.
Referenced by KIGFX::DrawDashedLine(), KIGFX::PREVIEW::DrawTextNextToCursor(), drawTicksAlongLine(), KIGFX::PREVIEW::GetConstantGlyphHeight(), SCH_BASE_FRAME::RefreshZoomDependentItems(), CONSTRAINT_BADGE_ITEM::ViewDraw(), KIGFX::CONSTRUCTION_GEOM::ViewDraw(), KIGFX::PREVIEW::RULER_ITEM::ViewDraw(), and RATSNEST_VIEW_ITEM::ViewDraw().
|
inlineinherited |
Get the world scale to size something drawn in screen space mode.
Such things keep their pixel size at any scale, so unlike GetWorldScale() this is not a read, see TakeWorldScaleRead().
Definition at line 955 of file graphics_abstraction_layer.h.
References m_worldScale.
|
inlineinherited |
Get the world <-> screen transformation matrix.
The matrix carries the world scale, so this counts as a read of it, see TakeWorldScaleRead().
Definition at line 855 of file graphics_abstraction_layer.h.
References m_worldScaleRead, and m_worldScreenMatrix.
|
inlineinherited |
Definition at line 898 of file graphics_abstraction_layer.h.
References m_worldUnitLength.
Referenced by CONSTRAINT_BADGE_ITEM::ViewDraw().
|
inlineinherited |
Definition at line 920 of file graphics_abstraction_layer.h.
References m_zoomFactor.
Referenced by COMMON_TOOLS::doZoomInOut(), and EDA_DRAW_FRAME::SyncZoomSelectBox().
|
protectedinherited |
Thin a grid source's pitch out until its lines are far enough apart on screen.
A cartesian grid keeps the shape of its cells.
Definition at line 308 of file graphics_abstraction_layer.cpp.
References std::abs(), KIGFX::AutoSparsePitch(), computeMinGridSpacing(), GRID_GEOMETRY::extent, KIGFX::GAL::GRID_LATTICE::extent, BOX2< Vec >::GetBottom(), BOX2< Vec >::GetLeft(), BOX2< Vec >::GetRight(), BOX2< Vec >::GetTop(), gridScreenBBox(), GRID_GEOMETRY::kind, m_gridTick, M_PI, m_worldScale, GRID_GEOMETRY::pitch, KIGFX::GAL::GRID_LATTICE::pitch, GRID_GEOMETRY::POLAR, KIGFX::SMALL_CROSS, KIGFX::GRID_SOURCE::style, KIGFX::GAL::GRID_LATTICE::tick, KIGFX::GRID_SOURCE::tick, KIGFX::GRID_SOURCE::unbounded, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by KIGFX::CAIRO_GAL_BASE::drawGridSource(), KIGFX::GAL_MODERN::drawGridSource(), and KIGFX::OPENGL_GAL::drawGridSources().
|
inlineprotectedinherited |
Compute the world width of a minor grid line.
A major line is twice as wide. Shaders round this to whole pixels, so every canvas must evaluate it in the same order to round the same way.
| aWorldPixelSize | is the world length of a screen pixel. |
| aScaleFactor | is the canvas DPI scale factor. |
Definition at line 1460 of file graphics_abstraction_layer.h.
References m_gridLineWidth.
Referenced by KIGFX::OPENGL_GAL::DrawGrid(), KIGFX::GAL_MODERN::drawGridSource(), KIGFX::OPENGL_GAL::drawGridSources(), and KIGFX::GAL_MODERN::PopulateCameraUBOs().
|
protectedinherited |
Definition at line 286 of file graphics_abstraction_layer.cpp.
References m_screenSize, m_screenWorldMatrix, BOX2< Vec >::Merge(), GRID_GEOMETRY::orientation, GRID_GEOMETRY::origin, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by drawGridCoverageShape(), KIGFX::CAIRO_GAL_BASE::drawGridSource(), KIGFX::GAL_MODERN::drawGridSource(), KIGFX::OPENGL_GAL::drawGridSources(), and gridLattice().
|
inlineprivate |
Definition at line 735 of file gal_modern.h.
References KIGFX::GAL::m_gridSize, and KIGFX::GAL::m_gridVisibility.
Referenced by DrawGrid(), and PopulateCameraUBOs().
|
protectedinherited |
The colour a grid source is drawn in, brightened while it is being edited.
Definition at line 348 of file graphics_abstraction_layer.cpp.
References KIGFX::COLOR4D::a, KIGFX::COLOR4D::Brighten(), KIGFX::GRID_SOURCE::color, KIGFX::GRID_SELECTED_BRIGHTEN, KIGFX::GRID_SOURCE::highlighted, and m_gridColor.
Referenced by KIGFX::CAIRO_GAL_BASE::drawGridSource(), KIGFX::GAL_MODERN::drawGridSource(), and KIGFX::OPENGL_GAL::drawGridSources().
|
overridevirtual |
Reimplemented from KIGFX::GAL.
Definition at line 2311 of file gal_modern.cpp.
References computeGroupFingerprint(), group, and m_groups.
Referenced by ChangeGroupColor(), ChangeGroupDepth(), ChangeGroupUndimmed(), retainedTieOrderChanged(), and SetGroupPlacement().
|
inlineoverridevirtual |
Return true if the backend keeps cached groups in a persistent scene that it patches in place, so one changed item does not make VIEW emit every cached layer again.
VIEW places each group with SetGroupPlacement() and emits the cached layers through BeginSceneLayer() only while HasStaticRebuildPending(). The scene holds every item, not just the viewport.
Reimplemented from KIGFX::GAL.
Definition at line 58 of file gal_modern.h.
|
inlineoverridevirtual |
Return true if the backend dropped its cached geometry and VIEW must draw the cached layers again, even when its own TARGET_CACHED is clean.
Otherwise the pool would rebuild empty and blank the scene.
Reimplemented from KIGFX::GAL.
Definition at line 57 of file gal_modern.h.
References m_staticDirty.
|
inlinevirtualinherited |
Return true if the target exists.
| aTarget | is the target to be checked. |
Reimplemented in KIGFX::OPENGL_GAL.
Definition at line 1039 of file graphics_abstraction_layer.h.
|
inlinevirtualinherited |
Return true if the GAL engine is a Cairo based type.
Reimplemented in KIGFX::CAIRO_GAL_BASE.
Definition at line 164 of file graphics_abstraction_layer.h.
Referenced by getShadowLayer().
|
inlinevirtualinherited |
Checks the state of the context lock.
Reimplemented in KIGFX::OPENGL_GAL.
Definition at line 1368 of file graphics_abstraction_layer.h.
|
inlinevirtualinherited |
Check whether the locked context is actually the current one.
A canvas whose native window is already gone cannot be made current. GL commands issued while this is false land in whichever sibling context is still bound.
Reimplemented in KIGFX::OPENGL_GAL.
Definition at line 1381 of file graphics_abstraction_layer.h.
|
inlineinherited |
Return information about cursor visibility.
Definition at line 1340 of file graphics_abstraction_layer.h.
References m_forceDisplayCursor, and m_isCursorEnabled.
Referenced by KIGFX::CAIRO_GAL_BASE::blitCursor(), KIGFX::OPENGL_GAL::blitCursor(), and KIGFX::GAL_MODERN::PopulateCursorUBO().
|
inlineoverridevirtual |
Return true if the GAL is inside a BeginDrawing/EndDrawing pair.
Reimplemented from KIGFX::GAL.
Definition at line 56 of file gal_modern.h.
References m_isDrawing.
|
inlineinherited |
Definition at line 1006 of file graphics_abstraction_layer.h.
References m_globalFlipX.
Referenced by KIGFX::CAIRO_GAL_BASE::angle_xform(), KIGFX::CAIRO_GAL_BASE::arc_angles_xform_and_normalize(), KIGFX::PREVIEW::DrawTextNextToCursor(), DS_PROXY_VIEW_ITEM::ViewDraw(), ROUTER_STATUS_VIEW_ITEM::ViewDraw(), and TUNING_STATUS_VIEW_ITEM::ViewDraw().
|
inlineinherited |
Definition at line 1007 of file graphics_abstraction_layer.h.
References m_globalFlipY.
|
inlineinherited |
Definition at line 715 of file graphics_abstraction_layer.h.
References m_attributes.
|
inlineinherited |
Definition at line 718 of file graphics_abstraction_layer.h.
References m_attributes.
|
inlineinherited |
Definition at line 721 of file graphics_abstraction_layer.h.
References m_attributes.
|
inlineoverridevirtual |
Return the initialization status for the canvas.
Reimplemented from KIGFX::GAL.
Definition at line 55 of file gal_modern.h.
References m_rhiInitialized.
Referenced by GAL_MODERN().
|
inlinevirtualinherited |
Return true if the GAL engine is a OpenGL based type.
Reimplemented in KIGFX::OPENGL_GAL.
Definition at line 167 of file graphics_abstraction_layer.h.
|
inlinevirtualinherited |
Check whether the driver has finished the reset that destroyed this canvas' context.
Rebuilding before then can fail or hang in the driver.
Reimplemented in KIGFX::OPENGL_GAL.
Definition at line 1401 of file graphics_abstraction_layer.h.
|
inlineinherited |
Definition at line 724 of file graphics_abstraction_layer.h.
References m_attributes.
Referenced by KIGFX::OPENGL_GAL::BitmapText(), and KIGFX::GAL_MODERN::drawBitmapGlyphs().
|
inlinevirtualinherited |
Return true if the GAL canvas is visible on the screen.
Reimplemented in KIGFX::CAIRO_GAL, and KIGFX::OPENGL_GAL.
Definition at line 161 of file graphics_abstraction_layer.h.
|
inlineprivate |
The pool is a kept target whose ranges are drawn in depth slices, see Flush()
Definition at line 858 of file gal_modern.h.
References m_gridPool, m_persistentTargets, and m_staticPool.
Referenced by Flush(), and GetDynamicDrawDesc().
|
inlineprivate |
Definition at line 902 of file gal_modern.h.
References m_currentTarget, m_drawingGridSources, m_dynamicLayerRanges, m_gridLayerRanges, m_overlayLayerRanges, m_staticLayerRanges, KIGFX::TARGET_CACHED, and KIGFX::TARGET_OVERLAY.
Referenced by beginLayerRange(), EndDiffLayer(), notePolarity(), SetLayerDepth(), SetNegativeDrawMode(), StartDiffLayer(), and StartNegativesLayer().
|
inlineprivate |
Definition at line 913 of file gal_modern.h.
References m_currentTarget, m_drawingGridSources, m_dynamicLayerRanges, m_gridLayerRanges, m_overlayLayerRanges, m_staticLayerRanges, KIGFX::TARGET_CACHED, and KIGFX::TARGET_OVERLAY.
|
inlinevirtualinherited |
Use GAL_CONTEXT_LOCKER RAII object unless you know what you're doing.
Reimplemented in KIGFX::OPENGL_GAL.
Definition at line 1408 of file graphics_abstraction_layer.h.
|
private |
An instance in aColor at the layer depth, with the current polarity and padding.
Definition at line 1428 of file gal_modern.cpp.
References KIGFX::COLOR4D::a, RHI_INSTANCE::a, KIGFX::COLOR4D::b, KIGFX::COLOR4D::g, m_currentTarget, m_groupDepth, KIGFX::GAL::m_layerDepth, m_negativeMode, m_strokePixelPad, notePolarity(), packColorChannel(), RHI_INSTANCE::pixelPad, KIGFX::COLOR4D::r, RHI_INSTANCE_NEGATIVE, RHI_INSTANCE_OVERLAY_ALPHA, RHI_INSTANCE::SetColor(), RHI_INSTANCE::SetDepth(), RHI_INSTANCE::SetFlag(), and KIGFX::TARGET_OVERLAY.
Referenced by addArcInstance(), addCapsuleInstance(), and addPadInstance().
|
inlineoverridevirtual |
Force the next Flush() to rebuild the static pool from scratch.
Reimplemented from KIGFX::GAL.
Definition at line 346 of file gal_modern.h.
References m_staticDirty.
Ensure that the first element is smaller than the second.
Definition at line 1540 of file graphics_abstraction_layer.h.
References T.
Referenced by KIGFX::CAIRO_GAL_BASE::arc_angles_xform_and_normalize(), KIGFX::GAL_MODERN::DrawArc(), KIGFX::OPENGL_GAL::DrawArc(), KIGFX::GAL_MODERN::DrawArcSegment(), KIGFX::OPENGL_GAL::DrawArcSegment(), and KIGFX::OPENGL_GAL::DrawEllipseArc().
|
private |
Note the polarity of what is about to be drawn, so that a pool remembers where it changed.
Definition at line 1032 of file gal_modern.cpp.
References KIGFX::GAL_MODERN::GEOMETRY_BUFFER_SET::drawsNegative, layerRangesForCurrentTarget(), m_currentGroupId, m_groupNegative, KIGFX::GAL_MODERN::GEOMETRY_BUFFER_SET::polarityMarks, poolForCurrentTarget(), and KIGFX::GAL_MODERN::GEOMETRY_BUFFER_SET::Sizes().
Referenced by drawBitmapGlyphs(), DrawGroup(), fillVertex(), and makeInstance().
|
inlineprivate |
Definition at line 799 of file gal_modern.h.
References m_currentOverlaySet, and m_overlaySets.
Referenced by ClearScreen(), DrawGroup(), Flush(), GetDynamicDrawDesc(), poolForCurrentTarget(), poolForCurrentTarget(), and refillDynamicTarget().
|
inlineprivate |
Definition at line 800 of file gal_modern.h.
References m_currentOverlaySet, and m_overlaySets.
|
overrideprotectedvirtualinherited |
Handler for observer settings changes.
Implements KIGFX::GAL_DISPLAY_OPTIONS_OBSERVER.
Definition at line 105 of file graphics_abstraction_layer.cpp.
References updatedGalDisplayOptions().
|
private |
Patch a cached group in place in the static pool, applying aInstance to each instance and aVertex to each polygon vertex, and record the touched spans for a partial upload.
Definition at line 3642 of file gal_modern.cpp.
References KIGFX::GAL_MODERN::STATIC_GROUP_SLOT::count, m_staticGroupSlots, m_staticPatches, m_staticPool, KIGFX::RHI_INSTANCED_SHAPES, KIGFX::RHI_SHAPE_POLYGON, KIGFX::RHI_SHAPES, and KIGFX::GAL_MODERN::STATIC_GROUP_SLOT::start.
Referenced by ChangeGroupColor(), and ChangeGroupDepth().
|
private |
Definition at line 2675 of file gal_modern.cpp.
References allocSceneSlot(), KIGFX::GAL_MODERN::SCENE_LAYER::alphaStale, ARENA_INSTANCE_COUNT, ARENA_POLYGON, KIGFX::GAL_MODERN::GAL_GROUP::bitmapQuads, KIGFX::GAL_MODERN::SCENE_LAYER::bitmapResidents, countGroupAlpha(), countGroupArenas(), KIGFX::GAL_MODERN::SCENE_LAYER::instances, KIGFX::GAL_MODERN::SCENE_LAYER::knockoutGroups, m_placeSeq, m_sceneChanged, KIGFX::GAL_MODERN::GAL_GROUP::negative, KIGFX::GAL_MODERN::GAL_GROUP::order, KIGFX::GAL_MODERN::GAL_GROUP::placeSeq, KIGFX::GAL_MODERN::SCENE_LAYER::polygons, KIGFX::GAL_MODERN::GAL_GROUP::polygonVertices, KIGFX::GAL_MODERN::GAL_GROUP::resident, KIGFX::GAL_MODERN::GAL_GROUP::residentIndex, KIGFX::GAL_MODERN::SCENE_LAYER::residents, retainedPrefixHash(), KIGFX::GAL_MODERN::SCENE_LAYER::retainedPrefixIndex, KIGFX::GAL_MODERN::SCENE_LAYER::runsStale, KIGFX::GAL_MODERN::GAL_GROUP::slotCount, KIGFX::GAL_MODERN::GAL_GROUP::slotStart, and writeGroupToScene().
Referenced by SetGroupPlacement(), and SetSceneScale().
|
inlineprivate |
TARGET_CACHED draws to the static pool and every other target to its dynamic ring slot.
A target not cleared this frame is started afresh, since what it holds was already handed to the render thread.
Definition at line 803 of file gal_modern.h.
References buf(), currentTargetOpen(), m_currentTarget, m_drawingGridSources, m_gridPool, m_groupDepth, m_isDrawing, m_staticPool, obuf(), refillDynamicTarget(), KIGFX::TARGET_CACHED, and KIGFX::TARGET_OVERLAY.
Referenced by addArcInstance(), addPadInstance(), BeginGroup(), DrawBitmap(), drawBitmapGlyphs(), DrawGroup(), emitInstance(), emitTriangle(), EndGroup(), and notePolarity().
|
inlineprivate |
Definition at line 821 of file gal_modern.h.
References buf(), m_currentTarget, m_drawingGridSources, m_gridPool, m_staticPool, obuf(), KIGFX::TARGET_CACHED, and KIGFX::TARGET_OVERLAY.
| void GAL_MODERN::PopulateCameraUBOs | ( | KIGFX::FRAME_DRAW_DESC & | aDesc | ) | const |
Update the camera-dependent UBOs of an existing descriptor.
The camera fast path uses this rather than read ring-buffered geometry state that reuse_scene frames may have overwritten.
Definition at line 4188 of file gal_modern.cpp.
References KIGFX::GRID_UBO_DATA::axisColorX, KIGFX::GRID_UBO_DATA::axisColorY, KIGFX::DOTS, KIGFX::FRAME_DRAW_DESC::frameUBO, KIGFX::GAL::GetVisibleGridSize(), KIGFX::GRID_UBO_DATA::gridAngle, KIGFX::GRID_UBO_DATA::gridColor, KIGFX::GAL::gridMinorLineWidth(), KIGFX::GRID_UBO_DATA::gridOrigin, gridShown(), KIGFX::GRID_UBO_DATA::gridSpacing, KIGFX::GRID_UBO_DATA::gridStyle, KIGFX::GRID_UBO_DATA::gridTick, KIGFX::FRAME_DRAW_DESC::gridUBO, MATRIX3x3< T >::Inverse(), KIGFX::GRID_UBO_DATA::invProjection, KIGFX::LINES, KIGFX::GAL::m_axesColor, KIGFX::GAL::m_axesEnabled, MATRIX3x3< T >::m_data, m_deviceProxy, m_dpiScale, KIGFX::GAL::m_gridColor, KIGFX::GAL::m_gridLineWidth, KIGFX::GAL::m_gridOrigin, KIGFX::GAL::m_gridStyle, KIGFX::GAL::m_gridTick, m_screenHeight, m_screenWidth, KIGFX::GAL::m_screenWorldMatrix, KIGFX::GAL::m_zoomFactor, KIGFX::GRID_UBO_DATA::majorLineWorld, KIGFX::GAL::MAX_DEPTH, KIGFX::GRID_UBO_DATA::minorLineWidth, KIGFX::FRAME_UBO_DATA::projection, KIGFX::FRAME_DRAW_DESC::RELATIVE_DEPTH_RANGE, KIGFX::FRAME_DRAW_DESC::relativeDepth, RhiAdjustProjectionForBackend(), RhiBackendNeedsYFlip(), S, screenPixelSize(), KIGFX::SMALL_CROSS, toFloat4(), KIGFX::FRAME_UBO_DATA::viewport, KIGFX::GRID_UBO_DATA::viewport, KIGFX::FRAME_UBO_DATA::viewScale, KIGFX::GRID_UBO_DATA::worldPixelSize, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by GetDynamicDrawDesc(), and GetStaticDrawDesc().
| void GAL_MODERN::PopulateCursorUBO | ( | KIGFX::FRAME_DRAW_DESC & | aDesc | ) | const |
Update only the cursor UBO fields, for overlay-only frames that reuse the scene geometry.
Definition at line 4298 of file gal_modern.cpp.
References KIGFX::CURSOR_UBO_DATA::crosshairColor, KIGFX::CURSOR_UBO_DATA::crosshairWidth, KIGFX::CURSOR_UBO_DATA::cursorPos, KIGFX::CURSOR_UBO_DATA::cursorSize, KIGFX::CURSOR_UBO_DATA::cursorType, KIGFX::FRAME_DRAW_DESC::cursorUBO, KIGFX::FRAME_DRAW_DESC::drawCursor, KIGFX::FULLSCREEN_CROSS, KIGFX::FULLSCREEN_DIAGONAL, KIGFX::GAL::getCursorColor(), KIGFX::GAL::IsCursorEnabled(), KIGFX::GAL::m_crossHairMode, KIGFX::GAL::m_cursorPosition, m_deviceProxy, m_dpiScale, m_screenHeight, m_screenWidth, KIGFX::GAL::m_worldScreenMatrix, RhiBackendNeedsYFlip(), KIGFX::CURSOR_UBO_DATA::showSnap, KIGFX::SMALL_CROSS, KIGFX::CURSOR_UBO_DATA::snapColor, KIGFX::CURSOR_UBO_DATA::snapRadius, toFloat4(), KIGFX::CURSOR_UBO_DATA::viewport, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by GetDynamicDrawDesc().
|
inlineprivate |
Exact comparison is enough since a false negative only takes the slow path.
Definition at line 401 of file gal_modern.h.
References m_currentTransform, and m_transformIsIdentity.
Referenced by Restore(), and Transform().
|
private |
Rotate a dynamic target's ring, empty the new slot and open a range at the current depth.
Definition at line 324 of file gal_modern.cpp.
References beginLayerRange(), KIGFX::GAL_MODERN::GEOMETRY_BUFFER_SET::bitmapQuads, buf(), BUFFER_RING_SIZE, KIGFX::GAL_MODERN::GEOMETRY_BUFFER_SET::ClearGeometry(), m_currentBufferSet, m_currentOverlaySet, m_currentTarget, m_drawGrid, m_dynamicLayerRanges, m_isDrawing, KIGFX::GAL::m_layerDepth, m_nonCachedRefilled, m_overlayLayerRanges, m_overlayRefilled, m_persistentTargets, obuf(), overlay, releaseBitmapQuads(), and KIGFX::TARGET_OVERLAY.
Referenced by BeginDrawing(), ClearTarget(), and poolForCurrentTarget().
|
inlineoverridevirtual |
Return true if the backend empties every non-cached target each frame, so VIEW must emit them again even when clean.
Reimplemented from KIGFX::GAL.
Definition at line 59 of file gal_modern.h.
References m_persistentTargets.
|
private |
Retire the textures and vertex buffers the quads own, then empty the list.
Definition at line 401 of file gal_modern.cpp.
References retireBuffer(), and retireTexture().
Referenced by BeginDrawing(), ClearCache(), ClearScreen(), DeleteGroup(), DestroyBuffers(), and refillDynamicTarget().
|
inline |
Drop all GPU handles without destroying them.
Definition at line 181 of file gal_modern.h.
References KIGFX::GAL_MODERN::SCENE_ARENA< T >::buffer, KIGFX::GAL_MODERN::SCENE_ARENA< T >::capacity, m_bitmapTextureCache, m_bufferSets, m_gridPool, m_overlaySets, m_retiredBuffers, m_retiredTextures, m_sceneLayers, and m_staticPool.
Referenced by DestroyBuffers().
| void GAL_MODERN::ReleaseRetiredBuffers | ( | uint64_t | aConsumedGeneration | ) |
Free retired buffers and textures once the render thread has consumed a frame built after them.
Counting frames is not enough because an idle canvas keeps drawing its newest descriptor.
| aConsumedGeneration | is FRAME_MAILBOX::ConsumedBufferGeneration(). |
Definition at line 419 of file gal_modern.cpp.
References m_deviceProxy, m_retiredBuffers, and m_retiredTextures.
Referenced by DestroyBuffers().
|
private |
Definition at line 2708 of file gal_modern.cpp.
References KIGFX::GAL_MODERN::SCENE_LAYER::alphaStale, ARENA_INSTANCE_COUNT, ARENA_POLYGON, KIGFX::GAL_MODERN::GAL_GROUP::bitmapQuads, KIGFX::GAL_MODERN::SCENE_LAYER::bitmapResidents, countGroupAlpha(), freeSceneSlot(), KIGFX::GAL_MODERN::SCENE_LAYER::instances, KIGFX::GAL_MODERN::SCENE_LAYER::knockoutGroups, m_groups, m_sceneChanged, m_sceneLayers, KIGFX::GAL_MODERN::GAL_GROUP::negative, KIGFX::GAL_MODERN::GAL_GROUP::order, KIGFX::GAL_MODERN::SCENE_LAYER::polygons, KIGFX::GAL_MODERN::GAL_GROUP::resident, KIGFX::GAL_MODERN::GAL_GROUP::residentIndex, KIGFX::GAL_MODERN::SCENE_LAYER::residents, retainedPrefixHash(), KIGFX::GAL_MODERN::SCENE_LAYER::retainedPrefixIndex, KIGFX::GAL_MODERN::SCENE_LAYER::runsStale, KIGFX::GAL_MODERN::GAL_GROUP::sceneLayer, KIGFX::GAL_MODERN::GAL_GROUP::slotCount, and KIGFX::GAL_MODERN::GAL_GROUP::slotStart.
Referenced by DeleteGroup(), SetGroupPlacement(), and SetSceneScale().
|
private |
Empty every arena and forget residency ahead of a full rebuild.
GPU buffers are kept.
Definition at line 2850 of file gal_modern.cpp.
References group, m_groups, m_openSceneLayer, m_openSceneLayerId, m_sceneChanged, and m_sceneLayers.
Referenced by BeginDrawing(), ClearCache(), and ClearScreen().
|
inherited |
Reset text attributes to default styling.
FONT TODO: do we need any of this in GAL anymore?
Normally, custom attributes will be set individually after this, otherwise you can use SetTextAttributes()
Definition at line 204 of file graphics_abstraction_layer.cpp.
References GR_TEXT_H_ALIGN_CENTER, GR_TEXT_V_ALIGN_CENTER, SetFontBold(), SetFontItalic(), SetFontUnderlined(), SetGlyphSize(), SetHorizontalJustify(), SetTextMirrored(), and SetVerticalJustify().
Referenced by GAL(), KIGFX::PREVIEW::ARC_ASSISTANT::ViewDraw(), KIGFX::PREVIEW::BEZIER_ASSISTANT::ViewDraw(), KIGFX::PREVIEW::ELLIPSE_ASSISTANT::ViewDraw(), KIGFX::PREVIEW::RULER_ITEM::ViewDraw(), and KIGFX::PREVIEW::TWO_POINT_ASSISTANT::ViewDraw().
|
overridevirtual |
Resize the canvas.
Reimplemented from KIGFX::GAL.
Definition at line 366 of file gal_modern.cpp.
References KIGFX::GAL::ComputeWorldScreenMatrix(), m_screenHeight, m_screenWidth, and KIGFX::GAL::SetScreenSize().
|
overridevirtual |
Restore the context.
Reimplemented from KIGFX::GAL.
Definition at line 3957 of file gal_modern.cpp.
References m_currentTransform, m_transformStack, and recomputeTransformIdentity().
Referenced by drawGridSource().
|
private |
Definition at line 2752 of file gal_modern.cpp.
References ARENA_COUNT, ARENA_POLYGON, KIGFX::RETAINED_GROUP_ORDER::contentHash, KIGFX::RETAINED_GROUP_ORDER::contentTie, countGroupArenas(), KIGFX::GAL_MODERN::SCENE_ARENA< T >::elements, KIGFX::GAL_MODERN::SCENE_ARENA< T >::freeSlots, GroupContentFingerprint(), KIGFX::GAL_MODERN::SCENE_LAYER::instances, m_groups, KIGFX::GAL_MODERN::GAL_GROUP::order, KIGFX::GAL_MODERN::SCENE_LAYER::polygons, KIGFX::GAL_MODERN::GAL_GROUP::polygonVertices, KIGFX::GAL_MODERN::GAL_GROUP::resident, KIGFX::GAL_MODERN::SCENE_LAYER::residents, retainedPrefixHash(), KIGFX::GAL_MODERN::SCENE_LAYER::retainedPrefixIndex, KIGFX::RETAINED_GROUP_ORDER::SamePrefix(), KIGFX::GAL_MODERN::GAL_GROUP::slotCount, and KIGFX::GAL_MODERN::GAL_GROUP::slotStart.
Referenced by rewriteResidentGroup(), and SetGroupPlacement().
|
private |
Definition at line 376 of file gal_modern.cpp.
References m_bufferGeneration, m_deviceProxy, m_persistentTargets, and m_retiredBuffers.
Referenced by ensureBuffer(), and releaseBitmapQuads().
|
private |
Definition at line 389 of file gal_modern.cpp.
References m_bufferGeneration, m_deviceProxy, m_persistentTargets, and m_retiredTextures.
Referenced by ClearCache(), evictBitmapCacheEntries(), and releaseBitmapQuads().
|
private |
Write a resident group back into its scene layer after its elements changed.
Definition at line 3681 of file gal_modern.cpp.
References KIGFX::RETAINED_GROUP_ORDER::contentTie, m_sceneChanged, m_sceneLayers, m_staticDirty, KIGFX::GAL_MODERN::GAL_GROUP::order, KIGFX::GAL_MODERN::GAL_GROUP::resident, retainedTieOrderChanged(), KIGFX::GAL_MODERN::GAL_GROUP::sceneLayer, and writeGroupToScene().
Referenced by ChangeGroupColor(), ChangeGroupDepth(), and ChangeGroupUndimmed().
|
overridevirtual |
Rotate the context.
| aAngle | is the rotation angle in radians. |
Reimplemented from KIGFX::GAL.
Definition at line 3980 of file gal_modern.cpp.
References MATRIX3x3< T >::SetIdentity(), MATRIX3x3< T >::SetRotation(), and Transform().
Referenced by drawGridSource().
|
overridevirtual |
Save the context.
Reimplemented from KIGFX::GAL.
Definition at line 3951 of file gal_modern.cpp.
References m_currentTransform, and m_transformStack.
Referenced by drawGridSource().
|
overridevirtual |
Scale the context.
| aScale | is the scale factor for the x- and y-axis. |
Reimplemented from KIGFX::GAL.
Definition at line 3998 of file gal_modern.cpp.
References MATRIX3x3< T >::SetIdentity(), MATRIX3x3< T >::SetScale(), and Transform().
|
inlinestaticprivate |
Whether a scene layer goes through the temp target and is composited with its alpha.
Only a layer whose order matters does, and the rest are drawn in their own depth slice in one pass.
Definition at line 741 of file gal_modern.h.
References KIGFX::GAL_MODERN::SCENE_LAYER::runs.
Referenced by appendSceneRanges(), flushScene(), and writeGroupToScene().
|
private |
The world size of a screen pixel, which grid lines are measured in.
Definition at line 1075 of file gal_modern.cpp.
References std::abs(), KIGFX::GAL::m_screenWorldMatrix, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by drawGridSource(), and PopulateCameraUBOs().
|
inlineinherited |
Set the axes color.
| aAxesColor | is the color to draw the axes if enabled. |
Definition at line 1235 of file graphics_abstraction_layer.h.
References m_axesColor.
Referenced by KIGFX::CAIRO_GAL_BASE::CAIRO_GAL_BASE(), SCH_BASE_FRAME::CommonSettingsChanged(), SYMBOL_VIEWER_FRAME::CommonSettingsChanged(), KIGFX::GAL_MODERN::GAL_MODERN(), KIGFX::OPENGL_GAL::OPENGL_GAL(), and SYMBOL_EDIT_FRAME::SwitchCanvas().
|
inlineinherited |
Enable drawing the axes.
Definition at line 1243 of file graphics_abstraction_layer.h.
References m_axesEnabled.
Referenced by FOOTPRINT_EDIT_FRAME::ActivateGalCanvas(), GAL(), DIALOG_PAD_PROPERTIES::prepareCanvas(), DIALOG_VIA_STITCH_PROPERTIES::prepareCanvas(), FP_TREE_SYNCHRONIZING_ADAPTER::ShowPreview(), FOOTPRINT_EDIT_FRAME::SwitchCanvas(), and SYMBOL_EDIT_FRAME::SwitchCanvas().
|
inline |
Draw bitmap text as one font atlas glyph per quad, for editors whose track shader supports it.
Definition at line 99 of file gal_modern.h.
References m_bitmapGlyphs.
|
inline |
The other canvases lay the view out this many pixels larger than the client area.
Matching them keeps the picture in place across a backend switch.
Definition at line 155 of file gal_modern.h.
References m_centringPad.
Referenced by EDA_DRAW_PANEL_GAL::SwitchBackend().
|
inlineinherited |
Definition at line 514 of file graphics_abstraction_layer.h.
References m_clearColor.
Referenced by BOARD_PRINTOUT::DrawPage(), and SCH_PRINTOUT::PrintPage().
|
inlineinherited |
Draw every tick line wider.
| aInterval | increase the width of every aInterval line, if 0 do not use this feature. |
Definition at line 1253 of file graphics_abstraction_layer.h.
References m_gridTick.
Referenced by GAL().
|
inlineinherited |
Set the cursor color.
| aCursorColor | is the color of the cursor. |
Definition at line 1350 of file graphics_abstraction_layer.h.
References m_cursorColor.
Referenced by GAL().
|
inlineinherited |
Enable/disable cursor.
| aCursorEnabled | is true if the cursor should be drawn, else false. |
Definition at line 1330 of file graphics_abstraction_layer.h.
References m_isCursorEnabled.
Referenced by GAL().
|
inlineinherited |
Set the range of the layer depth.
Usually required for the OpenGL implementation, any object outside this range is not drawn.
The MinDepth (x) is closest to the clipping plane (top) while the MaxDepth (y) is farthest from the clipping plane (bottom).
Definition at line 936 of file graphics_abstraction_layer.h.
References m_depthRange.
Referenced by GAL().
|
inline |
Backing-store scale factor, 2.0 on Retina.
The GAL stays in logical coordinates for VIEW and hit testing, so the viewport UBO needs this to size antialiasing edges in real pixels.
Definition at line 149 of file gal_modern.h.
References m_dpiScale.
Referenced by EDA_DRAW_PANEL_GAL::SwitchBackend().
|
inlinevirtualinherited |
Set the fill color.
| aColor | is the color for filling. |
Reimplemented in KIGFX::CAIRO_GAL_BASE.
Definition at line 578 of file graphics_abstraction_layer.h.
References m_fillColor.
Referenced by KIGFX::OPENGL_GAL::BeginDrawing(), LINE_ENDING::Draw(), DrawGlyphs(), KIGFX::GAL_MODERN::drawGridSource(), KIGFX::OPENGL_GAL::drawGridSources(), KIGFX::PREVIEW::ANGLE_ITEM::drawPreviewShape(), ROUTER_PREVIEW_ITEM::drawShape(), DrawTrack(), KIGFX::VIEW_OVERLAY::COMMAND_SET_COLOR::Execute(), GAL(), KIGFX::knockoutText(), KIGFX::PREVIEW::SIMPLE_OVERLAY_ITEM::setupGal(), CONSTRAINT_BADGE_ITEM::ViewDraw(), EDIT_POINTS::ViewDraw(), KIGFX::PREVIEW::SELECTION_AREA::ViewDraw(), KIGFX::SNAP_INDICATOR::ViewDraw(), ROUTER_PREVIEW_ITEM::ViewDraw(), ROUTER_STATUS_VIEW_ITEM::ViewDraw(), and TUNING_STATUS_VIEW_ITEM::ViewDraw().
|
inlineinherited |
Sets flipping of the screen.
| xAxis | is the flip flag for the X axis. |
| yAxis | is the flip flag for the Y axis. |
Definition at line 1000 of file graphics_abstraction_layer.h.
References m_globalFlipX, and m_globalFlipY.
Referenced by GAL(), and BOARD_PRINTOUT::setupGal().
|
inlineinherited |
Definition at line 714 of file graphics_abstraction_layer.h.
References m_attributes.
Referenced by ResetTextAttributes().
|
inlineinherited |
Definition at line 717 of file graphics_abstraction_layer.h.
References m_attributes.
Referenced by ResetTextAttributes().
|
inlineinherited |
Definition at line 720 of file graphics_abstraction_layer.h.
References m_attributes.
Referenced by ResetTextAttributes().
|
inlineinherited |
Definition at line 711 of file graphics_abstraction_layer.h.
References m_attributes.
Referenced by KIGFX::bitmapText(), KIGFX::PREVIEW::ANGLE_ITEM::drawPreviewShape(), KIGFX::VIEW_OVERLAY::COMMAND_GLYPH_SIZE::Execute(), and ResetTextAttributes().
|
inlineinherited |
Set the grid color.
| aGridColor | is the grid color, it should have a low alpha value for the best effect. |
Definition at line 1225 of file graphics_abstraction_layer.h.
References m_gridColor.
Referenced by GERBVIEW_FRAME::ActivateGalCanvas(), KIGFX::CAIRO_GAL_BASE::CAIRO_GAL_BASE(), KIGFX::OPENGL_GAL::OPENGL_GAL(), GERBVIEW_FRAME::SetGridColor(), and PCB_EDIT_FRAME::SetGridColor().
|
inlineinherited |
Set the origin point for the grid.
| aGridOrigin | is a vector containing the grid origin point, in world coordinates. |
Definition at line 1146 of file graphics_abstraction_layer.h.
References m_gridOffset, m_gridOrigin, and m_gridSize.
Referenced by FOOTPRINT_EDIT_FRAME::borrowBoardNonDestructive(), PCB_CONTROL::DoSetGridOrigin(), and PCB_BASE_EDIT_FRAME::SetBoard().
|
inlineinherited |
Set the grid size.
| aGridSize | is a vector containing the grid size in x and y direction. |
Definition at line 1171 of file graphics_abstraction_layer.h.
References m_gridOffset, m_gridOrigin, and m_gridSize.
Referenced by FOOTPRINT_PREVIEW_PANEL::New(), COMMON_TOOLS::OnGridChanged(), DIALOG_BARCODE_PROPERTIES::prepareCanvas(), and DIALOG_PAD_PROPERTIES::prepareCanvas().
|
inherited |
Set the grid-source list rendered alongside the display grid.
The list is sorted by GRID_GEOMETRY::TakesPrecedenceOver, so every consumer can take the first source that applies rather than re-deriving the overlap rules. The sort is stable, leaving exact ties in the caller's original order.
Definition at line 274 of file graphics_abstraction_layer.cpp.
References m_gridSources.
|
inlineinherited |
Set the visibility setting of the grid.
| aVisibility | is the new visibility setting of the grid. |
Definition at line 1131 of file graphics_abstraction_layer.h.
References m_gridVisibility.
Referenced by GAL(), FOOTPRINT_PREVIEW_PANEL::New(), COMMON_TOOLS::OnGridChanged(), DIALOG_BARCODE_PROPERTIES::prepareCanvas(), DIALOG_PAD_PROPERTIES::prepareCanvas(), DIALOG_VIA_STITCH_PROPERTIES::prepareCanvas(), and EDA_DRAW_FRAME::SetGridVisibility().
|
overridevirtual |
Declare where a cached group belongs in the retained scene.
| aGroup | is the group number returned by BeginGroup(). |
| aLayer | is the VIEW layer id the group was cached for. |
| aLodScale | is the view scale above which the group is drawn. |
| aShown | is false to keep the group out of the scene regardless of scale. |
Reimplemented from KIGFX::GAL.
Definition at line 3100 of file gal_modern.cpp.
References KIGFX::RETAINED_GROUP_ORDER::contentHash, KIGFX::RETAINED_GROUP_ORDER::contentTie, group, GroupContentFingerprint(), m_groups, m_openSceneLayer, m_openSceneLayerId, m_sceneLayers, m_sceneScale, m_staticDirty, placeGroupInScene(), removeGroupFromScene(), retainedTieOrderChanged(), and trackGroupLod().
|
inlineinherited |
Definition at line 726 of file graphics_abstraction_layer.h.
References m_attributes.
Referenced by KIGFX::bitmapText(), and ResetTextAttributes().
|
inlinevirtualinherited |
Definition at line 603 of file graphics_abstraction_layer.h.
References m_hoverColor.
|
inlinevirtualinherited |
Enable/disable fill.
| aIsFillEnabled | is true, when the graphics objects should be filled, else false. |
Reimplemented in KIGFX::CAIRO_GAL_BASE.
Definition at line 538 of file graphics_abstraction_layer.h.
References m_isFillEnabled.
Referenced by LINE_ENDING::Draw(), KIGFX::SCH_PAINTER::draw(), KIGFX::drawAltPinModesIcon(), ROUTER_PREVIEW_ITEM::drawClearanceHalo(), KIGFX::GAL_MODERN::drawGridSource(), KIGFX::OPENGL_GAL::drawGridSources(), ROUTER_PREVIEW_ITEM::drawLineChain(), KIGFX::PREVIEW::ANGLE_ITEM::drawPreviewShape(), ROUTER_PREVIEW_ITEM::drawShape(), DrawSnapNode(), KIGFX::drawText(), KIGFX::PREVIEW::DrawTextNextToCursor(), DrawTrack(), KIGFX::VIEW_OVERLAY::COMMAND_SET_FILL::Execute(), GAL(), KIGFX::knockoutText(), KIGFX::PREVIEW::SIMPLE_OVERLAY_ITEM::setupGal(), CONSTRAINT_BADGE_ITEM::ViewDraw(), EDIT_POINTS::ViewDraw(), KIGFX::ANCHOR_DEBUG::ViewDraw(), KIGFX::CONSTRUCTION_GEOM::ViewDraw(), KIGFX::ORIGIN_VIEWITEM::ViewDraw(), KIGFX::PREVIEW::RULER_ITEM::ViewDraw(), KIGFX::PREVIEW::SELECTION_AREA::ViewDraw(), PCB_VIA_STITCH::ViewDraw(), RATSNEST_VIEW_ITEM::ViewDraw(), ROUTER_PREVIEW_ITEM::ViewDraw(), ROUTER_STATUS_VIEW_ITEM::ViewDraw(), and TUNING_STATUS_VIEW_ITEM::ViewDraw().
|
inlinevirtualinherited |
Enable/disable stroked outlines.
| aIsStrokeEnabled | is true, if the outline of an object should be stroked. |
Reimplemented in KIGFX::CAIRO_GAL_BASE.
Definition at line 558 of file graphics_abstraction_layer.h.
References m_isStrokeEnabled.
Referenced by LINE_ENDING::Draw(), KIGFX::SCH_PAINTER::draw(), KIGFX::drawAltPinModesIcon(), KIGFX::drawCache(), ROUTER_PREVIEW_ITEM::drawClearanceHalo(), KIGFX::GAL_MODERN::drawGridSource(), KIGFX::OPENGL_GAL::drawGridSources(), ROUTER_PREVIEW_ITEM::drawLineChain(), KIGFX::PREVIEW::POLYGON_ITEM::drawPreviewShape(), ROUTER_PREVIEW_ITEM::drawShape(), DrawSnapNode(), KIGFX::drawText(), KIGFX::PREVIEW::DrawTextNextToCursor(), DrawTrack(), KIGFX::VIEW_OVERLAY::COMMAND_SET_STROKE::Execute(), GAL(), KIGFX::knockoutText(), KIGFX::PREVIEW::SIMPLE_OVERLAY_ITEM::setupGal(), CONSTRAINT_BADGE_ITEM::ViewDraw(), EDIT_POINTS::ViewDraw(), KIGFX::ANCHOR_DEBUG::ViewDraw(), KIGFX::CONSTRUCTION_GEOM::ViewDraw(), KIGFX::ORIGIN_VIEWITEM::ViewDraw(), KIGFX::PREVIEW::RULER_ITEM::ViewDraw(), KIGFX::PREVIEW::SELECTION_AREA::ViewDraw(), PCB_VIA_STITCH::ViewDraw(), RATSNEST_VIEW_ITEM::ViewDraw(), ROUTER_PREVIEW_ITEM::ViewDraw(), ROUTER_STATUS_VIEW_ITEM::ViewDraw(), and TUNING_STATUS_VIEW_ITEM::ViewDraw().
|
overridevirtual |
Set the depth of the layer (position on the z-axis)
If you do this, you should consider using a GAL_SCOPED_ATTR to ensure the depth is reset to the original value.
| aLayerDepth | the layer depth for the objects. Smaller is closer to the viewer. |
Reimplemented from KIGFX::GAL.
Definition at line 920 of file gal_modern.cpp.
References beginLayerRange(), layerRangesForCurrentTarget(), and KIGFX::GAL::SetLayerDepth().
|
inlinevirtualinherited |
Set the line width.
| aLineWidth | is the line width. |
Reimplemented in KIGFX::CAIRO_GAL_BASE.
Definition at line 623 of file graphics_abstraction_layer.h.
References m_lineWidth.
Referenced by KIGFX::bitmapText(), KIFONT::FONT::Draw(), LINE_ENDING::Draw(), KIGFX::SCH_PAINTER::draw(), KIGFX::drawAltPinModesIcon(), KIGFX::OPENGL_GAL::DrawArcSegment(), drawBacksideTicks(), KIGFX::drawCache(), ROUTER_PREVIEW_ITEM::drawClearanceHalo(), KIGFX::OPENGL_GAL::DrawGrid(), KIGFX::GAL_MODERN::drawGridSource(), KIGFX::OPENGL_GAL::drawGridSources(), KIGFX::PREVIEW::ANGLE_ITEM::drawPreviewShape(), KIGFX::PREVIEW::POLYGON_ITEM::drawPreviewShape(), KIGFX::OPENGL_GAL::drawSegment(), ROUTER_PREVIEW_ITEM::drawShape(), KIGFX::drawText(), drawTicksAlongLine(), KIGFX::VIEW_OVERLAY::COMMAND_SET_WIDTH::Execute(), PCB_IO_KICAD_SEXPR::formatRenderCache(), PCB_WRITER_V10::formatRenderCache(), PCB_WRITER_V9::formatRenderCache(), GAL(), screenSpaceCircle(), screenSpaceLine(), KIGFX::CAIRO_GAL_BASE::SetLineWidth(), KIGFX::PREVIEW::SIMPLE_OVERLAY_ITEM::setupGal(), CONSTRAINT_BADGE_ITEM::ViewDraw(), EDIT_POINTS::ViewDraw(), KIGFX::ANCHOR_DEBUG::ViewDraw(), KIGFX::CONSTRUCTION_GEOM::ViewDraw(), KIGFX::ORIGIN_VIEWITEM::ViewDraw(), KIGFX::PREVIEW::RULER_ITEM::ViewDraw(), KIGFX::PREVIEW::SELECTION_AREA::ViewDraw(), PCB_VIA_STITCH::ViewDraw(), RATSNEST_VIEW_ITEM::ViewDraw(), ROUTER_STATUS_VIEW_ITEM::ViewDraw(), and TUNING_STATUS_VIEW_ITEM::ViewDraw().
|
inlineinherited |
Get/set the Point in world space to look at.
This point corresponds with the center of the actual drawing area.
Definition at line 916 of file graphics_abstraction_layer.h.
References m_lookAtPoint.
Referenced by BOARD_PRINTOUT::DrawPage(), GAL(), and SCH_PRINTOUT::PrintPage().
|
inlinevirtualinherited |
Set the minimum line width in pixels.
| aLineWidth | is the minimum line width. |
Reimplemented in KIGFX::OPENGL_GAL.
Definition at line 633 of file graphics_abstraction_layer.h.
References m_minLineWidth.
Referenced by GAL(), and KIGFX::OPENGL_GAL::SetMinLineWidth().
|
virtualinherited |
Set the cursor in the native panel.
| aCursor | is the cursor to use in the native panell |
| aHiDPI | is used to determine if high DPI cursors should be used. |
Reimplemented in KIGFX::CAIRO_GAL, and KIGFX::OPENGL_GAL.
Definition at line 470 of file graphics_abstraction_layer.cpp.
References m_currentNativeCursor.
Referenced by GAL(), KIGFX::CAIRO_GAL::SetNativeCursorStyle(), and KIGFX::OPENGL_GAL::SetNativeCursorStyle().
|
overridevirtual |
Set negative draw mode in the renderer.
When negative mode is enabled, drawn items will subtract from previously drawn items. This is mainly needed for Gerber negative item support in Cairo, since unlike in OpenGL, objects drawn with zero opacity on top of other objects would not normally mask objects in Cairo. This method is a no-op in OpenGL.
| aSetting | is true if negative mode should be enabled |
Reimplemented from KIGFX::GAL.
Definition at line 1052 of file gal_modern.cpp.
References layerRangesForCurrentTarget(), and m_negativeMode.
|
inline |
Keep the non-cached and overlay pools across frames until ClearTarget() empties one, as the other backends do, so moving an overlay item re-emits only the overlay.
When off, BeginDrawing() empties both.
Definition at line 343 of file gal_modern.h.
References m_persistentTargets.
|
inline |
Render thread used for fence-based synchronization.
Definition at line 143 of file gal_modern.h.
References m_renderThread.
Referenced by EDA_DRAW_PANEL_GAL::SwitchBackend().
|
inlineinherited |
Get/set the rotation angle (in radians).
Definition at line 925 of file graphics_abstraction_layer.h.
References m_rotation.
Referenced by GAL().
|
overridevirtual |
Tell the retained scene whether cached groups are placed in an order that matters.
When they are, a knockout erases only what was placed before it on its layer, as on a Gerber layer. Otherwise a layer's knockouts apply to all of it.
Reimplemented from KIGFX::GAL.
Definition at line 3386 of file gal_modern.cpp.
References m_sceneChanged, m_sceneDrawOrdered, and m_sceneLayers.
|
overridevirtual |
Fade a cached layer towards a colour in the shader, so dimming it recolours none of its groups.
Groups marked with ChangeGroupUndimmed() keep their colour.
| aLayer | is the VIEW layer id. |
| aToward | is the colour the layer fades towards, usually the background. |
| aKeep | is the share of each colour that is kept, 1 to leave the layer as it is. |
Reimplemented from KIGFX::GAL.
Definition at line 2935 of file gal_modern.cpp.
References KIGFX::COLOR4D::b, KIGFX::GAL_MODERN::SCENE_LAYER::dim, KIGFX::COLOR4D::g, KIGFX::RHI_LAYER_DIM::keep, m_sceneChanged, m_sceneLayers, KIGFX::COLOR4D::r, and KIGFX::RHI_LAYER_DIM::toward.
|
overridevirtual |
Blend a cached layer the way the other canvases blend the overlay they draw it in.
Colour c with alpha a over d then shows c*a + d*(1 - a*a) rather than c*a + d*(1 - a).
| aLayer | is the VIEW layer id. |
Reimplemented from KIGFX::GAL.
Definition at line 2963 of file gal_modern.cpp.
References m_groups, m_sceneChanged, m_sceneLayers, KIGFX::GAL_MODERN::SCENE_LAYER::overlayAlpha, KIGFX::GAL_MODERN::SCENE_LAYER::residents, and writeGroupToScene().
|
overridevirtual |
Describe a cached layer to the retained scene.
Layers draw in decreasing order value and a hidden layer keeps its groups, so showing, hiding or reordering layers emits nothing again.
| aLayer | is the VIEW layer id. |
| aOrder | is the layer's rendering order. |
| aVisible | is false to leave the layer out of the frame. |
| aHasNegatives | is true if the layer has to contain its own knockouts. |
Reimplemented from KIGFX::GAL.
Definition at line 2889 of file gal_modern.cpp.
References KIGFX::GAL_MODERN::SCENE_LAYER::depth, KIGFX::GAL_MODERN::SCENE_LAYER::hasNegatives, KIGFX::GAL_MODERN::SCENE_LAYER::inOrder, KIGFX::GAL_MODERN::SCENE_LAYER::instances, m_groups, m_sceneChanged, m_sceneLayers, m_sceneOrder, m_sceneOrderStale, m_staticDirty, KIGFX::GAL_MODERN::SCENE_LAYER::polygons, KIGFX::GAL_MODERN::SCENE_LAYER::residents, KIGFX::GAL_MODERN::SCENE_LAYER::runsStale, KIGFX::GAL_MODERN::SCENE_ARENA< T >::uploadAll, KIGFX::GAL_MODERN::SCENE_LAYER::visible, and writeGroupToScene().
Referenced by BeginSceneLayer().
|
overridevirtual |
Set the view scale that group placements are tested against.
Reimplemented from KIGFX::GAL.
Definition at line 3020 of file gal_modern.cpp.
References group, m_groups, m_lodGroups, m_sceneLayers, m_sceneScale, m_staticDirty, placeGroupInScene(), and removeGroupFromScene().
|
inlineinherited |
Set the dots per inch of the screen.
This value depends on the user screen, it should be configurable by the application. For instance a typical notebook with HD+ resolution (1600x900) has 106 DPI.
Definition at line 908 of file graphics_abstraction_layer.h.
References m_screenDPI.
Referenced by KIGFX::CAIRO_PRINT_GAL::CAIRO_PRINT_GAL(), and GAL().
|
inlineinherited |
Definition at line 900 of file graphics_abstraction_layer.h.
References m_screenSize.
Referenced by KIGFX::GAL_MODERN::ResizeScreen(), and KIGFX::CAIRO_PRINT_GAL::SetSheetSize().
|
inlineoverridevirtual |
Store sizes of what is drawn next in pixels rather than world units, so it keeps its pixel size through a zoom without being drawn again.
Reimplemented from KIGFX::GAL.
Definition at line 79 of file gal_modern.h.
References m_screenSpaceMode.
|
inlinevirtualinherited |
Set the stroke color.
| aColor | is the color for stroking the outline. |
Reimplemented in KIGFX::CAIRO_GAL_BASE.
Definition at line 598 of file graphics_abstraction_layer.h.
References m_strokeColor.
Referenced by KIGFX::OPENGL_GAL::BeginDrawing(), LINE_ENDING::Draw(), KIGFX::drawAltPinModesIcon(), DrawGlyphs(), KIGFX::OPENGL_GAL::DrawGrid(), KIGFX::GAL_MODERN::drawGridSource(), KIGFX::OPENGL_GAL::drawGridSources(), KIGFX::PREVIEW::ANGLE_ITEM::drawPreviewShape(), KIGFX::PREVIEW::POLYGON_ITEM::drawPreviewShape(), ROUTER_PREVIEW_ITEM::drawShape(), KIGFX::PREVIEW::DrawTextNextToCursor(), DrawTrack(), KIGFX::OPENGL_GAL::drawTriangulatedPolyset(), KIGFX::VIEW_OVERLAY::COMMAND_SET_COLOR::Execute(), GAL(), KIGFX::PREVIEW::SIMPLE_OVERLAY_ITEM::setupGal(), CONSTRAINT_BADGE_ITEM::ViewDraw(), EDIT_POINTS::ViewDraw(), KIGFX::ANCHOR_DEBUG::ViewDraw(), KIGFX::CONSTRUCTION_GEOM::ViewDraw(), KIGFX::ORIGIN_VIEWITEM::ViewDraw(), KIGFX::PREVIEW::RULER_ITEM::ViewDraw(), KIGFX::PREVIEW::SELECTION_AREA::ViewDraw(), PCB_VIA_STITCH::ViewDraw(), RATSNEST_VIEW_ITEM::ViewDraw(), ROUTER_PREVIEW_ITEM::ViewDraw(), ROUTER_STATUS_VIEW_ITEM::ViewDraw(), and TUNING_STATUS_VIEW_ITEM::ViewDraw().
|
inlineoverridevirtual |
Extend every stroke drawn from now on by aPixels at each end.
Pixels are resolved per frame so the look survives a zoom without drawing again. Zero turns it off.
Reimplemented from KIGFX::GAL.
Definition at line 85 of file gal_modern.h.
References m_strokeLengthPad.
|
inlineoverridevirtual |
Show every stroke drawn from now on only while the view scale is above aLod, as VIEW::IsShownAtScale() decides.
It is decided per frame so a zoom needs no redraw. Zero turns it off.
Reimplemented from KIGFX::GAL.
Definition at line 94 of file gal_modern.h.
References m_strokeLod.
|
inlineoverridevirtual |
Widen every stroke, circle and pad drawn from now on by aPixels.
Pixels are resolved per frame so the look survives a zoom without drawing again. Zero turns it off.
Reimplemented from KIGFX::GAL.
Definition at line 87 of file gal_modern.h.
References L, and m_strokePixelPad.
|
overridevirtual |
Set the target for rendering.
| aTarget | is the new target for rendering. |
Reimplemented from KIGFX::GAL.
Definition at line 895 of file gal_modern.cpp.
References beginLayerRange(), m_currentTarget, m_dynamicLayerRanges, m_overlayLayerRanges, m_staticLayerRanges, and KIGFX::TARGET_OVERLAY.
|
inlineinherited |
Definition at line 723 of file graphics_abstraction_layer.h.
References m_attributes.
Referenced by ResetTextAttributes(), and KIGFX::PREVIEW::RULER_ITEM::ViewDraw().
|
inlineinherited |
Definition at line 733 of file graphics_abstraction_layer.h.
References m_attributes.
Referenced by KIGFX::bitmapText(), and ResetTextAttributes().
|
inlineinherited |
Set the world <-> screen transformation matrix.
| aMatrix | is the 3x3 world <-> screen transformation matrix. |
Definition at line 879 of file graphics_abstraction_layer.h.
References m_worldScreenMatrix.
|
inlineinherited |
Set the unit length.
This defines the length [inch] per one integer. For instance a value 0.001 means that the coordinate [1000, 1000] corresponds with a point at (1 inch, 1 inch) or 1 mil resolution per integer.
Definition at line 896 of file graphics_abstraction_layer.h.
References m_worldUnitLength.
Referenced by GAL(), GERBVIEW_DRAW_PANEL_GAL::GERBVIEW_DRAW_PANEL_GAL(), PL_DRAW_PANEL_GAL::PL_DRAW_PANEL_GAL(), SCH_PRINTOUT::PrintPage(), GERBVIEW_PRINTOUT::setupGal(), PCBNEW_PRINTOUT::setupGal(), GERBVIEW_DRAW_PANEL_GAL::SwitchBackend(), and PL_DRAW_PANEL_GAL::SwitchBackend().
|
inlineinherited |
Definition at line 919 of file graphics_abstraction_layer.h.
References m_zoomFactor.
Referenced by BOARD_PRINTOUT::DrawPage(), GAL(), and SCH_PRINTOUT::PrintPage().
|
inlinevirtualinherited |
Show/hide the GAL canvas.
Reimplemented in KIGFX::CAIRO_GAL, and KIGFX::OPENGL_GAL.
Definition at line 491 of file graphics_abstraction_layer.h.
|
private |
Put the declared layers back in decreasing depth order after one was added or moved.
Definition at line 2979 of file gal_modern.cpp.
References m_sceneOrder, and m_sceneOrderStale.
Referenced by flushScene().
|
overridevirtual |
Begins rendering of a differential layer.
Used by gerbview's differential mode.
Differential layers have their drawn objects blended onto the lower layers differently so we need to end drawing of current objects and start a new set to be completed with a different blend mode.
Reimplemented from KIGFX::GAL.
Definition at line 974 of file gal_modern.cpp.
References beginLayerRange(), KIGFX::GAL_MODERN::GEOMETRY_BUFFER_SET::bitmapQuads, currentTargetOpen(), layerRangesForCurrentTarget(), m_diffLayerActive, m_isDrawing, KIGFX::GAL::m_layerDepth, and KIGFX::GAL_MODERN::GEOMETRY_BUFFER_SET::Sizes().
|
overridevirtual |
Begins rendering in a new layer that will be copied to the main layer in EndNegativesLayer().
For Cairo, layers with negative items need a new layer so when negative layers _CLEAR sections it doesn't delete drawings on layers below them. No-op in OpenGL
Reimplemented from KIGFX::GAL.
Definition at line 1013 of file gal_modern.cpp.
References layerRangesForCurrentTarget(), m_negativeMode, and m_negativesLayer.
|
private |
Stroke a chain as segments, adding a last-to-first segment when it is closed.
Definition at line 2137 of file gal_modern.cpp.
References SEG::A, SEG::B, SHAPE_LINE_CHAIN::CSegment(), DrawLine(), SHAPE_LINE_CHAIN::PointCount(), and SHAPE_LINE_CHAIN::SegmentCount().
Referenced by drawEllipseShape(), DrawPolygon(), DrawPolygon(), and DrawPolyline().
|
private |
Queue an upload of a span of aElements to the same place in aBuffer.
Definition at line 3166 of file gal_modern.cpp.
References KIGFX::GAL_MODERN::PATCH_SPAN::begin, KIGFX::GAL_MODERN::PATCH_SPAN::end, m_renderThread, RhiUploadCopyStaging(), T, RHI_GEOMETRY_UPLOAD::targetBuffer, and RHI_GEOMETRY_UPLOAD::targetOffset.
Referenced by Flush(), and uploadSceneArena().
|
inlineoverridevirtual |
Tell whether strokes can be longer by a number of pixels, see SetStrokeLengthPad().
Reimplemented from KIGFX::GAL.
Definition at line 83 of file gal_modern.h.
|
inlineoverridevirtual |
Tell whether strokes can carry a level of detail, see SetStrokeLevelOfDetail().
Reimplemented from KIGFX::GAL.
Definition at line 92 of file gal_modern.h.
|
inlineoverridevirtual |
Tell whether strokes can carry part of their width in pixels, see SetStrokePixelPad().
Reimplemented from KIGFX::GAL.
Definition at line 81 of file gal_modern.h.
|
inlineoverridevirtual |
Return true if DrawPad() renders every standard pad shape.
Painters must not use it otherwise, since the base implementation draws every non-circular pad as a rectangle.
Reimplemented from KIGFX::GAL.
Definition at line 60 of file gal_modern.h.
| bool GAL_MODERN::SyncScene | ( | ) |
Upload scene changes made outside a drawing context, such as groups crossing their level of detail on a zoom that redraws nothing.
Definition at line 3086 of file gal_modern.cpp.
References flushScene(), m_sceneChanged, and m_staticDirty.
|
inline |
Whether the last Flush() rebuilt the static pool.
Reading clears it so each rebuild is seen once.
Definition at line 355 of file gal_modern.h.
References m_staticRebuiltThisFlush.
|
inlineinherited |
Give and forget the nearest limits on either side of the scale passed to WorldScaleBelow().
Definition at line 974 of file graphics_abstraction_layer.h.
References m_scaleLimitAbove, and m_scaleLimitBelow.
|
inlineinherited |
Tell whether GetWorldScale() or a transformation matrix was read since the last call.
A backend that keeps geometry across frames needs this because whatever was sized from the scale goes stale on zoom.
Definition at line 986 of file graphics_abstraction_layer.h.
References m_worldScaleRead.
Compute the point position in screen coordinates from given world coordinates.
| aPoint | the point position in world coordinates. |
Definition at line 1311 of file graphics_abstraction_layer.h.
References m_worldScreenMatrix.
Referenced by KIGFX::CAIRO_GAL_BASE::blitCursor(), and KIGFX::PREVIEW::RULER_ITEM::ViewDraw().
Compute the point position in world coordinates from given screen coordinates.
| aPoint | the point position in screen coordinates. |
Definition at line 1300 of file graphics_abstraction_layer.h.
References m_screenWorldMatrix.
|
private |
Keep m_lodGroups to the shown groups whose threshold a zoom can actually cross.
Definition at line 3006 of file gal_modern.cpp.
References KIGFX::GAL_MODERN::GAL_GROUP::lodEntry, KIGFX::GAL_MODERN::GAL_GROUP::lodScale, and m_lodGroups.
Referenced by DeleteGroup(), and SetGroupPlacement().
|
overridevirtual |
Transform the context.
| aTransformation | is the transformation matrix. |
Reimplemented from KIGFX::GAL.
Definition at line 3973 of file gal_modern.cpp.
References m_currentTransform, and recomputeTransformIdentity().
Referenced by Rotate(), Scale(), and Translate().
|
overridevirtual |
Translate the context.
| aTranslation | is the translation vector. |
Reimplemented from KIGFX::GAL.
Definition at line 3989 of file gal_modern.cpp.
References MATRIX3x3< T >::SetIdentity(), MATRIX3x3< T >::SetTranslation(), and Transform().
Referenced by drawGridSource().
|
inlinevirtualinherited |
Reimplemented in KIGFX::OPENGL_GAL.
Definition at line 1410 of file graphics_abstraction_layer.h.
|
protectedvirtualinherited |
Handle updating display options.
Derived classes should call up to this to set base-class methods.
Reimplemented in KIGFX::CAIRO_GAL, and KIGFX::OPENGL_GAL.
Definition at line 138 of file graphics_abstraction_layer.cpp.
References m_axesEnabled, m_crossHairMode, m_forceDisplayCursor, m_gridLineWidth, m_gridMinSpacing, m_gridStyle, m_gridTick, m_options, and refresh.
Referenced by OnGalDisplayOptionsChanged(), KIGFX::CAIRO_GAL::updatedGalDisplayOptions(), and KIGFX::OPENGL_GAL::updatedGalDisplayOptions().
|
staticprivate |
Bring a layer's culling bounds up to date, recounting only runs whose elements changed.
Definition at line 3230 of file gal_modern.cpp.
References ARENA_INSTANCE_COUNT, ARENA_POLYGON, KIGFX::GAL_MODERN::SCENE_LAYER::cullCounted, KIGFX::GAL_MODERN::SCENE_LAYER::cullRuns, KIGFX::GAL_MODERN::SCENE_ARENA< T >::elements, KIGFX::GAL_MODERN::SCENE_LAYER::instances, KIGFX::GAL_MODERN::SCENE_LAYER::polygons, KIGFX::RHI_CULL_RUN_LENGTH, KIGFX::RHI_CULL_VERTEX_RUN_LENGTH, KIGFX::RHI_SHAPE_POLYGON, KIGFX::RhiVertexRun(), table, updateRuns(), and KIGFX::GAL_MODERN::SCENE_ARENA< T >::uploadAll.
Referenced by flushScene().
|
private |
Upload the arena's pending spans, growing its buffer first.
False on allocation failure.
Definition at line 3179 of file gal_modern.cpp.
References KIGFX::GAL_MODERN::SCENE_ARENA< T >::buffer, KIGFX::GAL_MODERN::SCENE_ARENA< T >::capacity, KIGFX::GAL_MODERN::SCENE_ARENA< T >::dirty, KIGFX::GAL_MODERN::SCENE_ARENA< T >::elements, KIGFX::GAL_MODERN::PATCH_SPAN::empty(), KIGFX::GAL_MODERN::PATCH_SPAN::end, ensureBuffer(), m_renderThread, submitSpan(), T, and KIGFX::GAL_MODERN::SCENE_ARENA< T >::uploadAll.
Referenced by flushScene().
|
inlineoverridevirtual |
Return true if filled polygons are drawn from the SHAPE_POLY_SET triangulation cache, which painters should then fill before calling DrawPolygon.
Reimplemented from KIGFX::GAL.
Definition at line 61 of file gal_modern.h.
|
inlineinherited |
Tell whether the world scale is below a limit.
This is not a read of the scale, so what depends only on the answer stays valid through a zoom that does not cross the limit, see TakeWorldScaleLimits().
Definition at line 961 of file graphics_abstraction_layer.h.
References m_scaleLimitAbove, m_scaleLimitBelow, and m_worldScale.
Referenced by KIGFX::SCH_PAINTER::draw().
|
private |
Copy a resident group's elements into its slots, applying the layer's hoisted alpha.
Definition at line 2612 of file gal_modern.cpp.
References RHI_INSTANCE::a, RHI_VERTEX::a, ARENA_POLYGON, arenaOf(), KIGFX::GAL_MODERN::SCENE_LAYER::bakedAlpha, KIGFX::GAL_MODERN::GAL_GROUP::baseDepth, RHI_INSTANCE::depth, KIGFX::GAL_MODERN::SCENE_ARENA< T >::elements, KIGFX::GAL_MODERN::SCENE_LAYER::hasNegatives, KIGFX::GAL_MODERN::GAL_GROUP::instances, KIGFX::GAL_MODERN::SCENE_LAYER::instances, markSceneDirty(), normal, KIGFX::GAL_MODERN::SCENE_LAYER::overlayAlpha, KIGFX::GAL_MODERN::SCENE_LAYER::polygons, KIGFX::GAL_MODERN::GAL_GROUP::polygonVertices, relativeDepth(), RHI_INSTANCE_HARD_EDGE, RHI_INSTANCE_NEGATIVE, RHI_INSTANCE_OVERLAY_ALPHA, KIGFX::RHI_INSTANCED_SHAPES, sceneLayerComposited(), RHI_INSTANCE::SetFlag(), KIGFX::GAL_MODERN::GAL_GROUP::slotCount, KIGFX::GAL_MODERN::GAL_GROUP::slotStart, source, KIGFX::GAL_MODERN::SCENE_LAYER::translucent, and RHI_VERTEX::u.
Referenced by flushScene(), placeGroupInScene(), rewriteResidentGroup(), SetSceneLayerOverlayAlpha(), and SetSceneLayerState().
Definition at line 409 of file gal_modern.h.
References m_currentTransform, and m_transformIsIdentity.
Referenced by addArcInstance(), addCapsuleInstance(), addPadInstance(), DrawBitmap(), drawBitmapGlyphs(), and emitTriangle().
|
inlineprivate |
Definition at line 420 of file gal_modern.h.
References m_currentTransform, and m_transformIsIdentity.
Referenced by addArcInstance(), addPadInstance(), and drawBitmapGlyphs().
|
inlineprivate |
Definition at line 414 of file gal_modern.h.
References std::abs(), m_currentTransform, and m_transformIsIdentity.
Referenced by addArcInstance(), addCapsuleInstance(), addPadInstance(), and drawBitmapGlyphs().
|
staticconstexpr |
Definition at line 286 of file gal_modern.h.
Referenced by retainedTieOrderChanged().
|
staticconstexpr |
Arenas of one retained scene layer.
Each instanced shape has a normal and a negative arena so a layer draws every normal before any negative.
Definition at line 284 of file gal_modern.h.
Referenced by flushScene(), placeGroupInScene(), removeGroupFromScene(), and updateSceneCullRuns().
|
staticconstexpr |
Definition at line 285 of file gal_modern.h.
Referenced by buildSceneRuns(), flushScene(), placeGroupInScene(), removeGroupFromScene(), retainedTieOrderChanged(), updateSceneCullRuns(), and writeGroupToScene().
|
staticconstexprprivate |
Definition at line 868 of file gal_modern.h.
Referenced by evictBitmapCacheEntries().
|
staticconstexprprivate |
Definition at line 476 of file gal_modern.h.
Referenced by refillDynamicTarget().
|
staticprotectedinherited |
Depth level on which the grid is drawn.
Definition at line 1511 of file graphics_abstraction_layer.h.
|
privateinherited |
Definition at line 1618 of file graphics_abstraction_layer.h.
Referenced by BitmapText(), GetGlyphSize(), GetHorizontalJustify(), GetVerticalJustify(), IsFontBold(), IsFontItalic(), IsFontUnderlined(), IsTextMirrored(), SetFontBold(), SetFontItalic(), SetFontUnderlined(), SetGlyphSize(), SetHorizontalJustify(), SetTextMirrored(), and SetVerticalJustify().
|
protectedinherited |
Color of the axes.
Definition at line 1593 of file graphics_abstraction_layer.h.
Referenced by KIGFX::CAIRO_GAL_BASE::drawAxes(), KIGFX::OPENGL_GAL::DrawGrid(), KIGFX::GAL_MODERN::PopulateCameraUBOs(), and SetAxesColor().
|
protectedinherited |
Should the axes be drawn.
Definition at line 1594 of file graphics_abstraction_layer.h.
Referenced by KIGFX::CAIRO_GAL_BASE::DrawGrid(), KIGFX::GAL_MODERN::DrawGrid(), KIGFX::OPENGL_GAL::DrawGrid(), KIGFX::GAL_MODERN::PopulateCameraUBOs(), SetAxesEnabled(), and updatedGalDisplayOptions().
|
private |
use counter at frame start, entries used since are pinned
Definition at line 872 of file gal_modern.h.
Referenced by BeginDrawing(), and evictBitmapCacheEntries().
|
private |
Definition at line 392 of file gal_modern.h.
Referenced by drawBitmapGlyphs(), and SetBitmapGlyphs().
|
private |
glyph height while bitmap text is stroked, else 0
Definition at line 391 of file gal_modern.h.
Referenced by addCapsuleInstance(), and BitmapText().
|
private |
Definition at line 870 of file gal_modern.h.
Referenced by ClearCache(), countBitmapRefs(), DestroyBuffers(), DrawBitmap(), evictBitmapCacheEntries(), and ReleaseBuffers().
|
private |
bumped on every cache touch
Definition at line 871 of file gal_modern.h.
Referenced by BeginDrawing(), and DrawBitmap().
|
private |
Bumped whenever a resource is retired.
A descriptor built afterwards carries a generation at least as new and no longer references it.
Definition at line 594 of file gal_modern.h.
Referenced by GetDynamicDrawDesc(), GetStaticDrawDesc(), retireBuffer(), and retireTexture().
|
private |
The non-cached pool.
Each dynamic target has its own ring so one can be refilled while the other keeps the buffers its last frame uploaded.
Definition at line 541 of file gal_modern.h.
Referenced by buf(), buf(), DestroyBuffers(), and ReleaseBuffers().
|
private |
see SetCentringPad()
Definition at line 384 of file gal_modern.h.
Referenced by GetLayoutPixelSize(), and SetCentringPad().
|
protectedinherited |
Definition at line 1580 of file graphics_abstraction_layer.h.
Referenced by KIGFX::CAIRO_PRINT_GAL::CAIRO_PRINT_GAL(), KIGFX::CAIRO_GAL_BASE::ClearScreen(), KIGFX::OPENGL_GAL::ClearTarget(), KIGFX::CAIRO_GAL_BASE::drawGridSource(), KIGFX::GAL_MODERN::drawGridSource(), KIGFX::OPENGL_GAL::drawGridSources(), GetClearColor(), KIGFX::GAL_MODERN::GetDynamicDrawDesc(), KIGFX::GAL_MODERN::GetStaticDrawDesc(), and SetClearColor().
|
protectedinherited |
Crosshair drawing mode.
Definition at line 1606 of file graphics_abstraction_layer.h.
Referenced by KIGFX::CAIRO_GAL_BASE::blitCursor(), KIGFX::OPENGL_GAL::blitCursor(), GAL(), KIGFX::GAL_MODERN::PopulateCursorUBO(), and updatedGalDisplayOptions().
|
private |
Definition at line 542 of file gal_modern.h.
Referenced by buf(), buf(), and refillDynamicTarget().
|
private |
Definition at line 882 of file gal_modern.h.
Referenced by BeginGroup(), EndGroup(), and notePolarity().
|
protectedinherited |
Current cursor.
Definition at line 1609 of file graphics_abstraction_layer.h.
Referenced by GAL(), KIGFX::CAIRO_GAL::SetNativeCursorStyle(), SetNativeCursorStyle(), and KIGFX::OPENGL_GAL::SetNativeCursorStyle().
|
private |
Definition at line 545 of file gal_modern.h.
Referenced by obuf(), obuf(), and refillDynamicTarget().
|
private |
Definition at line 379 of file gal_modern.h.
Referenced by beginLayerRange(), currentTargetOpen(), drawBitmapGlyphs(), drawGridSources(), DrawGroup(), Flush(), GetTarget(), layerRangesForCurrentTarget(), layerRangesForCurrentTarget(), makeInstance(), poolForCurrentTarget(), poolForCurrentTarget(), refillDynamicTarget(), and SetTarget().
|
private |
Definition at line 894 of file gal_modern.h.
Referenced by BeginDrawing(), drawBitmapGlyphs(), GAL_MODERN(), recomputeTransformIdentity(), Restore(), Save(), Transform(), xform(), xformAngle(), and xformScale().
|
protectedinherited |
Cursor color.
Definition at line 1605 of file graphics_abstraction_layer.h.
Referenced by getCursorColor(), and SetCursorColor().
|
protectedinherited |
Current cursor position (world coordinates)
Definition at line 1607 of file graphics_abstraction_layer.h.
Referenced by KIGFX::CAIRO_GAL_BASE::blitCursor(), KIGFX::OPENGL_GAL::blitCursor(), KIGFX::CAIRO_GAL_BASE::DrawCursor(), KIGFX::GAL_MODERN::DrawCursor(), KIGFX::OPENGL_GAL::DrawCursor(), and KIGFX::GAL_MODERN::PopulateCursorUBO().
|
protectedinherited |
Range of the depth.
Definition at line 1584 of file graphics_abstraction_layer.h.
Referenced by KIGFX::OPENGL_GAL::BeginDrawing(), KIGFX::CAIRO_GAL_BASE::drawGridSources(), GetMaxDepth(), GetMinDepth(), SetDepthRange(), and SetLayerDepth().
|
protectedinherited |
Stored depth values.
Definition at line 1553 of file graphics_abstraction_layer.h.
|
private |
Definition at line 373 of file gal_modern.h.
Referenced by DestroyBuffers(), DrawBitmap(), ensureBuffer(), GAL_MODERN(), PopulateCameraUBOs(), PopulateCursorUBO(), ReleaseRetiredBuffers(), retireBuffer(), and retireTexture().
|
private |
Definition at line 393 of file gal_modern.h.
Referenced by beginLayerRange(), EndDiffLayer(), and StartDiffLayer().
|
private |
see SetDpiScale()
Definition at line 383 of file gal_modern.h.
Referenced by drawGridSource(), PopulateCameraUBOs(), PopulateCursorUBO(), and SetDpiScale().
|
private |
Definition at line 395 of file gal_modern.h.
Referenced by BeginDrawing(), ClearScreen(), DrawCursor(), and GetDynamicDrawDesc().
|
private |
Definition at line 394 of file gal_modern.h.
Referenced by ClearScreen(), DrawGrid(), GetDynamicDrawDesc(), GetStaticDrawDesc(), and refillDynamicTarget().
|
private |
emissions go to m_gridPool
Definition at line 577 of file gal_modern.h.
Referenced by currentTargetOpen(), drawGridSources(), layerRangesForCurrentTarget(), layerRangesForCurrentTarget(), poolForCurrentTarget(), and poolForCurrentTarget().
|
private |
Definition at line 899 of file gal_modern.h.
Referenced by ClearScreen(), Flush(), GetDynamicDrawDesc(), layerRangesForCurrentTarget(), layerRangesForCurrentTarget(), refillDynamicTarget(), and SetTarget().
|
protectedinherited |
The fill color.
Definition at line 1578 of file graphics_abstraction_layer.h.
Referenced by KIGFX::OPENGL_GAL::BeginDrawing(), KIGFX::GAL_MODERN::DrawArc(), KIGFX::OPENGL_GAL::DrawArc(), KIGFX::GAL_MODERN::DrawArcSegment(), KIGFX::OPENGL_GAL::DrawArcSegment(), KIGFX::GAL_MODERN::DrawCircle(), KIGFX::OPENGL_GAL::drawCircle(), KIGFX::OPENGL_GAL::DrawEllipse(), KIGFX::OPENGL_GAL::DrawEllipseArc(), KIGFX::GAL_MODERN::drawEllipseShape(), KIGFX::GAL_MODERN::DrawGlyph(), KIGFX::OPENGL_GAL::DrawGlyph(), KIGFX::OPENGL_GAL::DrawGlyphs(), KIGFX::CAIRO_GAL_BASE::DrawGroup(), KIGFX::GAL_MODERN::DrawHoleWall(), KIGFX::OPENGL_GAL::DrawHoleWall(), KIGFX::GAL_MODERN::DrawPolygon(), KIGFX::GAL_MODERN::DrawPolygon(), KIGFX::GAL_MODERN::DrawPolygon(), KIGFX::GAL_MODERN::DrawPolygon(), KIGFX::OPENGL_GAL::drawPolygon(), KIGFX::GAL_MODERN::DrawRectangle(), KIGFX::OPENGL_GAL::DrawRectangle(), KIGFX::CAIRO_GAL_BASE::DrawSegment(), KIGFX::GAL_MODERN::DrawSegment(), KIGFX::OPENGL_GAL::drawSegment(), KIGFX::OPENGL_GAL::drawSemiCircle(), KIGFX::OPENGL_GAL::drawTriangulatedPolyset(), KIGFX::CAIRO_GAL_BASE::flushPath(), GetFillColor(), KIGFX::CAIRO_GAL_BASE::SetFillColor(), SetFillColor(), and KIGFX::CAIRO_GAL_BASE::storePath().
|
protectedinherited |
Always show cursor.
Definition at line 1604 of file graphics_abstraction_layer.h.
Referenced by GAL(), IsCursorEnabled(), and updatedGalDisplayOptions().
|
protectedinherited |
Flag for X axis flipping.
Definition at line 1569 of file graphics_abstraction_layer.h.
Referenced by BitmapText(), KIGFX::OPENGL_GAL::BitmapText(), KIGFX::CAIRO_PRINT_GAL::ComputeWorldScreenMatrix(), ComputeWorldScreenMatrix(), KIGFX::GAL_MODERN::drawBitmapGlyphs(), IsFlippedX(), and SetFlip().
|
protectedinherited |
Flag for Y axis flipping.
Definition at line 1570 of file graphics_abstraction_layer.h.
Referenced by KIGFX::OPENGL_GAL::BitmapText(), KIGFX::CAIRO_PRINT_GAL::ComputeWorldScreenMatrix(), ComputeWorldScreenMatrix(), KIGFX::GAL_MODERN::drawBitmapGlyphs(), IsFlippedY(), and SetFlip().
|
protectedinherited |
Color of the grid.
Definition at line 1592 of file graphics_abstraction_layer.h.
Referenced by KIGFX::CAIRO_GAL_BASE::DrawGrid(), KIGFX::OPENGL_GAL::DrawGrid(), GetGridColor(), gridSourceColor(), KIGFX::GAL_MODERN::PopulateCameraUBOs(), and SetGridColor().
|
private |
Definition at line 575 of file gal_modern.h.
Referenced by ClearScreen(), drawGridSources(), Flush(), GetStaticDrawDesc(), layerRangesForCurrentTarget(), and layerRangesForCurrentTarget().
|
protectedinherited |
Line width of the grid.
Definition at line 1596 of file graphics_abstraction_layer.h.
Referenced by KIGFX::CAIRO_GAL_BASE::DrawGrid(), KIGFX::CAIRO_GAL_BASE::drawGridSource(), GAL(), GetGridLineWidth(), gridMinorLineWidth(), KIGFX::GAL_MODERN::PopulateCameraUBOs(), and updatedGalDisplayOptions().
|
protectedinherited |
Minimum screen size of the grid (pixels) below which the grid is not drawn.
Definition at line 1597 of file graphics_abstraction_layer.h.
Referenced by computeMinGridSpacing(), GAL(), and updatedGalDisplayOptions().
|
protectedinherited |
The grid offset to compensate cursor position.
Definition at line 1591 of file graphics_abstraction_layer.h.
Referenced by GetGridPoint(), SetGridOrigin(), and SetGridSize().
|
protectedinherited |
The grid origin.
Definition at line 1590 of file graphics_abstraction_layer.h.
Referenced by KIGFX::CAIRO_GAL_BASE::DrawGrid(), KIGFX::OPENGL_GAL::DrawGrid(), GetGridOrigin(), KIGFX::GAL_MODERN::PopulateCameraUBOs(), SetGridOrigin(), and SetGridSize().
|
private |
The grids of the grid items, which the static target draws over the grid and under all else.
Rebuilt by each DrawGrid, and uploaded and redrawn only when that changed them.
Definition at line 574 of file gal_modern.h.
Referenced by ClearScreen(), DestroyBuffers(), drawGridSources(), Flush(), GetStaticDrawDesc(), keepsRelativeDepth(), poolForCurrentTarget(), poolForCurrentTarget(), and ReleaseBuffers().
|
private |
hash of what the GPU buffers hold
Definition at line 578 of file gal_modern.h.
Referenced by Flush().
|
private |
Definition at line 576 of file gal_modern.h.
Referenced by ClearScreen(), drawGridSources(), and Flush().
|
protectedinherited |
The grid size.
Definition at line 1589 of file graphics_abstraction_layer.h.
Referenced by KIGFX::CAIRO_GAL_BASE::DrawGrid(), KIGFX::OPENGL_GAL::DrawGrid(), GetGridPoint(), GetGridSize(), GetVisibleGridSize(), KIGFX::GAL_MODERN::gridShown(), SetGridOrigin(), and SetGridSize().
|
protectedinherited |
Sources overlayed on the display grid.
Definition at line 1600 of file graphics_abstraction_layer.h.
Referenced by KIGFX::CAIRO_GAL_BASE::DrawGrid(), KIGFX::OPENGL_GAL::DrawGrid(), KIGFX::CAIRO_GAL_BASE::drawGridSources(), KIGFX::GAL_MODERN::drawGridSources(), KIGFX::OPENGL_GAL::drawGridSources(), GetGridPoint(), GetGridSources(), and SetGridSources().
|
protectedinherited |
Grid display style.
Definition at line 1588 of file graphics_abstraction_layer.h.
Referenced by KIGFX::CAIRO_GAL_BASE::DrawGrid(), KIGFX::OPENGL_GAL::DrawGrid(), GAL(), GetGridStyle(), GetVisibleGridSize(), KIGFX::GAL_MODERN::PopulateCameraUBOs(), and updatedGalDisplayOptions().
|
protectedinherited |
Every tick line gets the double width.
Definition at line 1595 of file graphics_abstraction_layer.h.
Referenced by KIGFX::CAIRO_GAL_BASE::DrawGrid(), KIGFX::OPENGL_GAL::DrawGrid(), GetCoarseGrid(), GetVisibleGridSize(), gridLattice(), KIGFX::GAL_MODERN::PopulateCameraUBOs(), SetCoarseGrid(), and updatedGalDisplayOptions().
|
protectedinherited |
Should the grid be shown.
Definition at line 1587 of file graphics_abstraction_layer.h.
Referenced by KIGFX::CAIRO_GAL_BASE::DrawGrid(), KIGFX::OPENGL_GAL::DrawGrid(), GetGridSnapping(), GetGridVisibility(), KIGFX::GAL_MODERN::gridShown(), and SetGridVisibility().
|
private |
Definition at line 881 of file gal_modern.h.
Referenced by BeginGroup().
|
private |
Definition at line 883 of file gal_modern.h.
Referenced by BeginGroup(), drawBitmapGlyphs(), DrawGroup(), EndGroup(), makeInstance(), and poolForCurrentTarget().
|
private |
the group being recorded has drawn a knockout
Definition at line 866 of file gal_modern.h.
Referenced by BeginGroup(), EndGroup(), and notePolarity().
|
private |
Definition at line 880 of file gal_modern.h.
Referenced by appendSceneRanges(), buildSceneRuns(), ChangeGroupColor(), ChangeGroupDepth(), ChangeGroupUndimmed(), ClearCache(), compactSceneArena(), DeleteGroup(), DrawGroup(), EndGroup(), flushScene(), GroupContentFingerprint(), removeGroupFromScene(), resetScene(), retainedTieOrderChanged(), SetGroupPlacement(), SetSceneLayerOverlayAlpha(), SetSceneLayerState(), and SetSceneScale().
|
private |
Definition at line 892 of file gal_modern.h.
Referenced by BeginGroup(), and EndGroup().
|
private |
BeginGroup() swaps these with the current pool's vectors and EndGroup() swaps them back.
Swapping keeps valid the storage the render thread may still upload from, so groups can be rebuilt outside a drawing context.
Definition at line 890 of file gal_modern.h.
Referenced by BeginGroup(), and EndGroup().
|
private |
Definition at line 891 of file gal_modern.h.
Referenced by BeginGroup(), and EndGroup().
|
protectedinherited |
Color for hovered (active) links.
Definition at line 1581 of file graphics_abstraction_layer.h.
Referenced by DrawGlyphs(), and SetHoverColor().
|
protectedinherited |
Is the cursor enabled?
Definition at line 1603 of file graphics_abstraction_layer.h.
Referenced by getCursorColor(), IsCursorEnabled(), and SetCursorEnabled().
|
private |
Definition at line 377 of file gal_modern.h.
Referenced by BeginDrawing(), beginLayerRange(), BeginSceneLayer(), ClearTarget(), EndDiffLayer(), EndDrawing(), IsDrawingMode(), poolForCurrentTarget(), refillDynamicTarget(), and StartDiffLayer().
|
protectedinherited |
Is filling of graphic objects enabled ?
Definition at line 1575 of file graphics_abstraction_layer.h.
Referenced by KIGFX::CAIRO_GAL_BASE::DrawArc(), KIGFX::GAL_MODERN::DrawArc(), KIGFX::OPENGL_GAL::DrawArc(), KIGFX::CAIRO_GAL_BASE::DrawArcSegment(), KIGFX::GAL_MODERN::DrawArcSegment(), KIGFX::OPENGL_GAL::DrawArcSegment(), KIGFX::GAL_MODERN::DrawCircle(), KIGFX::OPENGL_GAL::drawCircle(), KIGFX::OPENGL_GAL::DrawEllipse(), KIGFX::CAIRO_GAL_BASE::DrawEllipseArc(), KIGFX::OPENGL_GAL::DrawEllipseArc(), KIGFX::GAL_MODERN::drawEllipseShape(), KIGFX::CAIRO_GAL_BASE::DrawGroup(), KIGFX::GAL_MODERN::DrawHoleWall(), KIGFX::OPENGL_GAL::DrawHoleWall(), KIGFX::GAL_MODERN::DrawPolygon(), KIGFX::GAL_MODERN::DrawPolygon(), KIGFX::GAL_MODERN::DrawPolygon(), KIGFX::GAL_MODERN::DrawPolygon(), KIGFX::OPENGL_GAL::drawPolygon(), KIGFX::GAL_MODERN::DrawRectangle(), KIGFX::OPENGL_GAL::DrawRectangle(), KIGFX::CAIRO_GAL_BASE::DrawSegment(), KIGFX::GAL_MODERN::DrawSegment(), KIGFX::OPENGL_GAL::drawSegment(), KIGFX::OPENGL_GAL::drawSegmentChain(), KIGFX::OPENGL_GAL::drawSemiCircle(), KIGFX::OPENGL_GAL::drawTriangulatedPolyset(), KIGFX::CAIRO_GAL_BASE::flushPath(), GetIsFill(), KIGFX::CAIRO_GAL_BASE::SetIsFill(), SetIsFill(), and KIGFX::CAIRO_GAL_BASE::storePath().
|
protectedinherited |
Are the outlines stroked ?
Definition at line 1576 of file graphics_abstraction_layer.h.
Referenced by KIGFX::GAL_MODERN::DrawArc(), KIGFX::OPENGL_GAL::DrawArc(), KIGFX::CAIRO_GAL_BASE::DrawArcSegment(), KIGFX::GAL_MODERN::DrawArcSegment(), KIGFX::OPENGL_GAL::DrawArcSegment(), KIGFX::GAL_MODERN::DrawCircle(), KIGFX::OPENGL_GAL::drawCircle(), KIGFX::OPENGL_GAL::DrawEllipse(), KIGFX::OPENGL_GAL::DrawEllipseArc(), KIGFX::GAL_MODERN::drawEllipseShape(), KIGFX::CAIRO_GAL_BASE::DrawGroup(), KIGFX::GAL_MODERN::DrawPolygon(), KIGFX::GAL_MODERN::DrawPolygon(), KIGFX::GAL_MODERN::DrawPolygon(), KIGFX::GAL_MODERN::DrawPolygon(), KIGFX::OPENGL_GAL::drawPolygon(), KIGFX::GAL_MODERN::DrawRectangle(), KIGFX::OPENGL_GAL::DrawRectangle(), KIGFX::OPENGL_GAL::drawSemiCircle(), KIGFX::OPENGL_GAL::drawTriangulatedPolyset(), KIGFX::CAIRO_GAL_BASE::flushPath(), GetIsStroke(), KIGFX::CAIRO_GAL_BASE::SetIsStroke(), SetIsStroke(), and KIGFX::CAIRO_GAL_BASE::storePath().
|
private |
Definition at line 378 of file gal_modern.h.
Referenced by beginLayerRange(), beginUpdate(), and endUpdate().
|
protectedinherited |
The actual layer depth.
Definition at line 1583 of file graphics_abstraction_layer.h.
Referenced by AdvanceDepth(), KIGFX::GAL_MODERN::BeginSceneLayer(), KIGFX::OPENGL_GAL::BitmapText(), KIGFX::OPENGL_GAL::DrawArc(), KIGFX::OPENGL_GAL::DrawBitmap(), KIGFX::GAL_MODERN::drawBitmapGlyphs(), KIGFX::OPENGL_GAL::drawCircle(), KIGFX::OPENGL_GAL::DrawEllipse(), KIGFX::OPENGL_GAL::DrawEllipseArc(), KIGFX::OPENGL_GAL::drawFilledSemiCircle(), KIGFX::OPENGL_GAL::DrawGlyph(), KIGFX::OPENGL_GAL::DrawGlyphs(), KIGFX::GAL_MODERN::drawGridSources(), KIGFX::GAL_MODERN::DrawGroup(), KIGFX::OPENGL_GAL::DrawHoleWall(), KIGFX::OPENGL_GAL::drawLineQuad(), KIGFX::OPENGL_GAL::DrawPolygon(), KIGFX::OPENGL_GAL::DrawPolygon(), KIGFX::OPENGL_GAL::DrawPolygon(), KIGFX::OPENGL_GAL::DrawRectangle(), KIGFX::OPENGL_GAL::drawStrokedSemiCircle(), KIGFX::OPENGL_GAL::drawTriangulatedPolyset(), KIGFX::GAL_MODERN::EndDiffLayer(), KIGFX::GAL_MODERN::EndGroup(), KIGFX::GAL_MODERN::fillVertex(), getLayerDepth(), KIGFX::GAL_MODERN::makeInstance(), KIGFX::GAL_MODERN::refillDynamicTarget(), SetLayerDepth(), and KIGFX::GAL_MODERN::StartDiffLayer().
|
protectedinherited |
The line width.
Definition at line 1572 of file graphics_abstraction_layer.h.
Referenced by KIGFX::CAIRO_GAL_BASE::CAIRO_GAL_BASE(), KIGFX::GAL_MODERN::DrawArc(), KIGFX::CAIRO_GAL_BASE::DrawArcSegment(), KIGFX::GAL_MODERN::DrawArcSegment(), KIGFX::GAL_MODERN::DrawCircle(), KIGFX::OPENGL_GAL::drawCircle(), KIGFX::GAL_MODERN::DrawLine(), KIGFX::OPENGL_GAL::drawLineQuad(), KIGFX::GAL_MODERN::DrawRectangle(), KIGFX::OPENGL_GAL::drawStrokedSemiCircle(), GetLineWidth(), KIGFX::CAIRO_GAL_BASE::resetContext(), KIGFX::CAIRO_GAL_BASE::SetLineWidth(), SetLineWidth(), and KIGFX::CAIRO_GAL_BASE::syncLineWidth().
|
private |
groups with a scale threshold, by it
Definition at line 748 of file gal_modern.h.
Referenced by ClearCache(), SetSceneScale(), and trackGroupLod().
|
protectedinherited |
Point to be looked at in world space.
Definition at line 1558 of file graphics_abstraction_layer.h.
Referenced by KIGFX::CAIRO_PRINT_GAL::ComputeWorldScreenMatrix(), ComputeWorldScreenMatrix(), KIGFX::OPENGL_GAL::ComputeWorldScreenMatrix(), GetLookAtPoint(), and SetLookAtPoint().
|
protectedinherited |
Minimum line width in pixels.
Definition at line 1573 of file graphics_abstraction_layer.h.
Referenced by GetMinLineWidth(), and SetMinLineWidth().
|
private |
Definition at line 386 of file gal_modern.h.
Referenced by drawBitmapGlyphs(), EndNegativesLayer(), fillVertex(), makeInstance(), SetNegativeDrawMode(), and StartNegativesLayer().
|
private |
Definition at line 757 of file gal_modern.h.
Referenced by BeginSceneLayer(), EndNegativesLayer(), and StartNegativesLayer().
|
private |
non-cached pool was emptied for the frame being drawn
Definition at line 548 of file gal_modern.h.
Referenced by BeginDrawing(), ClearTarget(), currentTargetOpen(), DrawGroup(), Flush(), and refillDynamicTarget().
|
protectedinherited |
Definition at line 1551 of file graphics_abstraction_layer.h.
Referenced by GAL().
|
private |
Definition at line 749 of file gal_modern.h.
Referenced by BeginSceneLayer(), flushScene(), resetScene(), and SetGroupPlacement().
|
private |
Definition at line 750 of file gal_modern.h.
Referenced by BeginSceneLayer(), flushScene(), resetScene(), and SetGroupPlacement().
|
protectedinherited |
Definition at line 1550 of file graphics_abstraction_layer.h.
Referenced by KIGFX::OPENGL_GAL::BeginDrawing(), GAL(), GetGridSnapping(), KIGFX::OPENGL_GAL::OPENGL_GAL(), KIGFX::CAIRO_GAL::setCompositor(), KIGFX::CAIRO_GAL::updatedGalDisplayOptions(), updatedGalDisplayOptions(), and KIGFX::OPENGL_GAL::updatedGalDisplayOptions().
|
private |
Definition at line 900 of file gal_modern.h.
Referenced by ClearScreen(), Flush(), GetDynamicDrawDesc(), layerRangesForCurrentTarget(), layerRangesForCurrentTarget(), refillDynamicTarget(), and SetTarget().
|
private |
Definition at line 549 of file gal_modern.h.
Referenced by BeginDrawing(), ClearTarget(), currentTargetOpen(), DrawGroup(), Flush(), and refillDynamicTarget().
|
private |
Definition at line 544 of file gal_modern.h.
Referenced by DestroyBuffers(), obuf(), obuf(), and ReleaseBuffers().
|
private |
Definition at line 547 of file gal_modern.h.
Referenced by BeginDrawing(), ClearTarget(), currentTargetOpen(), DestroyBuffers(), DrawGroup(), GetDynamicDrawDesc(), GetStaticDrawDesc(), keepsRelativeDepth(), refillDynamicTarget(), RefillsNonCachedTargets(), retireBuffer(), retireTexture(), and SetPersistentTargets().
|
private |
Definition at line 743 of file gal_modern.h.
Referenced by placeGroupInScene().
|
private |
Definition at line 374 of file gal_modern.h.
Referenced by drawBitmapGlyphs(), Flush(), SetRenderThread(), submitSpan(), and uploadSceneArena().
|
private |
Definition at line 596 of file gal_modern.h.
Referenced by ReleaseBuffers(), ReleaseRetiredBuffers(), and retireBuffer().
|
private |
Definition at line 597 of file gal_modern.h.
Referenced by ReleaseBuffers(), ReleaseRetiredBuffers(), and retireTexture().
|
private |
Definition at line 376 of file gal_modern.h.
Referenced by GAL_MODERN(), and IsInitialized().
|
protectedinherited |
Rotation transformation (radians)
Definition at line 1561 of file graphics_abstraction_layer.h.
Referenced by ComputeWorldScreenMatrix(), GetRotation(), and SetRotation().
|
mutableprotectedinherited |
Definition at line 1567 of file graphics_abstraction_layer.h.
Referenced by TakeWorldScaleLimits(), and WorldScaleBelow().
|
mutableprotectedinherited |
Definition at line 1566 of file graphics_abstraction_layer.h.
Referenced by TakeWorldScaleLimits(), and WorldScaleBelow().
|
private |
Definition at line 752 of file gal_modern.h.
Referenced by Flush(), placeGroupInScene(), removeGroupFromScene(), resetScene(), rewriteResidentGroup(), SetSceneDrawOrdered(), SetSceneLayerDim(), SetSceneLayerOverlayAlpha(), SetSceneLayerState(), and SyncScene().
|
private |
Definition at line 744 of file gal_modern.h.
Referenced by buildSceneRuns(), and SetSceneDrawOrdered().
|
private |
by VIEW layer id
Definition at line 746 of file gal_modern.h.
Referenced by appendSceneRanges(), assignSlicesByOrder(), BeginSceneLayer(), ChangeGroupColor(), DestroyBuffers(), flushScene(), ReleaseBuffers(), removeGroupFromScene(), resetScene(), rewriteResidentGroup(), SetGroupPlacement(), SetSceneDrawOrdered(), SetSceneLayerDim(), SetSceneLayerOverlayAlpha(), SetSceneLayerState(), and SetSceneScale().
|
private |
layer ids in draw order
Definition at line 747 of file gal_modern.h.
Referenced by appendSceneRanges(), flushScene(), SetSceneLayerState(), and sortSceneOrder().
|
private |
Definition at line 753 of file gal_modern.h.
Referenced by flushScene(), SetSceneLayerState(), and sortSceneOrder().
|
private |
Definition at line 751 of file gal_modern.h.
Referenced by SetGroupPlacement(), and SetSceneScale().
|
protectedinherited |
The dots per inch of the screen.
Definition at line 1557 of file graphics_abstraction_layer.h.
Referenced by computeWorldScale(), KIGFX::CAIRO_PRINT_GAL::ComputeWorldScreenMatrix(), GetScreenDPI(), SetScreenDPI(), and KIGFX::CAIRO_PRINT_GAL::SetSheetSize().
|
private |
Definition at line 382 of file gal_modern.h.
Referenced by PopulateCameraUBOs(), PopulateCursorUBO(), and ResizeScreen().
|
protectedinherited |
Screen size in screen (wx logical) coordinates.
Definition at line 1554 of file graphics_abstraction_layer.h.
Referenced by KIGFX::CAIRO_GAL::allocateBitmaps(), KIGFX::OPENGL_GAL::BeginDrawing(), KIGFX::CAIRO_GAL_BASE::blitCursor(), KIGFX::OPENGL_GAL::blitCursor(), KIGFX::CAIRO_GAL::CAIRO_GAL(), KIGFX::CAIRO_GAL_BASE::ClearScreen(), KIGFX::CAIRO_GAL_BASE::DrawGrid(), KIGFX::OPENGL_GAL::DrawGrid(), KIGFX::CAIRO_GAL::EndDrawing(), GetLayoutPixelSize(), KIGFX::GAL_MODERN::GetLayoutPixelSize(), GetScreenPixelSize(), KIGFX::OPENGL_GAL::getScreenPixelSize(), GetVisibleWorldExtents(), gridScreenBBox(), KIGFX::CAIRO_GAL::initSurface(), KIGFX::OPENGL_GAL::OPENGL_GAL(), KIGFX::CAIRO_GAL_BASE::ResizeScreen(), KIGFX::OPENGL_GAL::ResizeScreen(), KIGFX::CAIRO_GAL::setCompositor(), and SetScreenSize().
|
private |
Definition at line 387 of file gal_modern.h.
Referenced by addCapsuleInstance(), drawBitmapGlyphs(), and SetScreenSpaceMode().
|
private |
Definition at line 381 of file gal_modern.h.
Referenced by PopulateCameraUBOs(), PopulateCursorUBO(), and ResizeScreen().
|
protectedinherited |
Screen transformation.
Definition at line 1563 of file graphics_abstraction_layer.h.
Referenced by KIGFX::OPENGL_GAL::blitCursor(), KIGFX::CAIRO_PRINT_GAL::ComputeWorldScreenMatrix(), ComputeWorldScreenMatrix(), KIGFX::CAIRO_GAL_BASE::DrawGrid(), KIGFX::OPENGL_GAL::DrawGrid(), GetScreenWorldMatrix(), gridScreenBBox(), KIGFX::GAL_MODERN::PopulateCameraUBOs(), KIGFX::GAL_MODERN::screenPixelSize(), and ToWorld().
|
private |
Definition at line 568 of file gal_modern.h.
Referenced by BeginDrawing(), BeginSceneLayer(), ChangeGroupColor(), ChangeGroupDepth(), ClearCache(), ClearScreen(), Flush(), HasStaticRebuildPending(), MarkStaticDirty(), rewriteResidentGroup(), SetGroupPlacement(), SetSceneLayerState(), SetSceneScale(), and SyncScene().
|
private |
A group may be drawn into the static pool more than once per build, so a patch touches every slot.
Definition at line 613 of file gal_modern.h.
Referenced by clearStaticSlots(), DrawGroup(), and patchStaticGroup().
|
private |
Kept per pool so static ranges survive BeginDrawing when m_staticDirty is false.
Definition at line 898 of file gal_modern.h.
Referenced by BeginDrawing(), ClearScreen(), Flush(), GetDrawDesc(), GetStaticDrawDesc(), layerRangesForCurrentTarget(), layerRangesForCurrentTarget(), and SetTarget().
|
private |
Definition at line 638 of file gal_modern.h.
Referenced by clearStaticSlots(), Flush(), and patchStaticGroup().
|
private |
Pool for TARGET_CACHED.
It survives across frames and is cleared only when m_staticDirty is set, so frames that change only dynamic content do not re-emit the whole board.
Definition at line 567 of file gal_modern.h.
Referenced by BeginDrawing(), ClearScreen(), DestroyBuffers(), DrawGroup(), Flush(), GetDrawDesc(), GetStaticDrawDesc(), keepsRelativeDepth(), patchStaticGroup(), poolForCurrentTarget(), poolForCurrentTarget(), and ReleaseBuffers().
|
private |
Definition at line 588 of file gal_modern.h.
Referenced by Flush(), and TakeStaticChanged().
|
protectedinherited |
The color of the outlines.
Definition at line 1579 of file graphics_abstraction_layer.h.
Referenced by KIGFX::OPENGL_GAL::BeginDrawing(), KIGFX::OPENGL_GAL::BitmapText(), KIGFX::GAL_MODERN::DrawArc(), KIGFX::OPENGL_GAL::DrawArc(), KIGFX::CAIRO_GAL_BASE::DrawArcSegment(), KIGFX::GAL_MODERN::DrawArcSegment(), KIGFX::OPENGL_GAL::DrawArcSegment(), KIGFX::GAL_MODERN::drawBitmapGlyphs(), KIGFX::OPENGL_GAL::drawBitmapOverbar(), KIGFX::GAL_MODERN::DrawCircle(), KIGFX::OPENGL_GAL::drawCircle(), KIGFX::OPENGL_GAL::DrawEllipse(), KIGFX::OPENGL_GAL::DrawEllipseArc(), KIGFX::CAIRO_GAL_BASE::DrawGroup(), KIGFX::GAL_MODERN::DrawLine(), KIGFX::OPENGL_GAL::DrawLine(), KIGFX::OPENGL_GAL::drawPolyline(), KIGFX::GAL_MODERN::DrawRectangle(), KIGFX::OPENGL_GAL::DrawRectangle(), KIGFX::CAIRO_GAL_BASE::DrawSegment(), KIGFX::GAL_MODERN::DrawSegment(), KIGFX::OPENGL_GAL::drawSegment(), KIGFX::OPENGL_GAL::drawSegmentChain(), KIGFX::OPENGL_GAL::drawSemiCircle(), KIGFX::CAIRO_GAL_BASE::flushPath(), GetStrokeColor(), KIGFX::CAIRO_GAL_BASE::SetStrokeColor(), SetStrokeColor(), and KIGFX::CAIRO_GAL_BASE::storePath().
|
private |
see SetStrokeLengthPad(), 0 when off
Definition at line 389 of file gal_modern.h.
Referenced by addCapsuleInstance(), and SetStrokeLengthPad().
|
private |
see SetStrokeLevelOfDetail(), 0 when off
Definition at line 390 of file gal_modern.h.
Referenced by addCapsuleInstance(), drawBitmapGlyphs(), and SetStrokeLevelOfDetail().
|
private |
see SetStrokePixelPad(), in sixteenths of a pixel
Definition at line 388 of file gal_modern.h.
Referenced by drawBitmapGlyphs(), makeInstance(), and SetStrokePixelPad().
|
private |
The GPU applies world to screen, so most geometry skips the matrix math on the hot path.
Definition at line 398 of file gal_modern.h.
Referenced by BeginDrawing(), recomputeTransformIdentity(), xform(), xformAngle(), and xformScale().
|
private |
Definition at line 895 of file gal_modern.h.
Referenced by BeginDrawing(), Restore(), and Save().
|
protectedinherited |
The scale factor world->screen.
Definition at line 1564 of file graphics_abstraction_layer.h.
Referenced by KIGFX::GAL_MODERN::addCapsuleInstance(), KIGFX::OPENGL_GAL::blitCursor(), computeWorldScale(), KIGFX::CAIRO_PRINT_GAL::ComputeWorldScreenMatrix(), ComputeWorldScreenMatrix(), KIGFX::OPENGL_GAL::ComputeWorldScreenMatrix(), KIGFX::CAIRO_GAL_BASE::DrawGrid(), KIGFX::CAIRO_GAL_BASE::drawGridSource(), GetVisibleGridSize(), GetWorldScale(), GetWorldScaleForScreenSpace(), gridLattice(), and WorldScaleBelow().
|
mutableprotectedinherited |
Definition at line 1565 of file graphics_abstraction_layer.h.
Referenced by GetScreenWorldMatrix(), GetWorldScale(), GetWorldScreenMatrix(), and TakeWorldScaleRead().
|
protectedinherited |
World transformation.
Definition at line 1562 of file graphics_abstraction_layer.h.
Referenced by KIGFX::OPENGL_GAL::BeginDrawing(), KIGFX::CAIRO_PRINT_GAL::ComputeWorldScreenMatrix(), ComputeWorldScreenMatrix(), GetWorldScreenMatrix(), KIGFX::GAL_MODERN::PopulateCursorUBO(), KIGFX::CAIRO_GAL_BASE::resetContext(), SetWorldScreenMatrix(), and ToScreen().
|
protectedinherited |
The unit length of the world coordinates [inch].
Definition at line 1556 of file graphics_abstraction_layer.h.
Referenced by computeWorldScale(), KIGFX::CAIRO_PRINT_GAL::ComputeWorldScreenMatrix(), KIGFX::CAIRO_GAL_BASE::DrawBitmap(), KIGFX::GAL_MODERN::DrawBitmap(), KIGFX::OPENGL_GAL::DrawBitmap(), GetWorldUnitLength(), and SetWorldUnitLength().
|
protectedinherited |
The zoom factor.
Definition at line 1560 of file graphics_abstraction_layer.h.
Referenced by computeWorldScale(), KIGFX::CAIRO_PRINT_GAL::ComputeWorldScreenMatrix(), GetZoomFactor(), KIGFX::GAL_MODERN::PopulateCameraUBOs(), and SetZoomFactor().
|
staticprotectedinherited |
Definition at line 1508 of file graphics_abstraction_layer.h.
Referenced by GAL(), and KIGFX::GAL_MODERN::PopulateCameraUBOs().
|
staticprotectedinherited |
Possible depth range.
Definition at line 1507 of file graphics_abstraction_layer.h.
Referenced by GAL().
|
staticconstexprprotectedinherited |
The default number of segments approximating a full circle.
Definition at line 1466 of file graphics_abstraction_layer.h.
Referenced by calcAngleStep(), and KIGFX::OPENGL_GAL::DrawArcSegment().