|
KiCad PCB EDA Suite
|
OpenGL implementation of the Graphics Abstraction Layer. More...
#include <opengl_gal.h>
Classes | |
| struct | TessParams |
| Parameters passed to the GLU tesselator. More... | |
Public Member Functions | |
| OPENGL_GAL (const KIGFX::VC_SETTINGS &aVcSettings, GAL_DISPLAY_OPTIONS &aDisplayOptions, wxWindow *aParent, wxEvtHandler *aMouseListener=nullptr, wxEvtHandler *aPaintListener=nullptr, const wxString &aName=wxT("GLCanvas")) | |
| ~OPENGL_GAL () | |
| bool | IsOpenGlEngine () override |
| Return true if the GAL engine is a OpenGL based type. | |
| 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. | |
| bool | IsInitialized () const override |
| Return the initialization status for the canvas. | |
| bool | IsVisible () const override |
| Return true if the GAL canvas is visible on the screen. | |
| void | SetMinLineWidth (float aLineWidth) override |
| Set the minimum line width in pixels. | |
| 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 | 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 | DrawCircle (const VECTOR2D &aCenterPoint, double aRadius) override |
| Draw a circle using world coordinates. | |
| void | DrawHoleWall (const VECTOR2D &aCenterPoint, double aHoleRadius, double aWallWidth) override |
| Draw a hole wall ring. | |
| 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 | 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 | DrawRectangle (const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint) override |
| Draw a rectangle. | |
| 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 | 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 |
| virtual void | DrawGlyph (const KIFONT::GLYPH &aGlyph, int aNth, int aTotal) override |
| Draw a polygon representing a font glyph. | |
| virtual void | DrawGlyphs (const std::vector< std::unique_ptr< KIFONT::GLYPH > > &aGlyphs) override |
| Draw polygons representing font glyphs. | |
| void | DrawCurve (const VECTOR2D &startPoint, const VECTOR2D &controlPointA, const VECTOR2D &controlPointB, const VECTOR2D &endPoint, 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 | BitmapText (const wxString &aText, const VECTOR2I &aPosition, const EDA_ANGLE &aAngle) override |
| Draw a text using a bitmap font. | |
| void | DrawGrid () override |
| Draw the grid. | |
| void | ResizeScreen (int aWidth, int aHeight) override |
| Resizes the canvas. | |
| bool | Show (bool aShow) override |
| Shows/hides the GAL canvas. | |
| int | GetSwapInterval () const override |
| Return the swap interval. -1 for adaptive, 0 for disabled/unknown. | |
| void | Flush () override |
| Force all remaining objects to be drawn. | |
| void | ClearScreen () override |
| Clear the screen. | |
| 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 | Save () override |
| Save the context. | |
| void | Restore () override |
| Restore the context. | |
| int | BeginGroup () override |
| Begin a group. | |
| void | EndGroup () override |
| End the group. | |
| 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 | DeleteGroup (int aGroupNumber) override |
| Delete the group from the memory. | |
| void | ClearCache () override |
| Delete all data created during caching of graphic items. | |
| 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. | |
| virtual bool | HasTarget (RENDER_TARGET aTarget) override |
| Return true if the target exists. | |
| void | SetNegativeDrawMode (bool aSetting) override |
| Set negative draw mode in the renderer. | |
| void | StartDiffLayer () override |
| Begins rendering of a differential layer. | |
| void | EndDiffLayer () override |
| Ends rendering of a differential layer. | |
| void | ComputeWorldScreenMatrix () override |
| Compute the world <-> screen transformation matrix. | |
| bool | SetNativeCursorStyle (KICURSOR aCursor, bool aHiDPI) override |
| Set the cursor in the native panel. | |
| void | DrawCursor (const VECTOR2D &aCursorPosition) override |
| Draw the cursor. | |
| void | PostPaint (wxPaintEvent &aEvent) |
| Post an event to m_paintListener. | |
| void | SetMouseListener (wxEvtHandler *aMouseListener) |
| void | SetPaintListener (wxEvtHandler *aPaintListener) |
| void | EnableDepthTest (bool aEnabled=false) override |
| bool | IsContextLocked () override |
| Checks the state of the context lock. | |
| bool | IsContextValid () const override |
| Check whether the locked context is actually the current one. | |
| GAL_CONTEXT_LOSS | GetContextLoss () const override |
| Check whether a GPU reset destroyed this canvas' rendering context. | |
| bool | IsResetSettled () override |
| Check whether the driver has finished the reset that destroyed this canvas' context. | |
| void | LockContext (int aClientCookie) override |
| Use GAL_CONTEXT_LOCKER RAII object unless you know what you're doing. | |
| void | UnlockContext (int aClientCookie) override |
| 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. | |
| bool | GetScreenshot (wxImage &aDstImage) |
| virtual bool | IsCairoEngine () |
| Return true if the GAL engine is a Cairo based type. | |
| virtual bool | RefillsNonCachedTargets () const |
| Return true if the backend empties every non-cached target each frame, so VIEW must emit them again even when clean. | |
| virtual bool | HasStaticRebuildPending () const |
| 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. | |
| virtual bool | HasRetainedScene () const |
| 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. | |
| virtual void | BeginSceneLayer (int aLayer) |
| Open a cached layer of the retained scene during a rebuild. | |
| virtual void | SetSceneLayerState (int aLayer, int aOrder, bool aVisible, bool aHasNegatives) |
| Describe a cached layer to the retained scene. | |
| virtual void | SetSceneLayerDim (int aLayer, const COLOR4D &aToward, double aKeep) |
| Fade a cached layer towards a colour in the shader, so dimming it recolours none of its groups. | |
| virtual void | SetSceneLayerOverlayAlpha (int aLayer) |
| Blend a cached layer the way the other canvases blend the overlay they draw it in. | |
| virtual void | SetSceneDrawOrdered (bool aOrdered) |
| Tell the retained scene whether cached groups are placed in an order that matters. | |
| virtual void | SetGroupPlacement (int aGroup, int aLayer, double aLodScale, bool aShown, const RETAINED_GROUP_ORDER &aOrder) |
| Declare where a cached group belongs in the retained scene. | |
| virtual void | SetSceneScale (double aScale) |
| Set the view scale that group placements are tested against. | |
| virtual bool | IsDrawingMode () const |
| Return true if the GAL is inside a BeginDrawing/EndDrawing pair. | |
| virtual bool | SupportsTypedPads () const |
| Return true if DrawPad() renders every standard pad shape. | |
| virtual void | DrawTrack (const VECTOR2D &aStart, const VECTOR2D &aEnd, double aWidth, const COLOR4D &aColor) |
| Draw a filled track capsule in aColor without touching the fill and stroke state. | |
| virtual void | DrawPad (const VECTOR2D &aCenter, double aHalfWidth, double aHalfHeight, double aCornerRadius, float aShapeType, double aRotation, const COLOR4D &aColor) |
| Draw a filled pad as one primitive in aColor. | |
| void | DrawRectangle (const BOX2I &aRect) |
| const VECTOR2I & | GetScreenPixelSize () const |
| Return GAL canvas size in pixels. | |
| virtual VECTOR2I | GetLayoutPixelSize () const |
| Return the size the view is centred in and panned by. | |
| virtual void | MarkStaticDirty () |
| Make a backend that keeps a static geometry pool rebuild it on the next frame. | |
| 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. | |
| float | GetLineWidth () const |
| Get the line width. | |
| float | GetMinLineWidth () const |
| Get the minimum line width in pixels. | |
| virtual void | SetLayerDepth (double aLayerDepth) |
| Set the depth of the layer (position on the z-axis) | |
| 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 std::array< uint64_t, 2 > | GroupContentFingerprint (int aGroupNumber) const |
| virtual void | ChangeGroupUndimmed (int aGroupNumber, bool aUndimmed) |
| Exempt the group from its layer's dim, see SetSceneLayerDim(). | |
| 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 void | SetScreenSpaceMode (bool aEnabled) |
| 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. | |
| virtual bool | SupportsStrokePixelPad () const |
| Tell whether strokes can carry part of their width in pixels, see SetStrokePixelPad(). | |
| virtual bool | SupportsStrokeLengthPad () const |
| Tell whether strokes can be longer by a number of pixels, see SetStrokeLengthPad(). | |
| virtual void | SetStrokeLengthPad (double aPixels) |
| Extend every stroke drawn from now on by aPixels at each end. | |
| virtual void | SetStrokePixelPad (double aPixels) |
| Widen every stroke, circle and pad drawn from now on by aPixels. | |
| virtual bool | SupportsStrokeLevelOfDetail () const |
| Tell whether strokes can carry a level of detail, see SetStrokeLevelOfDetail(). | |
| virtual void | SetStrokeLevelOfDetail (double aLod) |
| Show every stroke drawn from now on only while the view scale is above aLod, as VIEW::IsShownAtScale() decides. | |
| virtual void | StartNegativesLayer () |
| Begins rendering in a new layer that will be copied to the main layer in EndNegativesLayer(). | |
| virtual void | EndNegativesLayer () |
| Ends rendering of a negatives layer and draws it to the main layer. | |
| 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. | |
| 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 wxSize | GetNativePixelSize () const |
| wxPoint | GetNativePosition (const wxPoint &aPoint) const |
| Convert the given point from client coordinates to native pixel coordinates. | |
| double | GetScaleFactor () const |
| Get the current scale factor. | |
| void | SetVcSettings (const KIGFX::VC_SETTINGS &aVcSettings) |
Static Public Member Functions | |
| static wxString | CheckFeatures (GAL_DISPLAY_OPTIONS &aOptions) |
| Check OpenGL features. | |
Protected Member Functions | |
| 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. | |
| 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. | |
| KIGFX::VC_SETTINGS | m_settings |
| Current VIEW_CONTROLS settings. | |
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 Types | |
| typedef GAL | super |
| Super class definition. | |
| typedef std::unordered_map< unsigned int, std::shared_ptr< VERTEX_ITEM > > | GROUPS_MAP |
Private Member Functions | |
| void | beginUpdate () override |
| Enable item update mode. | |
| void | endUpdate () override |
| Disable item update mode. | |
| bool | updatedGalDisplayOptions (const GAL_DISPLAY_OPTIONS &aOptions) override |
| Update handler for OpenGL settings. | |
| void | drawLineQuad (const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint, bool aReserve=true) |
| Draw a quad for the line. | |
| void | reserveLineQuads (const int aLineCount) |
| Reserve specified number of line quads. | |
| void | drawSemiCircle (const VECTOR2D &aCenterPoint, double aRadius, double aAngle) |
| Draw a semicircle. | |
| void | drawFilledSemiCircle (const VECTOR2D &aCenterPoint, double aRadius, double aAngle) |
| Draw a filled semicircle. | |
| void | drawStrokedSemiCircle (const VECTOR2D &aCenterPoint, double aRadius, double aAngle, bool aReserve=true) |
| Draw a stroked semicircle. | |
| void | drawCircle (const VECTOR2D &aCenterPoint, double aRadius, bool aReserve=true) |
| Internal method for circle drawing. | |
| void | drawPolyline (const std::function< VECTOR2D(int)> &aPointGetter, int aPointCount, bool aReserve=true) |
| Generic way of drawing a polyline stored in different containers. | |
| void | drawSegmentChain (const std::function< VECTOR2D(int)> &aPointGetter, int aPointCount, double aWidth, bool aReserve=true) |
| Generic way of drawing a chain of segments stored in different containers. | |
| void | drawSegment (const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint, double aWidth, bool aReserve=true) |
| Internal method for segment drawing. | |
| void | drawPolygon (GLdouble *aPoints, int aPointCount) |
| Draw a filled polygon. | |
| void | drawTriangulatedPolyset (const SHAPE_POLY_SET &aPoly, bool aStrokeTriangulation) |
| Draw a set of polygons with a cached triangulation. | |
| int | drawBitmapChar (unsigned long aChar, bool aReserve=true) |
| Draw a single character using bitmap font. | |
| void | drawBitmapOverbar (double aLength, double aHeight, bool aReserve=true) |
| Draw an overbar over the currently drawn text. | |
| void | drawGridSources () |
| Render m_gridSources priority-descending; each writes its coverage into the stencil so lower-priority sources skip that area. | |
| std::pair< VECTOR2D, float > | computeBitmapTextSize (const UTF8 &aText) const |
| Compute a size of text drawn using bitmap font with current text setting applied. | |
| void | onPaint (wxPaintEvent &aEvent) |
| This is the OnPaint event handler. | |
| void | skipMouseEvent (wxMouseEvent &aEvent) |
| Skip the mouse event to the parent. | |
| void | skipGestureEvent (wxGestureEvent &aEvent) |
| Skip the gesture event to the parent. | |
| void | onSetNativeCursor (wxSetCursorEvent &aEvent) |
| Give the correct cursor image when the native widget asks for it. | |
| void | blitCursor () |
| Blit cursor into the current screen. | |
| unsigned int | getNewGroupNumber () |
| Return a valid key that can be used as a new group number. | |
| double | getWorldPixelSize () const |
| VECTOR2D | getScreenPixelSize () const |
| void | setupShaderParameters () |
| Set up the shader parameters for OpenGL rendering. | |
| void | init () |
| Basic OpenGL initialization and feature checks. | |
| bool | detectContextReset () |
| void | orphanContextGroup () |
| Abandon the shared context group so the next canvas created starts a fresh one. | |
| double | getLayerDepth () const |
Private Attributes | |
| wxGLContext * | m_glPrivContext |
| Canvas-specific OpenGL context. | |
| int | m_swapInterval |
| Used to store swap interval information. | |
| int | m_ownContextGroupId |
| Group this canvas' contexts were created in. | |
| wxEvtHandler * | m_mouseListener |
| wxEvtHandler * | m_paintListener |
| GROUPS_MAP | m_groups |
| Stores information about VBO objects (groups) | |
| unsigned int | m_groupCounter |
| Counter used for generating keys for groups. | |
| VERTEX_MANAGER * | m_currentManager |
| Currently used VERTEX_MANAGER (for storing VERTEX_ITEMs). | |
| VERTEX_MANAGER * | m_cachedManager |
| Container for storing cached VERTEX_ITEMs. | |
| VERTEX_MANAGER * | m_nonCachedManager |
| Container for storing non-cached VERTEX_ITEMs. | |
| VERTEX_MANAGER * | m_overlayManager |
| Container for storing overlaid VERTEX_ITEMs. | |
| VERTEX_MANAGER * | m_tempManager |
| Container for storing temp (diff mode) VERTEX_ITEMs. | |
| OPENGL_COMPOSITOR * | m_compositor |
| Handles multiple rendering targets. | |
| unsigned int | m_mainBuffer |
| Main rendering target. | |
| unsigned int | m_overlayBuffer |
| Auxiliary rendering target (for menus etc.) | |
| unsigned int | m_tempBuffer |
| Temporary rendering target (for diffing etc.) | |
| RENDER_TARGET | m_currentTarget |
| Current rendering target. | |
| SHADER * | m_shader |
| There is only one shader used for different objects. | |
| bool | m_isFramebufferInitialized |
| Are the framebuffers initialized? | |
| bool | m_isBitmapFontInitialized |
| Is the shader set to use bitmap fonts? | |
| bool | m_isInitialized |
| Basic initialization flag, has to be done when the window is visible. | |
| bool | m_isGrouping |
| Was a group started? | |
| bool | m_isContextLocked |
| Used for assertion checking. | |
| bool | m_isContextValid |
| Did the last lock make us current? | |
| int | m_lockClientCookie |
| GLint | ufm_worldPixelSize |
| GLint | ufm_screenPixelSize |
| GLint | ufm_pixelSizeMultiplier |
| GLint | ufm_antialiasingOffset |
| GLint | ufm_minLinePixelWidth |
| GLint | ufm_fontTexture |
| GLint | ufm_fontTextureWidth |
| WX_CURSOR_TYPE | m_currentwxCursor |
| wx cursor showing the current native cursor. | |
| std::unique_ptr< GL_BITMAP_CACHE > | m_bitmapCache |
| GLUtesselator * | m_tesselator |
| std::deque< std::shared_ptr< GLdouble > > | m_tessIntersects |
| TEXT_ATTRIBUTES | m_attributes |
Static Private Attributes | |
| static wxGLContext * | m_glMainContext = nullptr |
| Parent OpenGL context. | |
| static int | m_instanceCounter = 0 |
| GL GAL instance counter. | |
| static int | m_contextGroupId = 0 |
| Changes each time a reset kills the shared group. | |
| static bool | m_resetBudgetExhausted = false |
| Resets came too often to keep using OpenGL. | |
| static GL_RESET_BUDGET | m_resetBudget |
| Rate of resets tolerated before falling back. | |
| static bool | m_glLoaded = false |
| GL entry points are loaded, so resets can be queried. | |
| static std::set< OPENGL_GAL * > | m_instances |
| Canvases to repaint after a reset. | |
| static bool | m_resetSettled = true |
| Driver finished the last reset. | |
| static GL_RESET_BUDGET::CLOCK::time_point | m_resetDetectedAt |
| When the last reset was detected, to stop waiting on a driver that never reports completion. | |
| static GLuint | g_fontTexture = 0 |
| Bitmap font texture handle (shared) | |
| static bool | m_isBitmapFontLoaded = false |
| Is the bitmap font texture loaded? | |
OpenGL implementation of the Graphics Abstraction Layer.
This is a direct OpenGL-implementation and uses low-level graphics primitives like triangles and quads. The purpose is to provide a fast graphics interface, that takes advantage of modern graphics card GPUs. All methods here benefit thus from the hardware acceleration.
Definition at line 68 of file opengl_gal.h.
|
private |
Definition at line 376 of file opengl_gal.h.
|
private |
Super class definition.
Definition at line 353 of file opengl_gal.h.
| OPENGL_GAL::OPENGL_GAL | ( | const KIGFX::VC_SETTINGS & | aVcSettings, |
| GAL_DISPLAY_OPTIONS & | aDisplayOptions, | ||
| wxWindow * | aParent, | ||
| wxEvtHandler * | aMouseListener = nullptr, | ||
| wxEvtHandler * | aPaintListener = nullptr, | ||
| const wxString & | aName = wxT( "GLCanvas" ) ) |
| aVcSettings | |
| aDisplayOptions | are the settings for configuring the canvas. |
| aParent | is the wxWidgets immediate wxWindow parent of this object. |
| aMouseListener | is the wxEvtHandler that should receive the mouse events, this can be can be any wxWindow, but is often a wxFrame container. |
| aPaintListener | is the wxEvtHandler that should receive the paintevent. This can be any wxWindow, but is often a derived instance of this class or a containing wxFrame. The "paint event" here is a wxCommandEvent holding EVT_GAL_REDRAW, as sent by PostPaint(). |
| aName | is the name of this window for use by wxWindow::FindWindowByName() |
Definition at line 307 of file opengl_gal.cpp.
References BLUE, GL_CONTEXT_MANAGER::CreateCtx(), KIGFX::GAL::GAL(), getGLAttribs(), PGM_BASE::GetGLContextManager(), HIDPI_GL_CANVAS::GetNativePixelSize(), HIDPI_GL_CANVAS::HIDPI_GL_CANVAS(), InitTesselatorCallbacks(), m_bitmapCache, m_cachedManager, m_compositor, m_contextGroupId, m_currentManager, m_glMainContext, m_glPrivContext, m_groupCounter, m_instanceCounter, m_instances, m_isBitmapFontInitialized, m_isContextLocked, m_isContextValid, m_isFramebufferInitialized, m_isGrouping, m_isInitialized, m_lockClientCookie, m_mainBuffer, m_mouseListener, m_nonCachedManager, KIGFX::GAL::m_options, m_overlayBuffer, m_overlayManager, m_ownContextGroupId, m_paintListener, KIGFX::GAL::m_screenSize, m_shader, m_swapInterval, m_tempBuffer, m_tempManager, m_tesselator, onPaint(), onSetNativeCursor(), Pgm(), KIGFX::GAL::SetAxesColor(), KIGFX::GAL::SetGridColor(), SetTarget(), SHADER, skipGestureEvent(), skipMouseEvent(), KIGFX::TARGET_NONCACHED, ToVECTOR2I(), ufm_antialiasingOffset, ufm_fontTexture, ufm_fontTextureWidth, ufm_minLinePixelWidth, ufm_pixelSizeMultiplier, ufm_screenPixelSize, and ufm_worldPixelSize.
Referenced by orphanContextGroup().
| OPENGL_GAL::~OPENGL_GAL | ( | ) |
Definition at line 428 of file opengl_gal.cpp.
References ClearCache(), GL_CONTEXT_MANAGER::DestroyCtx(), g_fontTexture, GetContextLoss(), PGM_BASE::GetGLContextManager(), GL_CONTEXT_MANAGER::LockCtx(), m_bitmapCache, m_cachedManager, m_compositor, m_glMainContext, m_glPrivContext, m_groups, m_instanceCounter, m_instances, m_isBitmapFontLoaded, m_isContextValid, m_isInitialized, m_nonCachedManager, m_overlayManager, m_shader, m_tempManager, m_tesselator, KIGFX::NONE, Pgm(), and GL_CONTEXT_MANAGER::UnlockCtx().
|
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().
|
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 607 of file opengl_gal.cpp.
References checkGlError(), ComputeWorldScreenMatrix(), KIGFX::OPENGL_COMPOSITOR::DIRECT_RENDERING, KIGFX::BUILTIN_FONT::font_image, g_fontTexture, KIGFX::GAL::GetMinLineWidth(), HIDPI_GL_CANVAS::GetScaleFactor(), getScreenPixelSize(), getWorldPixelSize(), init(), IsVisible(), m_cachedManager, m_compositor, KIGFX::GAL::m_depthRange, KIGFX::GAL::m_fillColor, m_isBitmapFontInitialized, m_isBitmapFontLoaded, m_isContextLocked, m_isFramebufferInitialized, m_isInitialized, m_mainBuffer, m_nonCachedManager, KIGFX::GAL::m_options, m_overlayBuffer, m_overlayManager, KIGFX::GAL::m_screenSize, m_shader, KIGFX::GAL::m_strokeColor, m_tempBuffer, m_tempManager, KIGFX::GAL::m_worldScreenMatrix, PROF_TIMER::msecs(), KIGFX::GAL::SetFillColor(), KIGFX::GAL::SetStrokeColor(), PROF_TIMER::Stop(), traceGalProfile, ufm_antialiasingOffset, ufm_fontTexture, ufm_fontTextureWidth, ufm_minLinePixelWidth, ufm_pixelSizeMultiplier, ufm_screenPixelSize, ufm_worldPixelSize, VECTOR2< T >::x, and VECTOR2< T >::y.
|
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 2654 of file opengl_gal.cpp.
References getNewGroupNumber(), m_cachedManager, m_groups, and m_isGrouping.
|
inlinevirtualinherited |
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 in KIGFX::GAL_MODERN.
Definition at line 195 of file graphics_abstraction_layer.h.
|
overrideprivatevirtual |
Enable item update mode.
Private: use GAL_UPDATE_CONTEXT RAII object
Reimplemented from KIGFX::GAL.
Definition at line 1044 of file opengl_gal.cpp.
References init(), IsVisible(), m_cachedManager, m_isContextLocked, and m_isInitialized.
|
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 2029 of file opengl_gal.cpp.
References EDA_ANGLE::AsRadians(), KIGFX::GAL::BitmapText(), computeBitmapTextSize(), drawBitmapChar(), drawBitmapOverbar(), end, KIGFX::GAL::GetGlyphSize(), KIGFX::GAL::GetHorizontalJustify(), KIGFX::GAL::GetVerticalJustify(), GR_TEXT_H_ALIGN_CENTER, GR_TEXT_H_ALIGN_INDETERMINATE, GR_TEXT_H_ALIGN_LEFT, GR_TEXT_H_ALIGN_RIGHT, GR_TEXT_V_ALIGN_BOTTOM, GR_TEXT_V_ALIGN_CENTER, GR_TEXT_V_ALIGN_INDETERMINATE, GR_TEXT_V_ALIGN_TOP, KIGFX::GAL::IsTextMirrored(), m_currentManager, KIGFX::GAL::m_globalFlipX, KIGFX::GAL::m_globalFlipY, KIGFX::GAL::m_layerDepth, KIGFX::GAL::m_strokeColor, Restore(), Save(), text, Translate(), VECTOR2< T >::x, and VECTOR2< T >::y.
|
private |
Blit cursor into the current screen.
Definition at line 3280 of file opengl_gal.cpp.
References KIGFX::COLOR4D::a, KIGFX::COLOR4D::b, KIGFX::OPENGL_COMPOSITOR::DIRECT_RENDERING, KIGFX::FULLSCREEN_CROSS, KIGFX::FULLSCREEN_DIAGONAL, KIGFX::COLOR4D::g, KIGFX::GAL::getCursorColor(), KIGFX::GAL::IsCursorEnabled(), m_compositor, KIGFX::GAL::m_crossHairMode, KIGFX::GAL::m_cursorPosition, KIGFX::GAL::m_screenSize, KIGFX::GAL::m_screenWorldMatrix, KIGFX::GAL::m_worldScale, KIGFX::COLOR4D::r, KIGFX::SMALL_CROSS, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by EndDrawing().
|
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 2682 of file opengl_gal.cpp.
References group, m_cachedManager, and m_groups.
|
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 2691 of file opengl_gal.cpp.
References group, m_cachedManager, and m_groups.
|
inlinevirtualinherited |
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 in KIGFX::GAL_MODERN.
Definition at line 827 of file graphics_abstraction_layer.h.
|
static |
Check OpenGL features.
| aOptions |
Definition at line 513 of file opengl_gal.cpp.
References dummy, KIGFX::GAL::GAL_CONTEXT_LOCKER, and init().
Referenced by EDA_DRAW_PANEL_GAL::SwitchBackend().
|
overridevirtual |
Delete all data created during caching of graphic items.
Reimplemented from KIGFX::GAL.
Definition at line 2707 of file opengl_gal.cpp.
References GetContextLoss(), m_bitmapCache, m_cachedManager, m_groups, m_isInitialized, and KIGFX::NONE.
Referenced by ~OPENGL_GAL().
|
overridevirtual |
Clear the screen.
Reimplemented from KIGFX::GAL.
Definition at line 2595 of file opengl_gal.cpp.
References KIGFX::OPENGL_COMPOSITOR::DIRECT_RENDERING, and m_compositor.
|
overridevirtual |
Clear the target for rendering.
| aTarget | is the target to be cleared. |
Reimplemented from KIGFX::GAL.
Definition at line 2743 of file opengl_gal.cpp.
References KIGFX::COLOR4D::BLACK, KIGFX::GAL::m_clearColor, m_compositor, m_mainBuffer, m_overlayBuffer, m_tempBuffer, KIGFX::TARGET_CACHED, KIGFX::TARGET_NONCACHED, KIGFX::TARGET_OVERLAY, and KIGFX::TARGET_TEMP.
Referenced by StartDiffLayer().
Compute a size of text drawn using bitmap font with current text setting applied.
| aText | is the text to be drawn. |
Definition at line 3252 of file opengl_gal.cpp.
References KIGFX::BUILTIN_FONT::ComputeBitmapTextSize().
Referenced by BitmapText().
|
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().
|
overridevirtual |
Compute the world <-> screen transformation matrix.
Reimplemented from KIGFX::GAL.
Definition at line 3577 of file opengl_gal.cpp.
References KIGFX::GAL::computeWorldScale(), KIGFX::GAL::ComputeWorldScreenMatrix(), KIGFX::GAL::m_lookAtPoint, KIGFX::GAL::m_worldScale, and round_to_half_pixel().
Referenced by BeginDrawing().
|
overridevirtual |
Delete the group from the memory.
| aGroupNumber | is the group number. |
Reimplemented from KIGFX::GAL.
Definition at line 2700 of file opengl_gal.cpp.
References m_groups.
|
private |
Definition at line 954 of file opengl_gal.cpp.
References m_glPrivContext, queryResetStatus(), and traceGalContext.
Referenced by LockContext().
|
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 1230 of file opengl_gal.cpp.
References EDA_ANGLE::AsRadians(), KIGFX::GAL::calcAngleStep(), drawLineQuad(), m_currentManager, KIGFX::GAL::m_fillColor, KIGFX::GAL::m_isFillEnabled, KIGFX::GAL::m_isStrokeEnabled, KIGFX::GAL::m_layerDepth, KIGFX::GAL::m_strokeColor, KIGFX::GAL::normalize(), reserveLineQuads(), Restore(), Save(), KIGFX::SHADER_NONE, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by drawGridSources().
|
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 1311 of file opengl_gal.cpp.
References EDA_ANGLE::AsRadians(), DrawCircle(), DrawLine(), drawLineQuad(), DrawSegment(), drawStrokedSemiCircle(), FULL_CIRCLE, GetArcToSegmentCount(), KiROUND(), m_currentManager, KIGFX::GAL::m_fillColor, KIGFX::GAL::m_isFillEnabled, KIGFX::GAL::m_isStrokeEnabled, M_PI, KIGFX::GAL::m_strokeColor, KIGFX::GAL::normalize(), reserveLineQuads(), Restore(), Save(), KIGFX::GAL::SEG_PER_CIRCLE_COUNT, KIGFX::GAL::SetLineWidth(), VECTOR2< T >::x, and VECTOR2< T >::y.
|
overridevirtual |
Draw a bitmap image.
Reimplemented from KIGFX::GAL.
Definition at line 1941 of file opengl_gal.cpp.
References EDA_ANGLE::AsDegrees(), BITMAP_BASE::GetPPI(), BITMAP_BASE::GetSizePixels(), BITMAP_BASE::IsMirroredX(), BITMAP_BASE::IsMirroredY(), m_bitmapCache, m_currentManager, KIGFX::GAL::m_layerDepth, KIGFX::GAL::m_worldUnitLength, BITMAP_BASE::Rotation(), scale, v1, v2, v3, VECTOR2< T >::x, and VECTOR2< T >::y.
|
private |
Draw a single character using bitmap font.
Its main purpose is to be used in BitmapText() function.
| aChar | is the character to be drawn. |
| aReserve | if set to false, reserve 6 vertices for each character. |
Definition at line 3150 of file opengl_gal.cpp.
References KIGFX::BUILTIN_FONT::FONT_GLYPH_TYPE::advance, KIGFX::BUILTIN_FONT::GLYPH_BOX::atlasX, KIGFX::BUILTIN_FONT::GLYPH_BOX::atlasY, KIGFX::BUILTIN_FONT::ComputeGlyphBox(), KIGFX::BUILTIN_FONT::font_image, H, KIGFX::BUILTIN_FONT::GLYPH_BOX::h, KiROUND(), KIGFX::BUILTIN_FONT::LookupGlyph(), m_currentManager, KIGFX::SHADER_FONT, KIGFX::BUILTIN_FONT::SpaceAdvance(), Translate(), KIGFX::BUILTIN_FONT::GLYPH_BOX::w, KIGFX::BUILTIN_FONT::GLYPH_BOX::x, and KIGFX::BUILTIN_FONT::GLYPH_BOX::y.
Referenced by BitmapText().
|
private |
Draw an overbar over the currently drawn text.
Its main purpose is to be used in BitmapText() function. This method requires appropriate scaling to be applied (as is done in BitmapText() function). The current X coordinate will be the overbar ending.
| aLength | is the width of the overbar. |
| aHeight | is the height for the overbar. |
| aReserve | if set to false, reserve 6 vertices for each overbar. |
Definition at line 3221 of file opengl_gal.cpp.
References H, KIGFX::BUILTIN_FONT::LookupGlyph(), m_currentManager, KIGFX::GAL::m_strokeColor, KIGFX::BUILTIN_FONT::FONT_GLYPH_TYPE::maxy, KIGFX::BUILTIN_FONT::FONT_GLYPH_TYPE::miny, Restore(), Save(), and Translate().
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 1143 of file opengl_gal.cpp.
References drawCircle().
Referenced by DrawArcSegment().
|
private |
Internal method for circle drawing.
| aCenterPoint | is the circle center point. |
| aRadius | is the circle radius. |
| aReserve | if set to false, reserve 3 vertices for each circle. |
Definition at line 1168 of file opengl_gal.cpp.
References m_currentManager, KIGFX::GAL::m_fillColor, KIGFX::GAL::m_isFillEnabled, KIGFX::GAL::m_isStrokeEnabled, KIGFX::GAL::m_layerDepth, KIGFX::GAL::m_lineWidth, KIGFX::GAL::m_strokeColor, KIGFX::SHADER_FILLED_CIRCLE, KIGFX::SHADER_STROKED_CIRCLE, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by DrawCircle(), and drawSegment().
|
overridevirtual |
Draw the cursor.
| aCursorPosition | is the cursor position in screen coordinates. |
Reimplemented from KIGFX::GAL.
Definition at line 2882 of file opengl_gal.cpp.
References KIGFX::GAL::m_cursorPosition.
|
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 1919 of file opengl_gal.cpp.
References DrawPolygon(), 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 1452 of file opengl_gal.cpp.
References EDA_ANGLE::AsRadians(), KIGFX::GAL::calcAngleStep(), drawLineQuad(), m_currentManager, KIGFX::GAL::m_fillColor, KIGFX::GAL::m_isFillEnabled, KIGFX::GAL::m_isStrokeEnabled, KIGFX::GAL::m_layerDepth, M_PI, KIGFX::GAL::m_strokeColor, reserveLineQuads(), Restore(), Save(), KIGFX::SHADER_NONE, VECTOR2< T >::x, and VECTOR2< T >::y.
|
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 1534 of file opengl_gal.cpp.
References EDA_ANGLE::AsRadians(), KIGFX::GAL::calcAngleStep(), drawLineQuad(), m_currentManager, KIGFX::GAL::m_fillColor, KIGFX::GAL::m_isFillEnabled, KIGFX::GAL::m_isStrokeEnabled, KIGFX::GAL::m_layerDepth, KIGFX::GAL::m_strokeColor, KIGFX::GAL::normalize(), reserveLineQuads(), Restore(), Save(), KIGFX::SHADER_NONE, VECTOR2< T >::x, and VECTOR2< T >::y.
|
private |
Draw a filled semicircle.
| aCenterPoint | is the center point. |
| aRadius | is the radius of the semicircle. |
| aAngle | is the angle of the semicircle. |
Definition at line 2964 of file opengl_gal.cpp.
References m_currentManager, KIGFX::GAL::m_layerDepth, Restore(), Save(), KIGFX::SHADER_FILLED_CIRCLE, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by drawSemiCircle().
|
overridevirtual |
Draw a polygon representing a font glyph.
Reimplemented from KIGFX::GAL.
Definition at line 3591 of file opengl_gal.cpp.
References DrawPolylines(), KIFONT::GLYPH::IsOutline(), KIFONT::GLYPH::IsStroke(), m_currentManager, KIGFX::GAL::m_fillColor, KIGFX::GAL::m_layerDepth, KIGFX::SHADER_NONE, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by DrawGlyphs().
|
overridevirtual |
Draw polygons representing font glyphs.
Reimplemented from KIGFX::GAL.
Definition at line 3619 of file opengl_gal.cpp.
References DrawGlyph(), drawPolyline(), SHAPE_POLY_SET::TRIANGULATED_POLYGON::GetTriangle(), SHAPE_POLY_SET::TRIANGULATED_POLYGON::GetTriangleCount(), m_currentManager, KIGFX::GAL::m_fillColor, KIGFX::GAL::m_layerDepth, reserveLineQuads(), KIGFX::SHADER_NONE, VECTOR2< T >::x, and VECTOR2< T >::y.
|
overridevirtual |
Draw the grid.
Reimplemented from KIGFX::GAL.
Definition at line 2198 of file opengl_gal.cpp.
References KIGFX::GRID_SOURCE::axesEnabled, GRID_GEOMETRY::CARTESIAN, KIGFX::GRID_SOURCE::color, drawGridSources(), DrawLine(), HIDPI_GL_CANVAS::GetScaleFactor(), KIGFX::GAL::GetVisibleGridSize(), getWorldPixelSize(), KIGFX::GAL::gridMinorLineWidth(), GRID_GEOMETRY::kind, KIGFX::GAL::m_axesColor, KIGFX::GAL::m_axesEnabled, m_compositor, KIGFX::GAL::m_gridColor, KIGFX::GAL::m_gridOrigin, KIGFX::GAL::m_gridSize, KIGFX::GAL::m_gridSources, KIGFX::GAL::m_gridStyle, KIGFX::GAL::m_gridTick, KIGFX::GAL::m_gridVisibility, m_mainBuffer, m_nonCachedManager, KIGFX::GAL::m_screenSize, KIGFX::GAL::m_screenWorldMatrix, GRID_GEOMETRY::origin, GRID_GEOMETRY::pitch, GRID_GEOMETRY::priority, KIGFX::GAL::SetLineWidth(), KIGFX::GAL::SetStrokeColor(), SetTarget(), KIGFX::GRID_SOURCE::style, KIGFX::TARGET_NONCACHED, KIGFX::GRID_SOURCE::tick, KIGFX::GRID_SOURCE::unbounded, VECTOR2< T >::x, and VECTOR2< T >::y.
|
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 |
Render m_gridSources priority-descending; each writes its coverage into the stencil so lower-priority sources skip that area.
DrawGrid pushes the global grid as a priority-0 entry for the call so both paths share this routine.
Definition at line 2248 of file opengl_gal.cpp.
References KIGFX::COLOR4D::a, KIGFX::GRID_SOURCE::axesEnabled, KIGFX::COLOR4D::b, GRID_GEOMETRY::CARTESIAN, KIGFX::COLOR4D::Darkened(), KIGFX::DOTS, DrawArc(), KIGFX::GAL::drawGridCoverageShape(), DrawLine(), GRID_GEOMETRY::extent, KIGFX::GAL::GRID_LATTICE::extent, KIGFX::COLOR4D::g, BOX2< Vec >::GetBottom(), BOX2< Vec >::GetLeft(), BOX2< Vec >::GetRight(), HIDPI_GL_CANVAS::GetScaleFactor(), BOX2< Vec >::GetTop(), getWorldPixelSize(), KIGFX::GRID_DIM_ALPHA, KIGFX::GRID_EDGE_DARKEN, KIGFX::GAL::gridLattice(), KIGFX::GAL::gridMinorLineWidth(), KIGFX::GAL::gridScreenBBox(), KIGFX::GAL::gridSourceColor(), KIGFX::GRID_SOURCE::highlighted, BOX2< Vec >::Inflate(), KIGFX::GAL::GRID_LATTICE::IsMajor(), GRID_GEOMETRY::kind, KIGFX::LINES, KIGFX::GAL::m_clearColor, KIGFX::GAL::m_gridSources, m_nonCachedManager, GRID_GEOMETRY::orientation, GRID_GEOMETRY::origin, KIGFX::GAL::GRID_LATTICE::pitch, GRID_GEOMETRY::POLAR, KIGFX::COLOR4D::r, RADIANS_T, Restore(), Rotate(), Save(), KIGFX::GAL::SetFillColor(), KIGFX::GAL::SetIsFill(), KIGFX::GAL::SetIsStroke(), KIGFX::GAL::SetLineWidth(), KIGFX::GAL::SetStrokeColor(), KIGFX::GRID_SOURCE::style, Translate(), KIGFX::GRID_SOURCE::unbounded, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by DrawGrid().
|
overridevirtual |
Draw the stored group.
| aGroupNumber | is the group number. |
Reimplemented from KIGFX::GAL.
Definition at line 2673 of file opengl_gal.cpp.
References group, m_cachedManager, and m_groups.
|
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 1149 of file opengl_gal.cpp.
References m_currentManager, KIGFX::GAL::m_fillColor, KIGFX::GAL::m_isFillEnabled, KIGFX::GAL::m_layerDepth, KIGFX::SHADER_HOLE_WALL, VECTOR2< T >::x, and VECTOR2< T >::y.
|
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 1069 of file opengl_gal.cpp.
References drawLineQuad(), m_currentManager, and KIGFX::GAL::m_strokeColor.
Referenced by DrawArcSegment(), DrawGrid(), drawGridSources(), DrawRectangle(), and drawTriangulatedPolyset().
|
private |
Draw a quad for the line.
| aStartPoint | is the start point of the line. |
| aEndPoint | is the end point of the line. |
| aReserve | if set to false, call reserveLineQuads beforehand to reserve the right amount of vertices. |
Definition at line 2892 of file opengl_gal.cpp.
References m_currentManager, KIGFX::GAL::m_layerDepth, KIGFX::GAL::m_lineWidth, reserveLineQuads(), KIGFX::SHADER_LINE_A, KIGFX::SHADER_LINE_B, KIGFX::SHADER_LINE_C, KIGFX::SHADER_LINE_D, KIGFX::SHADER_LINE_E, KIGFX::SHADER_LINE_F, v1, v2, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by DrawArc(), DrawArcSegment(), DrawEllipse(), DrawEllipseArc(), DrawLine(), drawPolyline(), and drawSegment().
|
inlinevirtualinherited |
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 in KIGFX::GAL_MODERN.
Definition at line 300 of file graphics_abstraction_layer.h.
|
overridevirtual |
Reimplemented from KIGFX::GAL.
Definition at line 1898 of file opengl_gal.cpp.
References SHAPE_LINE_CHAIN::CPoint(), drawPolygon(), KIGFX::GAL::m_layerDepth, SHAPE_LINE_CHAIN::PointCount(), SHAPE_LINE_CHAIN::SegmentCount(), VECTOR2< T >::x, and VECTOR2< T >::y.
|
overridevirtual |
Reimplemented from KIGFX::GAL.
Definition at line 1882 of file opengl_gal.cpp.
References SHAPE_POLY_SET::COutline(), DrawPolygon(), drawTriangulatedPolyset(), SHAPE_POLY_SET::IsTriangulationUpToDate(), and SHAPE_POLY_SET::OutlineCount().
|
overridevirtual |
Draw a polygon.
| aPointList | is the list of the polygon points. |
Reimplemented from KIGFX::GAL.
Definition at line 1771 of file opengl_gal.cpp.
References drawPolygon(), and KIGFX::GAL::m_layerDepth.
Referenced by DrawCurve(), and DrawPolygon().
|
overridevirtual |
Reimplemented from KIGFX::GAL.
Definition at line 1788 of file opengl_gal.cpp.
References drawPolygon(), KIGFX::GAL::m_layerDepth, VECTOR2< T >::x, and VECTOR2< T >::y.
|
private |
Draw a filled polygon.
It does not need the last point to have the same coordinates as the first one.
| aPoints | is the vertices data (3 coordinates: x, y, z). |
| aPointCount | is the number of points. |
Definition at line 3030 of file opengl_gal.cpp.
References drawPolyline(), m_currentManager, KIGFX::GAL::m_fillColor, KIGFX::GAL::m_isFillEnabled, KIGFX::GAL::m_isStrokeEnabled, m_tesselator, m_tessIntersects, and KIGFX::SHADER_NONE.
Referenced by DrawPolygon(), DrawPolygon(), and DrawPolygon().
|
overridevirtual |
Reimplemented from KIGFX::GAL.
Definition at line 1734 of file opengl_gal.cpp.
References SHAPE_LINE_CHAIN::CPoint(), drawPolyline(), SHAPE_LINE_CHAIN::IsClosed(), and SHAPE_LINE_CHAIN::PointCount().
|
overridevirtual |
Draw a polyline.
| aPointList | is a list of 2D-Vectors containing the polyline points. |
Reimplemented from KIGFX::GAL.
Definition at line 1701 of file opengl_gal.cpp.
References drawPolyline().
Referenced by DrawRectangle(), and drawTriangulatedPolyset().
|
overridevirtual |
Reimplemented from KIGFX::GAL.
Definition at line 1712 of file opengl_gal.cpp.
References drawPolyline().
|
overridevirtual |
Reimplemented from KIGFX::GAL.
Definition at line 1723 of file opengl_gal.cpp.
References drawPolyline().
|
private |
Generic way of drawing a polyline stored in different containers.
| aPointGetter | is a function to obtain coordinates of n-th vertex. |
| aPointCount | is the number of points to be drawn. |
| aReserve | if set to false, reserve aPointCount - 1 line quads. |
Definition at line 3070 of file opengl_gal.cpp.
References drawLineQuad(), end, m_currentManager, KIGFX::GAL::m_strokeColor, and reserveLineQuads().
Referenced by DrawGlyphs(), drawPolygon(), DrawPolyline(), DrawPolyline(), DrawPolyline(), DrawPolyline(), and DrawPolylines().
|
overridevirtual |
Draw multiple polylines.
| aPointLists | are lists of 2D-Vectors containing the polyline points. |
Reimplemented from KIGFX::GAL.
Definition at line 1750 of file opengl_gal.cpp.
References drawPolyline(), and reserveLineQuads().
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 1625 of file opengl_gal.cpp.
References DrawLine(), DrawPolyline(), m_currentManager, KIGFX::GAL::m_fillColor, KIGFX::GAL::m_isFillEnabled, KIGFX::GAL::m_isStrokeEnabled, KIGFX::GAL::m_layerDepth, KIGFX::GAL::m_strokeColor, KIGFX::SHADER_NONE, VECTOR2< T >::x, and VECTOR2< T >::y.
|
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 1077 of file opengl_gal.cpp.
References drawSegment().
Referenced by DrawArcSegment().
|
private |
Internal method for segment drawing.
Definition at line 1084 of file opengl_gal.cpp.
References EDA_ANGLE::AsRadians(), drawCircle(), drawLineQuad(), drawStrokedSemiCircle(), VECTOR2< T >::EuclideanNorm(), m_currentManager, KIGFX::GAL::m_fillColor, KIGFX::GAL::m_isFillEnabled, M_PI, KIGFX::GAL::m_strokeColor, Restore(), Save(), KIGFX::GAL::SetLineWidth(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by DrawSegment(), and drawSegmentChain().
|
overridevirtual |
Reimplemented from KIGFX::GAL.
Definition at line 1685 of file opengl_gal.cpp.
References SHAPE_LINE_CHAIN::CPoint(), drawSegmentChain(), SHAPE_LINE_CHAIN::IsClosed(), and SHAPE_LINE_CHAIN::PointCount().
|
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 1674 of file opengl_gal.cpp.
References drawSegmentChain().
|
private |
Generic way of drawing a chain of segments stored in different containers.
| aPointGetter | is a function to obtain coordinates of n-th vertex. |
| aPointCount | is the number of points to be drawn. |
| aWidth | is the width of the segments. |
| aReserve | if set to false, do not reserve vertices internally. |
Definition at line 3098 of file opengl_gal.cpp.
References drawSegment(), end, m_currentManager, KIGFX::GAL::m_isFillEnabled, and KIGFX::GAL::m_strokeColor.
Referenced by DrawSegmentChain(), and DrawSegmentChain().
|
private |
Draw a semicircle.
Depending on settings (m_isStrokeEnabled & isFilledEnabled) it runs the proper function (drawStrokedSemiCircle or drawFilledSemiCircle).
| aCenterPoint | is the center point. |
| aRadius | is the radius of the semicircle. |
| aAngle | is the angle of the semicircle. |
Definition at line 2947 of file opengl_gal.cpp.
References drawFilledSemiCircle(), drawStrokedSemiCircle(), m_currentManager, KIGFX::GAL::m_fillColor, KIGFX::GAL::m_isFillEnabled, KIGFX::GAL::m_isStrokeEnabled, and KIGFX::GAL::m_strokeColor.
|
private |
Draw a stroked semicircle.
| aCenterPoint | is the center point. |
| aRadius | is the radius of the semicircle. |
| aAngle | is the angle of the semicircle. |
| aReserve | if set to false, reserve 3 vertices for each semicircle. |
Definition at line 2994 of file opengl_gal.cpp.
References m_currentManager, KIGFX::GAL::m_layerDepth, KIGFX::GAL::m_lineWidth, Restore(), Save(), KIGFX::SHADER_STROKED_CIRCLE, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by DrawArcSegment(), drawSegment(), and drawSemiCircle().
|
virtualinherited |
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 in KIGFX::GAL_MODERN.
Definition at line 193 of file graphics_abstraction_layer.cpp.
References DrawSegment(), SetFillColor(), SetIsFill(), SetIsStroke(), and SetStrokeColor().
|
private |
Draw a set of polygons with a cached triangulation.
Way faster than drawPolygon.
| aPoly | is the polygon to draw. |
| aStrokeTriangulation | indicates the triangulation should be stroked rather than filled. Used for debugging. |
Definition at line 1807 of file opengl_gal.cpp.
References DrawLine(), DrawPolyline(), KIGFX::GAL::GAL_SCOPED_ATTRS, ADVANCED_CFG::GetCfg(), SHAPE_POLY_SET::TRIANGULATED_POLYGON::GetTriangleCount(), KIGFX::GAL_SCOPED_ATTRS::LAYER_DEPTH, m_currentManager, KIGFX::GAL::m_fillColor, KIGFX::GAL::m_isFillEnabled, KIGFX::GAL::m_isStrokeEnabled, KIGFX::GAL::m_layerDepth, SHAPE_POLY_SET::OutlineCount(), SHAPE_POLY_SET::Polygon(), KIGFX::GAL::SetLayerDepth(), KIGFX::GAL::SetStrokeColor(), KIGFX::SHADER_NONE, KIGFX::GAL_SCOPED_ATTRS::STROKE_COLOR, SHAPE_POLY_SET::TriangulatedPolyCount(), SHAPE_POLY_SET::TriangulatedPolygon(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by DrawPolygon().
|
overridevirtual |
Reimplemented from KIGFX::GAL.
Definition at line 3563 of file opengl_gal.cpp.
References m_cachedManager, m_nonCachedManager, and m_overlayManager.
|
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 2817 of file opengl_gal.cpp.
References m_compositor, m_currentManager, m_mainBuffer, m_tempBuffer, and traceGalXorMode.
|
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 788 of file opengl_gal.cpp.
References blitCursor(), m_cachedManager, m_compositor, m_isContextLocked, m_mainBuffer, m_nonCachedManager, m_overlayBuffer, m_overlayManager, PROF_TIMER::Start(), PROF_TIMER::Stop(), PROF_TIMER::to_string(), and traceGalProfile.
|
overridevirtual |
End the group.
Reimplemented from KIGFX::GAL.
Definition at line 2666 of file opengl_gal.cpp.
References m_cachedManager, and m_isGrouping.
|
inlinevirtualinherited |
Ends rendering of a negatives layer and draws it to the main layer.
No-op in OpenGL.
Reimplemented in KIGFX::CAIRO_GAL, and KIGFX::GAL_MODERN.
Definition at line 1120 of file graphics_abstraction_layer.h.
|
overrideprivatevirtual |
Disable item update mode.
Reimplemented from KIGFX::GAL.
Definition at line 1060 of file opengl_gal.cpp.
References m_cachedManager, and m_isInitialized.
|
overridevirtual |
Force all remaining objects to be drawn.
Reimplemented from KIGFX::GAL.
Definition at line 2589 of file opengl_gal.cpp.
|
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.
|
overridevirtual |
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 from KIGFX::GAL.
Definition at line 933 of file opengl_gal.cpp.
References m_contextGroupId, m_ownContextGroupId, m_resetBudgetExhausted, KIGFX::NONE, KIGFX::RECOVERABLE, and KIGFX::REPEATED.
Referenced by ClearCache(), IsVisible(), LockContext(), and ~OPENGL_GAL().
|
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().
|
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.
|
inlinevirtualinherited |
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 in KIGFX::GAL_MODERN.
Definition at line 503 of file graphics_abstraction_layer.h.
References m_screenSize.
Referenced by ComputeWorldScreenMatrix().
|
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().
|
virtualinherited |
Definition at line 38 of file hidpi_gl_canvas.cpp.
References GetScaleFactor().
Referenced by EDA_3D_CANVAS::DoRePaint(), EDA_3D_MODEL_VIEWER::OnMouseMove(), HIDPI_GL_3D_CANVAS::OnMouseMoveCamera(), EDA_3D_MODEL_VIEWER::OnPaint(), and KIGFX::OPENGL_GAL::OPENGL_GAL().
|
inherited |
Convert the given point from client coordinates to native pixel coordinates.
Definition at line 50 of file hidpi_gl_canvas.cpp.
References GetScaleFactor().
Referenced by EDA_3D_MODEL_VIEWER::OnMouseMove(), HIDPI_GL_3D_CANVAS::OnMouseMoveCamera(), and HIDPI_GL_3D_CANVAS::OnMouseWheelCamera().
|
private |
Return a valid key that can be used as a new group number.
Definition at line 3370 of file opengl_gal.cpp.
References m_groupCounter, and m_groups.
Referenced by BeginGroup().
|
inlineinherited |
Definition at line 926 of file graphics_abstraction_layer.h.
References m_rotation.
|
inherited |
Get the current scale factor.
Definition at line 62 of file hidpi_gl_canvas.cpp.
Referenced by KIGFX::OPENGL_GAL::BeginDrawing(), KIGFX::OPENGL_GAL::DrawGrid(), KIGFX::OPENGL_GAL::drawGridSources(), KIGFX::PREVIEW::GetConstantGlyphHeight(), GetNativePixelSize(), GetNativePosition(), KIGFX::OPENGL_GAL::getScreenPixelSize(), and KIGFX::OPENGL_GAL::ResizeScreen().
|
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().
|
private |
Definition at line 599 of file opengl_gal.cpp.
References HIDPI_GL_CANVAS::GetScaleFactor(), and KIGFX::GAL::m_screenSize.
Referenced by BeginDrawing().
| bool OPENGL_GAL::GetScreenshot | ( | wxImage & | aDstImage | ) |
Definition at line 850 of file opengl_gal.cpp.
References KIGFX::OPENGL_COMPOSITOR::DIRECT_RENDERING, KIGFX::GAL::GAL_CONTEXT_LOCKER, IsInitialized(), m_compositor, m_isContextValid, m_isInitialized, and m_mainBuffer.
|
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().
|
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().
|
inlineoverridevirtual |
Return the swap interval. -1 for adaptive, 0 for disabled/unknown.
Reimplemented from KIGFX::GAL.
Definition at line 205 of file opengl_gal.h.
References m_swapInterval.
|
overridevirtual |
Get the currently used target for rendering.
Reimplemented from KIGFX::GAL.
Definition at line 2737 of file opengl_gal.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().
|
private |
Definition at line 592 of file opengl_gal.cpp.
References std::abs(), MATRIX3x3< T >::GetScale(), KIGFX::GAL::GetScreenWorldMatrix(), VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by BeginDrawing(), DrawGrid(), and drawGridSources().
|
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().
|
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().
|
inlinevirtualinherited |
Reimplemented in KIGFX::GAL_MODERN.
Definition at line 796 of file graphics_abstraction_layer.h.
Referenced by KIGFX::sortRetainedOrder().
|
inlinevirtualinherited |
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 in KIGFX::GAL_MODERN.
Definition at line 187 of file graphics_abstraction_layer.h.
Referenced by PCB_EDIT_FRAME::redrawNetnames(), APPEARANCE_CONTROLS::setVisibleLayers(), and DS_PROXY_VIEW_ITEM::ViewDraw().
|
inlinevirtualinherited |
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 in KIGFX::GAL_MODERN.
Definition at line 179 of file graphics_abstraction_layer.h.
|
overridevirtual |
Return true if the target exists.
| aTarget | is the target to be checked. |
Reimplemented from KIGFX::GAL.
Definition at line 2778 of file opengl_gal.cpp.
References m_overlayBuffer, m_tempBuffer, KIGFX::TARGET_CACHED, KIGFX::TARGET_NONCACHED, KIGFX::TARGET_OVERLAY, and KIGFX::TARGET_TEMP.
|
private |
Basic OpenGL initialization and feature checks.
| std::runtime_error | if any of the OpenGL feature checks failed |
Definition at line 3382 of file opengl_gal.cpp.
References GL_UTILS::DetectGLBackend(), enableGlDebug(), KIGFX::BUILTIN_FONT::font_image, m_cachedManager, m_glLoaded, m_glPrivContext, m_isContextLocked, m_isInitialized, m_nonCachedManager, m_overlayManager, m_shader, m_swapInterval, m_tempManager, m_tesselator, SetOpenGLBackendInfo(), SetOpenGLInfo(), GL_UTILS::SetSwapInterval(), setupShaderParameters(), KIGFX::SHADER_TYPE_FRAGMENT, KIGFX::SHADER_TYPE_VERTEX, and traceGalContext.
Referenced by BeginDrawing(), beginUpdate(), and CheckFeatures().
|
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().
|
inlineoverridevirtual |
Checks the state of the context lock.
Reimplemented from KIGFX::GAL.
Definition at line 315 of file opengl_gal.h.
References m_isContextLocked.
|
inlineoverridevirtual |
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 from KIGFX::GAL.
Definition at line 320 of file opengl_gal.h.
References m_isContextValid.
|
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().
|
inlinevirtualinherited |
Return true if the GAL is inside a BeginDrawing/EndDrawing pair.
Reimplemented in KIGFX::GAL_MODERN.
Definition at line 248 of file graphics_abstraction_layer.h.
|
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 102 of file opengl_gal.h.
Referenced by GetScreenshot().
|
inlineoverridevirtual |
Return true if the GAL engine is a OpenGL based type.
Reimplemented from KIGFX::GAL.
Definition at line 97 of file opengl_gal.h.
|
overridevirtual |
Check whether the driver has finished the reset that destroyed this canvas' context.
Rebuilding before then can fail or hang in the driver.
Reimplemented from KIGFX::GAL.
Definition at line 998 of file opengl_gal.cpp.
References PGM_BASE::GetGLContextManager(), GL_CONTEXT_MANAGER::LockCtx(), m_glPrivContext, m_resetDetectedAt, m_resetSettled, Pgm(), queryResetStatus(), traceGalContext, and GL_CONTEXT_MANAGER::UnlockCtx().
|
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().
|
inlineoverridevirtual |
Return true if the GAL canvas is visible on the screen.
Reimplemented from KIGFX::GAL.
Definition at line 108 of file opengl_gal.h.
References GetContextLoss(), and KIGFX::NONE.
Referenced by BeginDrawing(), and beginUpdate().
|
overridevirtual |
Use GAL_CONTEXT_LOCKER RAII object unless you know what you're doing.
Reimplemented from KIGFX::GAL.
Definition at line 908 of file opengl_gal.cpp.
References detectContextReset(), GetContextLoss(), PGM_BASE::GetGLContextManager(), GL_CONTEXT_MANAGER::LockCtx(), m_glLoaded, m_glPrivContext, m_isContextLocked, m_isContextValid, m_lockClientCookie, KIGFX::NONE, orphanContextGroup(), and Pgm().
|
inlinevirtualinherited |
Make a backend that keeps a static geometry pool rebuild it on the next frame.
Reimplemented in KIGFX::GAL_MODERN.
Definition at line 512 of file graphics_abstraction_layer.h.
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().
|
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 |
This is the OnPaint event handler.
| aEvent | is the OnPaint event. |
Definition at line 3258 of file opengl_gal.cpp.
References PostPaint().
Referenced by OPENGL_GAL().
|
private |
Give the correct cursor image when the native widget asks for it.
| aEvent | is the cursor event to plac the cursor into. |
Definition at line 2872 of file opengl_gal.cpp.
References m_currentwxCursor.
Referenced by OPENGL_GAL().
|
private |
Abandon the shared context group so the next canvas created starts a fresh one.
Definition at line 966 of file opengl_gal.cpp.
References GL_CONTEXT_MANAGER::DestroyCtx(), g_fontTexture, PGM_BASE::GetGLContextManager(), m_contextGroupId, m_glMainContext, m_instances, m_isBitmapFontLoaded, m_resetBudget, m_resetBudgetExhausted, m_resetDetectedAt, m_resetSettled, OPENGL_GAL(), Pgm(), and traceGalContext.
Referenced by LockContext().
| void OPENGL_GAL::PostPaint | ( | wxPaintEvent & | aEvent | ) |
Post an event to m_paintListener.
A post is used so that the actual drawing function can use a device context type that is not specific to the wxEVT_PAINT event, just by changing the PostPaint code.
Definition at line 559 of file opengl_gal.cpp.
References m_paintListener.
Referenced by onPaint().
|
inlinevirtualinherited |
Return true if the backend empties every non-cached target each frame, so VIEW must emit them again even when clean.
Reimplemented in KIGFX::GAL_MODERN.
Definition at line 173 of file graphics_abstraction_layer.h.
|
private |
Reserve specified number of line quads.
| aLineCount | the number of line quads to reserve. |
Definition at line 2941 of file opengl_gal.cpp.
References m_currentManager.
Referenced by DrawArc(), DrawArcSegment(), DrawEllipse(), DrawEllipseArc(), DrawGlyphs(), drawLineQuad(), drawPolyline(), and DrawPolylines().
|
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 |
Resizes the canvas.
Reimplemented from KIGFX::GAL.
Definition at line 2565 of file opengl_gal.cpp.
References HIDPI_GL_CANVAS::GetScaleFactor(), m_compositor, m_isFramebufferInitialized, and KIGFX::GAL::m_screenSize.
|
overridevirtual |
Restore the context.
Reimplemented from KIGFX::GAL.
Definition at line 2648 of file opengl_gal.cpp.
References m_currentManager.
Referenced by BitmapText(), DrawArc(), DrawArcSegment(), drawBitmapOverbar(), DrawEllipse(), DrawEllipseArc(), drawFilledSemiCircle(), drawGridSources(), drawSegment(), and drawStrokedSemiCircle().
|
overridevirtual |
Rotate the context.
| aAngle | is the rotation angle in radians. |
Reimplemented from KIGFX::GAL.
Definition at line 2624 of file opengl_gal.cpp.
References m_currentManager.
Referenced by drawGridSources().
|
overridevirtual |
Save the context.
Reimplemented from KIGFX::GAL.
Definition at line 2642 of file opengl_gal.cpp.
References m_currentManager.
Referenced by BitmapText(), DrawArc(), DrawArcSegment(), drawBitmapOverbar(), DrawEllipse(), DrawEllipseArc(), drawFilledSemiCircle(), drawGridSources(), drawSegment(), and drawStrokedSemiCircle().
|
overridevirtual |
Scale the context.
| aScale | is the scale factor for the x- and y-axis. |
Reimplemented from KIGFX::GAL.
Definition at line 2636 of file opengl_gal.cpp.
References m_currentManager, VECTOR2< T >::x, and VECTOR2< T >::y.
|
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().
|
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().
|
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().
|
inlinevirtualinherited |
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 in KIGFX::GAL_MODERN.
Definition at line 241 of file graphics_abstraction_layer.h.
|
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().
|
inlinevirtualinherited |
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 in KIGFX::CAIRO_GAL_BASE, and KIGFX::GAL_MODERN.
Definition at line 666 of file graphics_abstraction_layer.h.
References m_depthRange, and m_layerDepth.
Referenced by AdvanceDepth(), KIGFX::GAL_MODERN::drawGridSource(), KIGFX::GAL_MODERN::drawGridSources(), ROUTER_PREVIEW_ITEM::drawShape(), KIGFX::OPENGL_GAL::drawTriangulatedPolyset(), GAL(), KIGFX::CAIRO_GAL_BASE::SetLayerDepth(), KIGFX::GAL_MODERN::SetLayerDepth(), EDIT_POINTS::ViewDraw(), KIGFX::PREVIEW::RULER_ITEM::ViewDraw(), KIGFX::VIEW_OVERLAY::ViewDraw(), and ROUTER_PREVIEW_ITEM::ViewDraw().
|
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().
|
overridevirtual |
Set the minimum line width in pixels.
| aLineWidth | is the minimum line width. |
Reimplemented from KIGFX::GAL.
Definition at line 775 of file opengl_gal.cpp.
References m_shader, KIGFX::GAL::SetMinLineWidth(), and ufm_minLinePixelWidth.
|
inline |
Definition at line 303 of file opengl_gal.h.
References m_mouseListener.
|
overridevirtual |
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 from KIGFX::GAL.
Definition at line 2854 of file opengl_gal.cpp.
References CURSOR_STORE::GetCursor(), KIGFX::GAL::m_currentNativeCursor, m_currentwxCursor, and KIGFX::GAL::SetNativeCursorStyle().
|
inlineoverridevirtual |
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 276 of file opengl_gal.h.
|
inline |
Definition at line 308 of file opengl_gal.h.
References m_paintListener.
|
inlineinherited |
Get/set the rotation angle (in radians).
Definition at line 925 of file graphics_abstraction_layer.h.
References m_rotation.
Referenced by GAL().
|
inlinevirtualinherited |
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 in KIGFX::GAL_MODERN.
Definition at line 231 of file graphics_abstraction_layer.h.
|
inlinevirtualinherited |
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 in KIGFX::GAL_MODERN.
Definition at line 216 of file graphics_abstraction_layer.h.
|
inlinevirtualinherited |
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 in KIGFX::GAL_MODERN.
Definition at line 224 of file graphics_abstraction_layer.h.
|
inlinevirtualinherited |
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 in KIGFX::GAL_MODERN.
Definition at line 206 of file graphics_abstraction_layer.h.
|
inlinevirtualinherited |
Set the view scale that group placements are tested against.
Reimplemented in KIGFX::GAL_MODERN.
Definition at line 245 of file graphics_abstraction_layer.h.
|
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().
|
inlinevirtualinherited |
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 in KIGFX::GAL_MODERN.
Definition at line 1061 of file graphics_abstraction_layer.h.
|
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().
|
inlinevirtualinherited |
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 in KIGFX::GAL_MODERN.
Definition at line 1073 of file graphics_abstraction_layer.h.
|
inlinevirtualinherited |
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 in KIGFX::GAL_MODERN.
Definition at line 1088 of file graphics_abstraction_layer.h.
Referenced by KIGFX::VIEW_GROUP::ViewDraw().
|
inlinevirtualinherited |
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 in KIGFX::GAL_MODERN.
Definition at line 1079 of file graphics_abstraction_layer.h.
Referenced by RATSNEST_VIEW_ITEM::ViewDraw().
|
overridevirtual |
Set the target for rendering.
| aTarget | is the new target for rendering. |
Reimplemented from KIGFX::GAL.
Definition at line 2722 of file opengl_gal.cpp.
References m_cachedManager, m_currentManager, m_currentTarget, m_nonCachedManager, m_overlayManager, m_tempManager, KIGFX::TARGET_CACHED, KIGFX::TARGET_NONCACHED, KIGFX::TARGET_OVERLAY, and KIGFX::TARGET_TEMP.
Referenced by DrawGrid(), OPENGL_GAL(), and StartDiffLayer().
|
inlineinherited |
Definition at line 723 of file graphics_abstraction_layer.h.
References m_attributes.
Referenced by ResetTextAttributes(), and KIGFX::PREVIEW::RULER_ITEM::ViewDraw().
|
private |
Set up the shader parameters for OpenGL rendering.
This method initializes all the uniform parameter locations after the shader has been linked.
Definition at line 3492 of file opengl_gal.cpp.
References m_shader, ufm_antialiasingOffset, ufm_fontTexture, ufm_fontTextureWidth, ufm_minLinePixelWidth, ufm_pixelSizeMultiplier, ufm_screenPixelSize, and ufm_worldPixelSize.
Referenced by init().
|
inlineinherited |
Definition at line 60 of file hidpi_gl_canvas.h.
References m_settings.
|
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().
|
overridevirtual |
Shows/hides the GAL canvas.
Reimplemented from KIGFX::GAL.
Definition at line 2578 of file opengl_gal.cpp.
|
private |
Skip the gesture event to the parent.
| aEvent | is the gesture event. |
Definition at line 3272 of file opengl_gal.cpp.
References m_mouseListener.
Referenced by OPENGL_GAL().
|
private |
Skip the mouse event to the parent.
| aEvent | is the mouse event. |
Definition at line 3264 of file opengl_gal.cpp.
References m_mouseListener.
Referenced by OPENGL_GAL().
|
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 2791 of file opengl_gal.cpp.
References ClearTarget(), m_compositor, m_currentManager, m_tempBuffer, SetTarget(), KIGFX::TARGET_TEMP, and traceGalXorMode.
|
inlinevirtualinherited |
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 in KIGFX::CAIRO_GAL, and KIGFX::GAL_MODERN.
Definition at line 1114 of file graphics_abstraction_layer.h.
|
inlinevirtualinherited |
Tell whether strokes can be longer by a number of pixels, see SetStrokeLengthPad().
Reimplemented in KIGFX::GAL_MODERN.
Definition at line 1067 of file graphics_abstraction_layer.h.
|
inlinevirtualinherited |
Tell whether strokes can carry a level of detail, see SetStrokeLevelOfDetail().
Reimplemented in KIGFX::GAL_MODERN.
Definition at line 1082 of file graphics_abstraction_layer.h.
Referenced by KIGFX::VIEW_GROUP::ViewDraw().
|
inlinevirtualinherited |
Tell whether strokes can carry part of their width in pixels, see SetStrokePixelPad().
Reimplemented in KIGFX::GAL_MODERN.
Definition at line 1064 of file graphics_abstraction_layer.h.
Referenced by SCH_BASE_FRAME::RefreshZoomDependentItems(), and RATSNEST_VIEW_ITEM::ViewDraw().
|
inlinevirtualinherited |
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 in KIGFX::GAL_MODERN.
Definition at line 254 of file graphics_abstraction_layer.h.
|
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.
|
overridevirtual |
Transform the context.
| aTransformation | is the transformation matrix. |
Reimplemented from KIGFX::GAL.
Definition at line 2606 of file opengl_gal.cpp.
References MATRIX3x3< T >::m_data.
|
overridevirtual |
Translate the context.
| aTranslation | is the translation vector. |
Reimplemented from KIGFX::GAL.
Definition at line 2630 of file opengl_gal.cpp.
References m_currentManager, VECTOR2< T >::x, and VECTOR2< T >::y.
Referenced by BitmapText(), drawBitmapChar(), drawBitmapOverbar(), and drawGridSources().
|
overridevirtual |
Reimplemented from KIGFX::GAL.
Definition at line 1024 of file opengl_gal.cpp.
References PGM_BASE::GetGLContextManager(), m_glPrivContext, m_isContextLocked, m_lockClientCookie, Pgm(), and GL_CONTEXT_MANAGER::UnlockCtx().
|
overrideprivatevirtual |
Update handler for OpenGL settings.
Reimplemented from KIGFX::GAL.
Definition at line 567 of file opengl_gal.cpp.
References KIGFX::GAL::GAL_CONTEXT_LOCKER, m_compositor, m_isContextValid, m_isFramebufferInitialized, KIGFX::GAL::m_options, refresh, and KIGFX::GAL::updatedGalDisplayOptions().
|
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 99 of file opengl_gal.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().
|
staticprivate |
Bitmap font texture handle (shared)
Definition at line 373 of file opengl_gal.h.
Referenced by BeginDrawing(), orphanContextGroup(), and ~OPENGL_GAL().
|
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 |
Definition at line 421 of file opengl_gal.h.
Referenced by ClearCache(), DrawBitmap(), OPENGL_GAL(), and ~OPENGL_GAL().
|
private |
Container for storing cached VERTEX_ITEMs.
Definition at line 382 of file opengl_gal.h.
Referenced by BeginDrawing(), BeginGroup(), beginUpdate(), ChangeGroupColor(), ChangeGroupDepth(), ClearCache(), DrawGroup(), EnableDepthTest(), EndDrawing(), EndGroup(), endUpdate(), init(), OPENGL_GAL(), SetTarget(), and ~OPENGL_GAL().
|
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().
|
private |
Handles multiple rendering targets.
Definition at line 390 of file opengl_gal.h.
Referenced by BeginDrawing(), blitCursor(), ClearScreen(), ClearTarget(), DrawGrid(), EndDiffLayer(), EndDrawing(), GetScreenshot(), OPENGL_GAL(), ResizeScreen(), StartDiffLayer(), updatedGalDisplayOptions(), and ~OPENGL_GAL().
|
staticprivate |
Changes each time a reset kills the shared group.
Definition at line 359 of file opengl_gal.h.
Referenced by GetContextLoss(), OPENGL_GAL(), and orphanContextGroup().
|
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 |
Currently used VERTEX_MANAGER (for storing VERTEX_ITEMs).
Definition at line 380 of file opengl_gal.h.
Referenced by BitmapText(), DrawArc(), DrawArcSegment(), DrawBitmap(), drawBitmapChar(), drawBitmapOverbar(), drawCircle(), DrawEllipse(), DrawEllipseArc(), drawFilledSemiCircle(), DrawGlyph(), DrawGlyphs(), DrawHoleWall(), DrawLine(), drawLineQuad(), drawPolygon(), drawPolyline(), DrawRectangle(), drawSegment(), drawSegmentChain(), drawSemiCircle(), drawStrokedSemiCircle(), drawTriangulatedPolyset(), EndDiffLayer(), OPENGL_GAL(), reserveLineQuads(), Restore(), Rotate(), Save(), Scale(), SetTarget(), StartDiffLayer(), and Translate().
|
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 |
Current rendering target.
Definition at line 394 of file opengl_gal.h.
Referenced by GetTarget(), and SetTarget().
|
private |
wx cursor showing the current native cursor.
Definition at line 419 of file opengl_gal.h.
Referenced by onSetNativeCursor(), and SetNativeCursorStyle().
|
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.
|
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().
|
staticprivate |
GL entry points are loaded, so resets can be queried.
Definition at line 362 of file opengl_gal.h.
Referenced by init(), and LockContext().
|
staticprivate |
Parent OpenGL context.
Definition at line 355 of file opengl_gal.h.
Referenced by OPENGL_GAL(), orphanContextGroup(), and ~OPENGL_GAL().
|
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().
|
private |
Canvas-specific OpenGL context.
Definition at line 356 of file opengl_gal.h.
Referenced by detectContextReset(), init(), IsResetSettled(), LockContext(), OPENGL_GAL(), UnlockContext(), and ~OPENGL_GAL().
|
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().
|
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().
|
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 |
Counter used for generating keys for groups.
Definition at line 379 of file opengl_gal.h.
Referenced by getNewGroupNumber(), and OPENGL_GAL().
|
private |
Stores information about VBO objects (groups)
Definition at line 378 of file opengl_gal.h.
Referenced by BeginGroup(), ChangeGroupColor(), ChangeGroupDepth(), ClearCache(), DeleteGroup(), DrawGroup(), getNewGroupNumber(), and ~OPENGL_GAL().
|
protectedinherited |
Color for hovered (active) links.
Definition at line 1581 of file graphics_abstraction_layer.h.
Referenced by DrawGlyphs(), and SetHoverColor().
|
staticprivate |
GL GAL instance counter.
Definition at line 358 of file opengl_gal.h.
Referenced by OPENGL_GAL(), and ~OPENGL_GAL().
|
staticprivate |
Canvases to repaint after a reset.
Definition at line 363 of file opengl_gal.h.
Referenced by OPENGL_GAL(), orphanContextGroup(), and ~OPENGL_GAL().
|
private |
Is the shader set to use bitmap fonts?
Definition at line 403 of file opengl_gal.h.
Referenced by BeginDrawing(), and OPENGL_GAL().
|
staticprivate |
Is the bitmap font texture loaded?
Definition at line 402 of file opengl_gal.h.
Referenced by BeginDrawing(), orphanContextGroup(), and ~OPENGL_GAL().
|
private |
Used for assertion checking.
Definition at line 407 of file opengl_gal.h.
Referenced by BeginDrawing(), beginUpdate(), EndDrawing(), init(), IsContextLocked(), LockContext(), OPENGL_GAL(), and UnlockContext().
|
private |
Did the last lock make us current?
Definition at line 408 of file opengl_gal.h.
Referenced by GetScreenshot(), IsContextValid(), LockContext(), OPENGL_GAL(), updatedGalDisplayOptions(), and ~OPENGL_GAL().
|
protectedinherited |
Is the cursor enabled?
Definition at line 1603 of file graphics_abstraction_layer.h.
Referenced by getCursorColor(), IsCursorEnabled(), and SetCursorEnabled().
|
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().
|
private |
Are the framebuffers initialized?
Definition at line 401 of file opengl_gal.h.
Referenced by BeginDrawing(), OPENGL_GAL(), ResizeScreen(), and updatedGalDisplayOptions().
|
private |
Was a group started?
Definition at line 406 of file opengl_gal.h.
Referenced by BeginGroup(), EndGroup(), and OPENGL_GAL().
|
private |
Basic initialization flag, has to be done when the window is visible.
Definition at line 404 of file opengl_gal.h.
Referenced by BeginDrawing(), beginUpdate(), ClearCache(), endUpdate(), GetScreenshot(), init(), OPENGL_GAL(), and ~OPENGL_GAL().
|
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().
|
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 |
Definition at line 409 of file opengl_gal.h.
Referenced by LockContext(), OPENGL_GAL(), and UnlockContext().
|
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().
|
private |
Main rendering target.
Definition at line 391 of file opengl_gal.h.
Referenced by BeginDrawing(), ClearTarget(), DrawGrid(), EndDiffLayer(), EndDrawing(), GetScreenshot(), and OPENGL_GAL().
|
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 370 of file opengl_gal.h.
Referenced by OPENGL_GAL(), SetMouseListener(), skipGestureEvent(), and skipMouseEvent().
|
private |
Container for storing non-cached VERTEX_ITEMs.
Definition at line 383 of file opengl_gal.h.
Referenced by BeginDrawing(), DrawGrid(), drawGridSources(), EnableDepthTest(), EndDrawing(), init(), OPENGL_GAL(), SetTarget(), and ~OPENGL_GAL().
|
protectedinherited |
Definition at line 1551 of file graphics_abstraction_layer.h.
Referenced by GAL().
|
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 |
Auxiliary rendering target (for menus etc.)
Definition at line 392 of file opengl_gal.h.
Referenced by BeginDrawing(), ClearTarget(), EndDrawing(), HasTarget(), and OPENGL_GAL().
|
private |
Container for storing overlaid VERTEX_ITEMs.
Definition at line 384 of file opengl_gal.h.
Referenced by BeginDrawing(), EnableDepthTest(), EndDrawing(), init(), OPENGL_GAL(), SetTarget(), and ~OPENGL_GAL().
|
private |
Group this canvas' contexts were created in.
Definition at line 369 of file opengl_gal.h.
Referenced by GetContextLoss(), and OPENGL_GAL().
|
private |
Definition at line 371 of file opengl_gal.h.
Referenced by OPENGL_GAL(), PostPaint(), and SetPaintListener().
|
staticprivate |
Rate of resets tolerated before falling back.
Definition at line 361 of file opengl_gal.h.
Referenced by orphanContextGroup().
|
staticprivate |
Resets came too often to keep using OpenGL.
Definition at line 360 of file opengl_gal.h.
Referenced by GetContextLoss(), and orphanContextGroup().
|
staticprivate |
When the last reset was detected, to stop waiting on a driver that never reports completion.
Definition at line 367 of file opengl_gal.h.
Referenced by IsResetSettled(), and orphanContextGroup().
|
staticprivate |
Driver finished the last reset.
Definition at line 364 of file opengl_gal.h.
Referenced by IsResetSettled(), and orphanContextGroup().
|
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().
|
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().
|
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().
|
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().
|
protectedinherited |
Current VIEW_CONTROLS settings.
Definition at line 64 of file hidpi_gl_canvas.h.
Referenced by HIDPI_GL_CANVAS(), HIDPI_GL_3D_CANVAS::OnMouseMoveCamera(), HIDPI_GL_3D_CANVAS::OnMouseWheelCamera(), and SetVcSettings().
|
private |
There is only one shader used for different objects.
Definition at line 398 of file opengl_gal.h.
Referenced by BeginDrawing(), init(), OPENGL_GAL(), SetMinLineWidth(), setupShaderParameters(), and ~OPENGL_GAL().
|
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 |
Used to store swap interval information.
Definition at line 357 of file opengl_gal.h.
Referenced by GetSwapInterval(), init(), and OPENGL_GAL().
|
private |
Temporary rendering target (for diffing etc.)
Definition at line 393 of file opengl_gal.h.
Referenced by BeginDrawing(), ClearTarget(), EndDiffLayer(), HasTarget(), OPENGL_GAL(), and StartDiffLayer().
|
private |
Container for storing temp (diff mode) VERTEX_ITEMs.
Definition at line 387 of file opengl_gal.h.
Referenced by BeginDrawing(), init(), OPENGL_GAL(), SetTarget(), and ~OPENGL_GAL().
|
private |
Definition at line 424 of file opengl_gal.h.
Referenced by drawPolygon(), init(), OPENGL_GAL(), and ~OPENGL_GAL().
|
private |
Definition at line 425 of file opengl_gal.h.
Referenced by drawPolygon().
|
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().
|
private |
Definition at line 413 of file opengl_gal.h.
Referenced by BeginDrawing(), OPENGL_GAL(), and setupShaderParameters().
|
private |
Definition at line 415 of file opengl_gal.h.
Referenced by BeginDrawing(), OPENGL_GAL(), and setupShaderParameters().
|
private |
Definition at line 416 of file opengl_gal.h.
Referenced by BeginDrawing(), OPENGL_GAL(), and setupShaderParameters().
|
private |
Definition at line 414 of file opengl_gal.h.
Referenced by BeginDrawing(), OPENGL_GAL(), SetMinLineWidth(), and setupShaderParameters().
|
private |
Definition at line 412 of file opengl_gal.h.
Referenced by BeginDrawing(), OPENGL_GAL(), and setupShaderParameters().
|
private |
Definition at line 411 of file opengl_gal.h.
Referenced by BeginDrawing(), OPENGL_GAL(), and setupShaderParameters().
|
private |
Definition at line 410 of file opengl_gal.h.
Referenced by BeginDrawing(), OPENGL_GAL(), and setupShaderParameters().