KiCad PCB EDA Suite
cairo_gal.h
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KICAD, a free EDA CAD application.
3  *
4  * Copyright (C) 2012 Torsten Hueter, torstenhtr <at> gmx.de
5  * Copyright (C) 2012-2019 Kicad Developers, see change_log.txt for contributors.
6  * Copyright (C) 2017-2018 CERN
7  * @author Maciej Suminski <maciej.suminski@cern.ch>
8  *
9  * CairoGal - Graphics Abstraction Layer for Cairo
10  *
11  * This program is free software; you can redistribute it and/or
12  * modify it under the terms of the GNU General Public License
13  * as published by the Free Software Foundation; either version 2
14  * of the License, or (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program; if not, you may find one here:
23  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
24  * or you may search the http://www.gnu.org website for the version 2 license,
25  * or you may write to the Free Software Foundation, Inc.,
26  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
27  */
28 
29 #ifndef CAIROGAL_H_
30 #define CAIROGAL_H_
31 
32 #include <map>
33 #include <iterator>
34 
35 #include <cairo.h>
36 
38 #include <wx/dcbuffer.h>
39 
40 #include <memory>
41 
54 namespace KIGFX
55 {
56 class CAIRO_COMPOSITOR;
57 
58 class CAIRO_GAL_BASE : public GAL
59 {
60 public:
61  CAIRO_GAL_BASE( GAL_DISPLAY_OPTIONS& aDisplayOptions );
62 
63  virtual ~CAIRO_GAL_BASE();
64 
65  virtual bool IsCairoEngine() override { return true; }
66 
67  // ---------------
68  // Drawing methods
69  // ---------------
70 
72  virtual void DrawLine( const VECTOR2D& aStartPoint, const VECTOR2D& aEndPoint ) override;
73 
75  virtual void DrawSegment( const VECTOR2D& aStartPoint, const VECTOR2D& aEndPoint, double aWidth ) override;
76 
78  virtual void DrawCircle( const VECTOR2D& aCenterPoint, double aRadius ) override;
79 
81  virtual void DrawArc( const VECTOR2D& aCenterPoint, double aRadius,
82  double aStartAngle, double aEndAngle ) override;
83 
85  virtual void DrawArcSegment( const VECTOR2D& aCenterPoint, double aRadius,
86  double aStartAngle, double aEndAngle, double aWidth ) override;
87 
89  virtual void DrawRectangle( const VECTOR2D& aStartPoint, const VECTOR2D& aEndPoint ) override;
90 
92  virtual void DrawPolyline( const std::deque<VECTOR2D>& aPointList ) override { drawPoly( aPointList ); }
93  virtual void DrawPolyline( const VECTOR2D aPointList[], int aListSize ) override { drawPoly( aPointList, aListSize ); }
94  virtual void DrawPolyline( const SHAPE_LINE_CHAIN& aLineChain ) override { drawPoly( aLineChain ); }
95 
97  virtual void DrawPolygon( const std::deque<VECTOR2D>& aPointList ) override { drawPoly( aPointList ); }
98  virtual void DrawPolygon( const VECTOR2D aPointList[], int aListSize ) override { drawPoly( aPointList, aListSize ); }
99  virtual void DrawPolygon( const SHAPE_POLY_SET& aPolySet ) override;
100  virtual void DrawPolygon( const SHAPE_LINE_CHAIN& aPolySet ) override;
101 
103  virtual void DrawCurve( const VECTOR2D& startPoint, const VECTOR2D& controlPointA,
104  const VECTOR2D& controlPointB, const VECTOR2D& endPoint,
105  double aFilterValue = 0.0 ) override;
106 
108  virtual void DrawBitmap( const BITMAP_BASE& aBitmap ) override;
109 
110  // --------------
111  // Screen methods
112  // --------------
113 
115  virtual void ResizeScreen( int aWidth, int aHeight ) override;
116 
118  virtual void Flush() override;
119 
121  virtual void ClearScreen() override;
122 
123  // -----------------
124  // Attribute setting
125  // -----------------
126 
128  virtual void SetIsFill( bool aIsFillEnabled ) override;
129 
131  virtual void SetIsStroke( bool aIsStrokeEnabled ) override;
132 
134  virtual void SetStrokeColor( const COLOR4D& aColor ) override;
135 
137  virtual void SetFillColor( const COLOR4D& aColor ) override;
138 
140  virtual void SetLineWidth( float aLineWidth ) override;
141 
143  virtual void SetLayerDepth( double aLayerDepth ) override;
144 
145  // --------------
146  // Transformation
147  // --------------
148 
150  virtual void Transform( const MATRIX3x3D& aTransformation ) override;
151 
153  virtual void Rotate( double aAngle ) override;
154 
156  virtual void Translate( const VECTOR2D& aTranslation ) override;
157 
159  virtual void Scale( const VECTOR2D& aScale ) override;
160 
162  virtual void Save() override;
163 
165  virtual void Restore() override;
166 
167  // --------------------------------------------
168  // Group methods
169  // ---------------------------------------------
170 
172  virtual int BeginGroup() override;
173 
175  virtual void EndGroup() override;
176 
178  virtual void DrawGroup( int aGroupNumber ) override;
179 
181  virtual void ChangeGroupColor( int aGroupNumber, const COLOR4D& aNewColor ) override;
182 
184  virtual void ChangeGroupDepth( int aGroupNumber, int aDepth ) override;
185 
187  virtual void DeleteGroup( int aGroupNumber ) override;
188 
190  virtual void ClearCache() override;
191 
192  // --------------------------------------------------------
193  // Handling the world <-> screen transformation
194  // --------------------------------------------------------
195 
197  virtual void SetNegativeDrawMode( bool aSetting ) override;
198 
199  // -------
200  // Cursor
201  // -------
202 
204  virtual void DrawCursor( const VECTOR2D& aCursorPosition ) override;
205 
206  virtual void EnableDepthTest( bool aEnabled = false ) override;
207 
209  virtual void DrawGrid() override;
210 
211 
212 protected:
213  // Geometric transforms according to the currentWorld2Screen transform matrix:
214  const double xform( double x ); // scale
215  const VECTOR2D xform( double x, double y ); // rotation, scale and offset
216  const VECTOR2D xform( const VECTOR2D& aP ); // rotation, scale and offset
217 
222  const double angle_xform( const double aAngle );
223 
229  void arc_angles_xform_and_normalize( double& aStartAngle, double& aEndAngle );
230 
232  virtual void beginDrawing() override;
233 
235  virtual void endDrawing() override;
236 
237  void resetContext();
238 
245  void drawGridLine( const VECTOR2D& aStartPoint, const VECTOR2D& aEndPoint );
246  void drawGridCross( const VECTOR2D& aPoint );
247  void drawGridPoint( const VECTOR2D& aPoint, double aSize );
248  void drawAxes( const VECTOR2D& aStartPoint, const VECTOR2D& aEndPoint );
249 
251  typedef GAL super;
252 
254  static const int MAX_CAIRO_ARGUMENTS = 4;
255 
258  {
266  //CMD_TRANSFORM, ///< Transform the actual context
273  };
274 
276  typedef struct
277  {
279  union {
280  double dblArg[MAX_CAIRO_ARGUMENTS];
281  bool boolArg;
282  int intArg;
283  } argument;
284  cairo_path_t* cairoPath;
285  } GROUP_ELEMENT;
286 
287  // Variables for the grouping function
288  bool isGrouping;
290  typedef std::deque<GROUP_ELEMENT> GROUP;
291  std::map<int, GROUP> groups;
292  unsigned int groupCounter;
294 
295  double lineWidth;
299 
300  cairo_matrix_t cairoWorldScreenMatrix;
301  cairo_matrix_t currentXform;
302  cairo_matrix_t currentWorld2Screen;
303  cairo_t* currentContext;
304  cairo_t* context;
305  cairo_surface_t* surface;
306 
308  std::vector<cairo_surface_t*> imageSurfaces;
309 
310  std::vector<cairo_matrix_t> xformStack;
311 
312  void flushPath();
313  void storePath();
314 
318  virtual void blitCursor( wxMemoryDC& clientDC );
319 
321  void drawPoly( const std::deque<VECTOR2D>& aPointList );
322  void drawPoly( const VECTOR2D aPointList[], int aListSize );
323  void drawPoly( const SHAPE_LINE_CHAIN& aLineChain );
324 
330  unsigned int getNewGroupNumber();
331 
332  void syncLineWidth( bool aForceWidth = false, double aWidth = 0.0 );
334  const VECTOR2D roundp( const VECTOR2D& v );
335 
336 
338  static constexpr cairo_format_t GAL_FORMAT = CAIRO_FORMAT_ARGB32;
339 };
340 
341 
342 class CAIRO_GAL : public CAIRO_GAL_BASE, public wxWindow
343 {
344 public:
360  CAIRO_GAL( GAL_DISPLAY_OPTIONS& aDisplayOptions,
361  wxWindow* aParent, wxEvtHandler* aMouseListener = NULL,
362  wxEvtHandler* aPaintListener = NULL, const wxString& aName = wxT( "CairoCanvas" ) );
363 
364  virtual ~CAIRO_GAL();
365 
367  bool IsVisible() const override
368  {
369  return IsShownOnScreen() && !GetClientRect().IsEmpty();
370  }
371 
372  virtual void ResizeScreen( int aWidth, int aHeight ) override;
373 
374  virtual bool Show( bool aShow ) override;
375 
376  virtual int BeginGroup() override;
377 
378  virtual void EndGroup() override;
379 
380  virtual void SetTarget( RENDER_TARGET aTarget ) override;
381 
382  virtual RENDER_TARGET GetTarget() const override;
383 
384  virtual void ClearTarget( RENDER_TARGET aTarget ) override;
385 
391  void PostPaint()
392  {
393  if( paintListener )
394  {
395  wxPaintEvent redrawEvent;
396  wxPostEvent( paintListener, redrawEvent );
397  }
398  }
399 
400  void SetMouseListener( wxEvtHandler* aMouseListener )
401  {
402  mouseListener = aMouseListener;
403  }
404 
405  void SetPaintListener( wxEvtHandler* aPaintListener )
406  {
407  paintListener = aPaintListener;
408  }
409 
410 protected:
411  // Compositor related variables
412  std::shared_ptr<CAIRO_COMPOSITOR> compositor;
413  unsigned int mainBuffer;
414  unsigned int overlayBuffer;
417 
418  // Variables related to wxWidgets
419  wxWindow* parentWindow;
420  wxEvtHandler* mouseListener;
421  wxEvtHandler* paintListener;
422  unsigned int bufferSize;
423  unsigned char* wxOutput;
424 
425  // Variables related to Cairo <-> wxWidgets
426  unsigned char* bitmapBuffer;
427  int stride;
431 
433  virtual void beginDrawing() override;
434 
436  virtual void endDrawing() override;
437 
439  void initSurface();
440 
442  void deinitSurface();
443 
445  void allocateBitmaps();
446 
448  void deleteBitmaps();
449 
451  void setCompositor();
452 
453  // Event handlers
459  void onPaint( wxPaintEvent& aEvent );
460 
466  void skipMouseEvent( wxMouseEvent& aEvent );
467 
469  bool updatedGalDisplayOptions( const GAL_DISPLAY_OPTIONS& aOptions ) override;
470 };
471 
472 } // namespace KIGFX
473 
474 #endif // CAIROGAL_H_
virtual void SetNegativeDrawMode(bool aSetting) override
Sets negative draw mode in the renderer.
Definition: cairo_gal.cpp:918
virtual void DrawPolyline(const SHAPE_LINE_CHAIN &aLineChain) override
Definition: cairo_gal.h:94
void initSurface()
Prepare Cairo surfaces for drawing.
Definition: cairo_gal.cpp:1408
virtual void DrawBitmap(const BITMAP_BASE &aBitmap) override
Draw a bitmap image.
Definition: cairo_gal.cpp:456
virtual void ResizeScreen(int aWidth, int aHeight) override
Resizes the canvas.
Definition: cairo_gal.cpp:524
unsigned int groupCounter
Counter used for generating keys for groups.
Definition: cairo_gal.h:292
virtual void DrawPolyline(const std::deque< VECTOR2D > &aPointList) override
Draw a polyline.
Definition: cairo_gal.h:92
virtual void EndGroup() override
End the group.
Definition: cairo_gal.cpp:769
virtual void ChangeGroupColor(int aGroupNumber, const COLOR4D &aNewColor) override
Changes the color used to draw the group.
Definition: cairo_gal.cpp:866
bool boolArg
A bool argument.
Definition: cairo_gal.h:281
bool updatedGalDisplayOptions(const GAL_DISPLAY_OPTIONS &aOptions) override
Cairo-specific update handlers
Definition: cairo_gal.cpp:1492
Class CAIRO_GAL is the cairo implementation of the graphics abstraction layer.
Definition: color4d.cpp:175
CAIRO_GAL(GAL_DISPLAY_OPTIONS &aDisplayOptions, wxWindow *aParent, wxEvtHandler *aMouseListener=NULL, wxEvtHandler *aPaintListener=NULL, const wxString &aName=wxT("CairoCanvas"))
Constructor CAIRO_GAL_BASE.
Definition: cairo_gal.cpp:1203
virtual void ResizeScreen(int aWidth, int aHeight) override
Resizes the canvas.
Definition: cairo_gal.cpp:1306
void deinitSurface()
Destroy Cairo surfaces when are not needed anymore.
Definition: cairo_gal.cpp:1428
virtual void SetIsStroke(bool aIsStrokeEnabled) override
Enable/disable stroked outlines.
Definition: cairo_gal.cpp:559
virtual void EnableDepthTest(bool aEnabled=false) override
Definition: cairo_gal.cpp:930
virtual void ChangeGroupDepth(int aGroupNumber, int aDepth) override
Changes the depth (Z-axis position) of the group.
Definition: cairo_gal.cpp:884
cairo_surface_t * surface
Cairo surface.
Definition: cairo_gal.h:305
void onPaint(wxPaintEvent &aEvent)
Paint event handler.
Definition: cairo_gal.cpp:1478
std::deque< GROUP_ELEMENT > GROUP
A graphic group type definition.
Definition: cairo_gal.h:290
virtual ~CAIRO_GAL()
Definition: cairo_gal.cpp:1248
virtual void Translate(const VECTOR2D &aTranslation) override
Translate the context.
Definition: cairo_gal.cpp:673
CAIRO_GAL_BASE(GAL_DISPLAY_OPTIONS &aDisplayOptions)
Definition: cairo_gal.cpp:47
void setCompositor()
Prepare the compositor.
Definition: cairo_gal.cpp:1463
void storePath()
Store the actual path.
Definition: cairo_gal.cpp:1052
Type definition for an graphics group element.
Definition: cairo_gal.h:276
void PostPaint()
Function PostPaint posts an event to m_paint_listener.
Definition: cairo_gal.h:391
virtual void DeleteGroup(int aGroupNumber) override
Delete the group from the memory.
Definition: cairo_gal.cpp:891
static const int MAX_CAIRO_ARGUMENTS
Maximum number of arguments for one command.
Definition: cairo_gal.h:254
bool isInitialized
Are Cairo image & surface ready to use.
Definition: cairo_gal.h:429
unsigned int overlayBuffer
Handle to the overlay buffer.
Definition: cairo_gal.h:414
void drawAxes(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
Definition: cairo_gal.cpp:967
bool IsVisible() const override
Definition: cairo_gal.h:367
Enable/disable filling.
Definition: cairo_gal.h:259
virtual void SetLayerDepth(double aLayerDepth) override
Set the depth of the layer (position on the z-axis)
Definition: cairo_gal.cpp:629
std::vector< cairo_matrix_t > xformStack
Definition: cairo_gal.h:310
GAL super
Super class definition.
Definition: cairo_gal.h:251
bool validCompositor
Compositor initialization flag.
Definition: cairo_gal.h:416
const double angle_xform(const double aAngle)
Transform according to the rotation from currentWorld2Screen transform matrix:
Definition: cairo_gal.cpp:126
GRAPHICS_COMMAND
Definitions for the command recorder.
Definition: cairo_gal.h:257
This class handle bitmap images in KiCad.
Definition: bitmap_base.h:51
virtual void ClearCache() override
Delete all data created during caching of graphic items.
Definition: cairo_gal.cpp:911
virtual bool IsCairoEngine() override
Returns true if the GAL engine is a cairo based type.
Definition: cairo_gal.h:65
virtual void DrawCircle(const VECTOR2D &aCenterPoint, double aRadius) override
Draw a circle using world coordinates.
Definition: cairo_gal.cpp:287
RENDER_TARGET currentTarget
Current rendering target.
Definition: cairo_gal.h:415
unsigned char * wxOutput
wxImage comaptible buffer
Definition: cairo_gal.h:423
virtual void DrawSegment(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint, double aWidth) override
Draw a rounded segment.
Definition: cairo_gal.cpp:233
virtual void ClearScreen() override
Clear the screen.
Definition: cairo_gal.cpp:536
virtual void ClearTarget(RENDER_TARGET aTarget) override
Clears the target for rendering.
Definition: cairo_gal.cpp:1382
virtual void DrawLine(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint) override
Draw a line.
Definition: cairo_gal.cpp:195
#define NULL
GROUP * currentGroup
Currently used group.
Definition: cairo_gal.h:293
std::vector< cairo_surface_t * > imageSurfaces
List of surfaces that were created by painting images, to be cleaned up later.
Definition: cairo_gal.h:308
SHAPE_POLY_SET.
std::shared_ptr< CAIRO_COMPOSITOR > compositor
Object for layers compositing.
Definition: cairo_gal.h:412
virtual void endDrawing() override
Definition: cairo_gal.cpp:98
void SetPaintListener(wxEvtHandler *aPaintListener)
Definition: cairo_gal.h:405
std::map< int, GROUP > groups
List of graphic groups.
Definition: cairo_gal.h:291
virtual void DrawArcSegment(const VECTOR2D &aCenterPoint, double aRadius, double aStartAngle, double aEndAngle, double aWidth) override
Draw an arc segment.
Definition: cairo_gal.cpp:339
cairo_t * context
Cairo image.
Definition: cairo_gal.h:304
bool isGrouping
Is grouping enabled ?
Definition: cairo_gal.h:288
void updateWorldScreenMatrix()
Definition: cairo_gal.cpp:104
COLOR4D backgroundColor
Background color.
Definition: cairo_gal.h:430
virtual void DrawCursor(const VECTOR2D &aCursorPosition) override
Draw the cursor.
Definition: cairo_gal.cpp:924
void drawGridPoint(const VECTOR2D &aPoint, double aSize)
Definition: cairo_gal.cpp:1017
wxEvtHandler * paintListener
Paint listener.
Definition: cairo_gal.h:421
const double xform(double x)
Definition: cairo_gal.cpp:172
cairo_path_t * cairoPath
Pointer to a Cairo path.
Definition: cairo_gal.h:284
virtual void SetTarget(RENDER_TARGET aTarget) override
Sets the target for rendering.
Definition: cairo_gal.cpp:1348
virtual ~CAIRO_GAL_BASE()
Definition: cairo_gal.cpp:77
void skipMouseEvent(wxMouseEvent &aEvent)
Mouse event handler, forwards the event to the child.
Definition: cairo_gal.cpp:1484
Save the transformation matrix.
Definition: cairo_gal.h:270
virtual void SetIsFill(bool aIsFillEnabled) override
Enable/disable fill.
Definition: cairo_gal.cpp:544
const VECTOR2D roundp(const VECTOR2D &v)
Definition: cairo_gal.cpp:186
virtual void DrawArc(const VECTOR2D &aCenterPoint, double aRadius, double aStartAngle, double aEndAngle) override
Draw an arc.
Definition: cairo_gal.cpp:303
int stride
Stride value for Cairo.
Definition: cairo_gal.h:427
virtual void SetStrokeColor(const COLOR4D &aColor) override
Set the stroke color.
Definition: cairo_gal.cpp:574
cairo_matrix_t currentXform
Definition: cairo_gal.h:301
virtual void DrawRectangle(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint) override
Draw a rectangle.
Definition: cairo_gal.cpp:399
virtual void beginDrawing() override
Definition: cairo_gal.cpp:1254
virtual void Restore() override
Restore the context.
Definition: cairo_gal.cpp:731
virtual bool Show(bool aShow) override
Shows/hides the GAL canvas.
Definition: cairo_gal.cpp:1323
virtual int BeginGroup() override
Begin a group.
Definition: cairo_gal.cpp:753
void arc_angles_xform_and_normalize(double &aStartAngle, double &aEndAngle)
Transform according to the rotation from currentWorld2Screen transform matrix for the start angle and...
Definition: cairo_gal.cpp:140
virtual RENDER_TARGET GetTarget() const override
Gets the currently used target for rendering.
Definition: cairo_gal.cpp:1376
SHAPE_LINE_CHAIN.
GRAPHICS_COMMAND command
Command to execute.
Definition: cairo_gal.h:278
void drawPoly(const std::deque< VECTOR2D > &aPointList)
Drawing polygons & polylines is the same in cairo, so here is the common code.
Definition: cairo_gal.cpp:1118
cairo_matrix_t cairoWorldScreenMatrix
Cairo world to screen transformation matrix.
Definition: cairo_gal.h:300
virtual void DrawGrid() override
Definition: cairo_gal.cpp:1516
virtual void DrawPolyline(const VECTOR2D aPointList[], int aListSize) override
Definition: cairo_gal.h:93
Translate the context.
Definition: cairo_gal.h:268
virtual void Save() override
Save the context.
Definition: cairo_gal.cpp:713
virtual void beginDrawing() override
Definition: cairo_gal.cpp:92
virtual void endDrawing() override
Definition: cairo_gal.cpp:1268
void SetMouseListener(wxEvtHandler *aMouseListener)
Definition: cairo_gal.h:400
void drawGridLine(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
Draw a grid line (usually a simplified line function).
Definition: cairo_gal.cpp:984
virtual void SetLineWidth(float aLineWidth) override
Set the line width.
Definition: cairo_gal.cpp:610
virtual void Scale(const VECTOR2D &aScale) override
Scale the context.
Definition: cairo_gal.cpp:693
void deleteBitmaps()
Allocate the bitmaps for drawing.
Definition: cairo_gal.cpp:1456
cairo_t * currentContext
Currently used Cairo context for drawing.
Definition: cairo_gal.h:303
virtual void DrawGroup(int aGroupNumber) override
Draw the stored group.
Definition: cairo_gal.cpp:776
unsigned int bufferSize
Size of buffers cairoOutput, bitmapBuffers.
Definition: cairo_gal.h:422
void syncLineWidth(bool aForceWidth=false, double aWidth=0.0)
Definition: cairo_gal.cpp:209
virtual int BeginGroup() override
Begin a group.
Definition: cairo_gal.cpp:1334
RENDER_TARGET
RENDER_TARGET: Possible rendering targets.
Definition: definitions.h:46
bool isElementAdded
Was an graphic element added ?
Definition: cairo_gal.h:289
virtual void DrawPolygon(const std::deque< VECTOR2D > &aPointList) override
Draw a polygon.
Definition: cairo_gal.h:97
wxEvtHandler * mouseListener
Mouse listener.
Definition: cairo_gal.h:420
unsigned char * bitmapBuffer
Storage of the cairo image.
Definition: cairo_gal.h:426
void allocateBitmaps()
Allocate the bitmaps for drawing.
Definition: cairo_gal.cpp:1442
virtual void Transform(const MATRIX3x3D &aTransformation) override
Transform the context.
Definition: cairo_gal.cpp:636
unsigned int mainBuffer
Handle to the main buffer.
Definition: cairo_gal.h:413
virtual void DrawCurve(const VECTOR2D &startPoint, const VECTOR2D &controlPointA, const VECTOR2D &controlPointB, const VECTOR2D &endPoint, double aFilterValue=0.0) override
Draw a cubic bezier spline.
Definition: cairo_gal.cpp:434
wxWindow * parentWindow
Parent window.
Definition: cairo_gal.h:419
virtual void EndGroup() override
End the group.
Definition: cairo_gal.cpp:1341
virtual void Flush() override
Force all remaining objects to be drawn.
Definition: cairo_gal.cpp:530
virtual void DrawPolygon(const VECTOR2D aPointList[], int aListSize) override
Definition: cairo_gal.h:98
Enable/disable stroking.
Definition: cairo_gal.h:260
unsigned int getNewGroupNumber()
Returns a valid key that can be used as a new group number.
Definition: cairo_gal.cpp:1191
cairo_matrix_t currentWorld2Screen
Definition: cairo_gal.h:302
virtual void blitCursor(wxMemoryDC &clientDC)
Blits cursor into the current screen.
Definition: cairo_gal.cpp:1100
Restore the transformation matrix.
Definition: cairo_gal.h:271
virtual void SetFillColor(const COLOR4D &aColor) override
Set the fill color.
Definition: cairo_gal.cpp:592
void drawGridCross(const VECTOR2D &aPoint)
Definition: cairo_gal.cpp:997
Class GAL is the abstract interface for drawing on a 2D-surface.
virtual void Rotate(double aAngle) override
Rotate the context.
Definition: cairo_gal.cpp:654
static constexpr cairo_format_t GAL_FORMAT
Format used to store pixels.
Definition: cairo_gal.h:338
COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:99