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 
42 #if defined(__WXMSW__)
43 #define SCREEN_DEPTH 24
44 #else
45 #if wxCHECK_VERSION( 2, 9, 0 )
46 #define SCREEN_DEPTH wxBITMAP_SCREEN_DEPTH
47 #else
48 #define SCREEN_DEPTH 32
49 #endif
50 #endif
51 
64 namespace KIGFX
65 {
66 class CAIRO_COMPOSITOR;
67 
68 class CAIRO_GAL_BASE : public GAL
69 {
70 public:
71  CAIRO_GAL_BASE( GAL_DISPLAY_OPTIONS& aDisplayOptions );
72 
73  virtual ~CAIRO_GAL_BASE();
74 
75  virtual bool IsCairoEngine() override { return true; }
76 
77  // ---------------
78  // Drawing methods
79  // ---------------
80 
82  virtual void DrawLine( const VECTOR2D& aStartPoint, const VECTOR2D& aEndPoint ) override;
83 
85  virtual void DrawSegment( const VECTOR2D& aStartPoint, const VECTOR2D& aEndPoint, double aWidth ) override;
86 
88  virtual void DrawCircle( const VECTOR2D& aCenterPoint, double aRadius ) override;
89 
91  virtual void DrawArc( const VECTOR2D& aCenterPoint, double aRadius,
92  double aStartAngle, double aEndAngle ) override;
93 
95  virtual void DrawArcSegment( const VECTOR2D& aCenterPoint, double aRadius,
96  double aStartAngle, double aEndAngle, double aWidth ) override;
97 
99  virtual void DrawRectangle( const VECTOR2D& aStartPoint, const VECTOR2D& aEndPoint ) override;
100 
102  virtual void DrawPolyline( const std::deque<VECTOR2D>& aPointList ) override { drawPoly( aPointList ); }
103  virtual void DrawPolyline( const VECTOR2D aPointList[], int aListSize ) override { drawPoly( aPointList, aListSize ); }
104  virtual void DrawPolyline( const SHAPE_LINE_CHAIN& aLineChain ) override { drawPoly( aLineChain ); }
105 
107  virtual void DrawPolygon( const std::deque<VECTOR2D>& aPointList ) override { drawPoly( aPointList ); }
108  virtual void DrawPolygon( const VECTOR2D aPointList[], int aListSize ) override { drawPoly( aPointList, aListSize ); }
109  virtual void DrawPolygon( const SHAPE_POLY_SET& aPolySet ) override;
110  virtual void DrawPolygon( const SHAPE_LINE_CHAIN& aPolySet ) override;
111 
113  virtual void DrawCurve( const VECTOR2D& startPoint, const VECTOR2D& controlPointA,
114  const VECTOR2D& controlPointB, const VECTOR2D& endPoint ) override;
115 
117  virtual void DrawBitmap( const BITMAP_BASE& aBitmap ) override;
118 
119  // --------------
120  // Screen methods
121  // --------------
122 
124  virtual void ResizeScreen( int aWidth, int aHeight ) override;
125 
127  virtual void Flush() override;
128 
130  virtual void ClearScreen() override;
131 
132  // -----------------
133  // Attribute setting
134  // -----------------
135 
137  virtual void SetIsFill( bool aIsFillEnabled ) override;
138 
140  virtual void SetIsStroke( bool aIsStrokeEnabled ) override;
141 
143  virtual void SetStrokeColor( const COLOR4D& aColor ) override;
144 
146  virtual void SetFillColor( const COLOR4D& aColor ) override;
147 
149  virtual void SetLineWidth( float aLineWidth ) override;
150 
152  virtual void SetLayerDepth( double aLayerDepth ) override;
153 
154  // --------------
155  // Transformation
156  // --------------
157 
159  virtual void Transform( const MATRIX3x3D& aTransformation ) override;
160 
162  virtual void Rotate( double aAngle ) override;
163 
165  virtual void Translate( const VECTOR2D& aTranslation ) override;
166 
168  virtual void Scale( const VECTOR2D& aScale ) override;
169 
171  virtual void Save() override;
172 
174  virtual void Restore() override;
175 
176  // --------------------------------------------
177  // Group methods
178  // ---------------------------------------------
179 
181  virtual int BeginGroup() override;
182 
184  virtual void EndGroup() override;
185 
187  virtual void DrawGroup( int aGroupNumber ) override;
188 
190  virtual void ChangeGroupColor( int aGroupNumber, const COLOR4D& aNewColor ) override;
191 
193  virtual void ChangeGroupDepth( int aGroupNumber, int aDepth ) override;
194 
196  virtual void DeleteGroup( int aGroupNumber ) override;
197 
199  virtual void ClearCache() override;
200 
201  // --------------------------------------------------------
202  // Handling the world <-> screen transformation
203  // --------------------------------------------------------
204 
206  virtual void SetNegativeDrawMode( bool aSetting ) override;
207 
208  // -------
209  // Cursor
210  // -------
211 
213  virtual void DrawCursor( const VECTOR2D& aCursorPosition ) override;
214 
215  virtual void EnableDepthTest( bool aEnabled = false ) override;
216 
218  virtual void DrawGrid() override;
219 
220 
221 protected:
222  const double xform( double x );
223  const VECTOR2D xform( double x, double y );
224  const VECTOR2D xform( const VECTOR2D& aP );
225  const double angle_xform( const double aAngle );
226 
228  virtual void beginDrawing() override;
229 
231  virtual void endDrawing() override;
232 
233  void resetContext();
234 
241  void drawGridLine( const VECTOR2D& aStartPoint, const VECTOR2D& aEndPoint );
242  void drawGridCross( const VECTOR2D& aPoint );
243  void drawGridPoint( const VECTOR2D& aPoint, double aSize );
244  void drawAxes( const VECTOR2D& aStartPoint, const VECTOR2D& aEndPoint );
245 
247  typedef GAL super;
248 
250  static const int MAX_CAIRO_ARGUMENTS = 4;
251 
254  {
262  //CMD_TRANSFORM, ///< Transform the actual context
269  };
270 
272  typedef struct
273  {
275  union {
276  double dblArg[MAX_CAIRO_ARGUMENTS];
277  bool boolArg;
278  int intArg;
279  } argument;
280  cairo_path_t* cairoPath;
281  } GROUP_ELEMENT;
282 
283  // Variables for the grouping function
284  bool isGrouping;
286  typedef std::deque<GROUP_ELEMENT> GROUP;
287  std::map<int, GROUP> groups;
288  unsigned int groupCounter;
290 
291  double lineWidth;
295 
296  cairo_matrix_t cairoWorldScreenMatrix;
297  cairo_matrix_t currentXform;
298  cairo_matrix_t currentWorld2Screen;
299  cairo_t* currentContext;
300  cairo_t* context;
301  cairo_surface_t* surface;
302 
303  std::vector<cairo_matrix_t> xformStack;
304 
305  void flushPath();
306  void storePath();
307 
311  virtual void blitCursor( wxMemoryDC& clientDC );
312 
314  void drawPoly( const std::deque<VECTOR2D>& aPointList );
315  void drawPoly( const VECTOR2D aPointList[], int aListSize );
316  void drawPoly( const SHAPE_LINE_CHAIN& aLineChain );
317 
323  unsigned int getNewGroupNumber();
324 
325  void syncLineWidth( bool aForceWidth = false, double aWidth = 0.0 );
327  const VECTOR2D roundp( const VECTOR2D& v );
328 
329 
331  static constexpr cairo_format_t GAL_FORMAT = CAIRO_FORMAT_RGB24;
332 };
333 
334 
335 class CAIRO_GAL : public CAIRO_GAL_BASE, public wxWindow
336 {
337 public:
353  CAIRO_GAL( GAL_DISPLAY_OPTIONS& aDisplayOptions,
354  wxWindow* aParent, wxEvtHandler* aMouseListener = NULL,
355  wxEvtHandler* aPaintListener = NULL, const wxString& aName = wxT( "CairoCanvas" ) );
356 
357  virtual ~CAIRO_GAL();
358 
360  bool IsVisible() const override
361  {
362  return IsShownOnScreen() && !GetClientRect().IsEmpty();
363  }
364 
365  virtual void ResizeScreen( int aWidth, int aHeight ) override;
366 
367  virtual bool Show( bool aShow ) override;
368 
369  virtual void SaveScreen() override;
370 
371  virtual void RestoreScreen() override;
372 
373  virtual int BeginGroup() override;
374 
375  virtual void EndGroup() override;
376 
377  virtual void SetTarget( RENDER_TARGET aTarget ) override;
378 
379  virtual RENDER_TARGET GetTarget() const override;
380 
381  virtual void ClearTarget( RENDER_TARGET aTarget ) override;
382 
388  void PostPaint()
389  {
390  if( paintListener )
391  {
392  wxPaintEvent redrawEvent;
393  wxPostEvent( paintListener, redrawEvent );
394  }
395  }
396 
397  void SetMouseListener( wxEvtHandler* aMouseListener )
398  {
399  mouseListener = aMouseListener;
400  }
401 
402  void SetPaintListener( wxEvtHandler* aPaintListener )
403  {
404  paintListener = aPaintListener;
405  }
406 
407 protected:
408  // Compositor related variables
409  std::shared_ptr<CAIRO_COMPOSITOR> compositor;
410  unsigned int mainBuffer;
411  unsigned int overlayBuffer;
414 
415  // Variables related to wxWidgets
416  wxWindow* parentWindow;
417  wxEvtHandler* mouseListener;
418  wxEvtHandler* paintListener;
419  unsigned int bufferSize;
420  unsigned char* wxOutput;
421 
422  // Variables related to Cairo <-> wxWidgets
423  unsigned int* bitmapBuffer;
424  unsigned int* bitmapBufferBackup;
425  int stride;
429 
431  virtual void beginDrawing() override;
432 
434  virtual void endDrawing() override;
435 
437  void initSurface();
438 
440  void deinitSurface();
441 
443  void allocateBitmaps();
444 
446  void deleteBitmaps();
447 
449  void setCompositor();
450 
451  // Event handlers
457  void onPaint( wxPaintEvent& aEvent );
458 
464  void skipMouseEvent( wxMouseEvent& aEvent );
465 
467  bool updatedGalDisplayOptions( const GAL_DISPLAY_OPTIONS& aOptions ) override;
468 };
469 
470 } // namespace KIGFX
471 
472 #endif // CAIROGAL_H_
virtual void SetNegativeDrawMode(bool aSetting) override
Sets negative draw mode in the renderer.
Definition: cairo_gal.cpp:860
virtual void DrawPolyline(const SHAPE_LINE_CHAIN &aLineChain) override
Definition: cairo_gal.h:104
void initSurface()
Prepare Cairo surfaces for drawing.
Definition: cairo_gal.cpp:1373
virtual void DrawBitmap(const BITMAP_BASE &aBitmap) override
Draw a bitmap image.
Definition: cairo_gal.cpp:401
virtual void ResizeScreen(int aWidth, int aHeight) override
Resizes the canvas.
Definition: cairo_gal.cpp:466
unsigned int groupCounter
Counter used for generating keys for groups.
Definition: cairo_gal.h:288
virtual void DrawPolyline(const std::deque< VECTOR2D > &aPointList) override
Draw a polyline.
Definition: cairo_gal.h:102
virtual void EndGroup() override
End the group.
Definition: cairo_gal.cpp:711
virtual void ChangeGroupColor(int aGroupNumber, const COLOR4D &aNewColor) override
Changes the color used to draw the group.
Definition: cairo_gal.cpp:808
bool boolArg
A bool argument.
Definition: cairo_gal.h:277
bool updatedGalDisplayOptions(const GAL_DISPLAY_OPTIONS &aOptions) override
Cairo-specific update handlers
Definition: cairo_gal.cpp:1459
Class CAIRO_GAL is the cairo implementation of the graphics abstraction layer.
Definition: class_module.h:57
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:1140
virtual void ResizeScreen(int aWidth, int aHeight) override
Resizes the canvas.
Definition: cairo_gal.cpp:1240
void deinitSurface()
Destroy Cairo surfaces when are not needed anymore.
Definition: cairo_gal.cpp:1393
virtual void SetIsStroke(bool aIsStrokeEnabled) override
Enable/disable stroked outlines.
Definition: cairo_gal.cpp:501
virtual void EnableDepthTest(bool aEnabled=false) override
Definition: cairo_gal.cpp:872
virtual void ChangeGroupDepth(int aGroupNumber, int aDepth) override
Changes the depth (Z-axis position) of the group.
Definition: cairo_gal.cpp:826
cairo_surface_t * surface
Cairo surface.
Definition: cairo_gal.h:301
void onPaint(wxPaintEvent &aEvent)
Paint event handler.
Definition: cairo_gal.cpp:1445
std::deque< GROUP_ELEMENT > GROUP
A graphic group type definition.
Definition: cairo_gal.h:286
virtual ~CAIRO_GAL()
Definition: cairo_gal.cpp:1185
virtual void Translate(const VECTOR2D &aTranslation) override
Translate the context.
Definition: cairo_gal.cpp:615
CAIRO_GAL_BASE(GAL_DISPLAY_OPTIONS &aDisplayOptions)
Definition: cairo_gal.cpp:46
void setCompositor()
Prepare the compositor.
Definition: cairo_gal.cpp:1430
void storePath()
Store the actual path.
Definition: cairo_gal.cpp:989
Type definition for an graphics group element.
Definition: cairo_gal.h:272
void PostPaint()
Function PostPaint posts an event to m_paint_listener.
Definition: cairo_gal.h:388
virtual void DeleteGroup(int aGroupNumber) override
Delete the group from the memory.
Definition: cairo_gal.cpp:833
static const int MAX_CAIRO_ARGUMENTS
Maximum number of arguments for one command.
Definition: cairo_gal.h:250
bool isInitialized
Are Cairo image & surface ready to use.
Definition: cairo_gal.h:427
virtual void RestoreScreen() override
Restore the screen contents.
Definition: cairo_gal.cpp:1284
unsigned int overlayBuffer
Handle to the overlay buffer.
Definition: cairo_gal.h:411
void drawAxes(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
Definition: cairo_gal.cpp:904
bool IsVisible() const override
Definition: cairo_gal.h:360
Enable/disable filling.
Definition: cairo_gal.h:255
virtual void SetLayerDepth(double aLayerDepth) override
Set the depth of the layer (position on the z-axis)
Definition: cairo_gal.cpp:571
std::vector< cairo_matrix_t > xformStack
Definition: cairo_gal.h:303
GAL super
Super class definition.
Definition: cairo_gal.h:247
bool validCompositor
Compositor initialization flag.
Definition: cairo_gal.h:413
const double angle_xform(const double aAngle)
Definition: cairo_gal.cpp:118
GRAPHICS_COMMAND
Definitions for the command recorder.
Definition: cairo_gal.h:253
This class handle bitmap images in KiCad.
Definition: bitmap_base.h:46
virtual void ClearCache() override
Delete all data created during caching of graphic items.
Definition: cairo_gal.cpp:853
virtual bool IsCairoEngine() override
Returns true if the GAL engine is a cairo based type.
Definition: cairo_gal.h:75
virtual void DrawCircle(const VECTOR2D &aCenterPoint, double aRadius) override
Draw a circle using world coordinates.
Definition: cairo_gal.cpp:241
RENDER_TARGET currentTarget
Current rendering target.
Definition: cairo_gal.h:412
unsigned char * wxOutput
wxImage comaptible buffer
Definition: cairo_gal.h:420
virtual void DrawSegment(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint, double aWidth) override
Draw a rounded segment.
Definition: cairo_gal.cpp:187
virtual void ClearScreen() override
Clear the screen.
Definition: cairo_gal.cpp:478
virtual void ClearTarget(RENDER_TARGET aTarget) override
Clears the target for rendering.
Definition: cairo_gal.cpp:1347
virtual void DrawLine(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint) override
Draw a line.
Definition: cairo_gal.cpp:149
GROUP * currentGroup
Currently used group.
Definition: cairo_gal.h:289
Class SHAPE_POLY_SET.
std::shared_ptr< CAIRO_COMPOSITOR > compositor
Object for layers compositing.
Definition: cairo_gal.h:409
virtual void endDrawing() override
Definition: cairo_gal.cpp:90
void SetPaintListener(wxEvtHandler *aPaintListener)
Definition: cairo_gal.h:402
std::map< int, GROUP > groups
List of graphic groups.
Definition: cairo_gal.h:287
virtual void DrawCurve(const VECTOR2D &startPoint, const VECTOR2D &controlPointA, const VECTOR2D &controlPointB, const VECTOR2D &endPoint) override
Draw a cubic bezier spline.
Definition: cairo_gal.cpp:382
virtual void DrawArcSegment(const VECTOR2D &aCenterPoint, double aRadius, double aStartAngle, double aEndAngle, double aWidth) override
Draw an arc segment.
Definition: cairo_gal.cpp:291
cairo_t * context
Cairo image.
Definition: cairo_gal.h:300
bool isGrouping
Is grouping enabled ?
Definition: cairo_gal.h:284
void updateWorldScreenMatrix()
Definition: cairo_gal.cpp:96
COLOR4D backgroundColor
Background color.
Definition: cairo_gal.h:428
virtual void DrawCursor(const VECTOR2D &aCursorPosition) override
Draw the cursor.
Definition: cairo_gal.cpp:866
void drawGridPoint(const VECTOR2D &aPoint, double aSize)
Definition: cairo_gal.cpp:954
wxEvtHandler * paintListener
Paint listener.
Definition: cairo_gal.h:418
const double xform(double x)
Definition: cairo_gal.cpp:126
cairo_path_t * cairoPath
Pointer to a Cairo path.
Definition: cairo_gal.h:280
virtual void SetTarget(RENDER_TARGET aTarget) override
Sets the target for rendering.
Definition: cairo_gal.cpp:1313
unsigned int * bitmapBuffer
Storage of the cairo image.
Definition: cairo_gal.h:423
virtual ~CAIRO_GAL_BASE()
Definition: cairo_gal.cpp:72
void skipMouseEvent(wxMouseEvent &aEvent)
Mouse event handler, forwards the event to the child.
Definition: cairo_gal.cpp:1451
Save the transformation matrix.
Definition: cairo_gal.h:266
virtual void SetIsFill(bool aIsFillEnabled) override
Enable/disable fill.
Definition: cairo_gal.cpp:486
const VECTOR2D roundp(const VECTOR2D &v)
Definition: cairo_gal.cpp:140
virtual void DrawArc(const VECTOR2D &aCenterPoint, double aRadius, double aStartAngle, double aEndAngle) override
Draw an arc.
Definition: cairo_gal.cpp:256
int stride
Stride value for Cairo.
Definition: cairo_gal.h:425
virtual void SetStrokeColor(const COLOR4D &aColor) override
Set the stroke color.
Definition: cairo_gal.cpp:516
cairo_matrix_t currentXform
Definition: cairo_gal.h:297
virtual void DrawRectangle(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint) override
Draw a rectangle.
Definition: cairo_gal.cpp:347
virtual void beginDrawing() override
Definition: cairo_gal.cpp:1191
virtual void Restore() override
Restore the context.
Definition: cairo_gal.cpp:673
virtual bool Show(bool aShow) override
Shows/hides the GAL canvas.
Definition: cairo_gal.cpp:1257
unsigned int * bitmapBufferBackup
Backup storage of the cairo image.
Definition: cairo_gal.h:424
virtual int BeginGroup() override
Begin a group.
Definition: cairo_gal.cpp:695
virtual RENDER_TARGET GetTarget() const override
Gets the currently used target for rendering.
Definition: cairo_gal.cpp:1341
virtual void SaveScreen() override
Save the screen contents.
Definition: cairo_gal.cpp:1268
Class SHAPE_LINE_CHAIN.
GRAPHICS_COMMAND command
Command to execute.
Definition: cairo_gal.h:274
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:1055
cairo_matrix_t cairoWorldScreenMatrix
Cairo world to screen transformation matrix.
Definition: cairo_gal.h:296
virtual void DrawGrid() override
Definition: cairo_gal.cpp:1483
virtual void DrawPolyline(const VECTOR2D aPointList[], int aListSize) override
Definition: cairo_gal.h:103
Translate the context.
Definition: cairo_gal.h:264
virtual void Save() override
Save the context.
Definition: cairo_gal.cpp:655
virtual void beginDrawing() override
Definition: cairo_gal.cpp:84
virtual void endDrawing() override
Definition: cairo_gal.cpp:1205
void SetMouseListener(wxEvtHandler *aMouseListener)
Definition: cairo_gal.h:397
void drawGridLine(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
Draw a grid line (usually a simplified line function).
Definition: cairo_gal.cpp:921
virtual void SetLineWidth(float aLineWidth) override
Set the line width.
Definition: cairo_gal.cpp:552
virtual void Scale(const VECTOR2D &aScale) override
Scale the context.
Definition: cairo_gal.cpp:635
void deleteBitmaps()
Allocate the bitmaps for drawing.
Definition: cairo_gal.cpp:1422
cairo_t * currentContext
Currently used Cairo context for drawing.
Definition: cairo_gal.h:299
virtual void DrawGroup(int aGroupNumber) override
Draw the stored group.
Definition: cairo_gal.cpp:718
unsigned int bufferSize
Size of buffers cairoOutput, bitmapBuffers.
Definition: cairo_gal.h:419
void syncLineWidth(bool aForceWidth=false, double aWidth=0.0)
Definition: cairo_gal.cpp:163
virtual int BeginGroup() override
Begin a group.
Definition: cairo_gal.cpp:1299
RENDER_TARGET
RENDER_TARGET: Possible rendering targets.
Definition: definitions.h:46
bool isElementAdded
Was an graphic element added ?
Definition: cairo_gal.h:285
virtual void DrawPolygon(const std::deque< VECTOR2D > &aPointList) override
Draw a polygon.
Definition: cairo_gal.h:107
wxEvtHandler * mouseListener
Mouse listener.
Definition: cairo_gal.h:417
void allocateBitmaps()
Allocate the bitmaps for drawing.
Definition: cairo_gal.cpp:1407
virtual void Transform(const MATRIX3x3D &aTransformation) override
Transform the context.
Definition: cairo_gal.cpp:578
unsigned int mainBuffer
Handle to the main buffer.
Definition: cairo_gal.h:410
wxWindow * parentWindow
Parent window.
Definition: cairo_gal.h:416
virtual void EndGroup() override
End the group.
Definition: cairo_gal.cpp:1306
virtual void Flush() override
Force all remaining objects to be drawn.
Definition: cairo_gal.cpp:472
virtual void DrawPolygon(const VECTOR2D aPointList[], int aListSize) override
Definition: cairo_gal.h:108
Enable/disable stroking.
Definition: cairo_gal.h:256
unsigned int getNewGroupNumber()
Returns a valid key that can be used as a new group number.
Definition: cairo_gal.cpp:1128
cairo_matrix_t currentWorld2Screen
Definition: cairo_gal.h:298
virtual void blitCursor(wxMemoryDC &clientDC)
Blits cursor into the current screen.
Definition: cairo_gal.cpp:1037
Restore the transformation matrix.
Definition: cairo_gal.h:267
virtual void SetFillColor(const COLOR4D &aColor) override
Set the fill color.
Definition: cairo_gal.cpp:534
void drawGridCross(const VECTOR2D &aPoint)
Definition: cairo_gal.cpp:934
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:596
static constexpr cairo_format_t GAL_FORMAT
Format used to store pixels.
Definition: cairo_gal.h:331
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39