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 
307  std::vector<cairo_matrix_t> xformStack;
308 
309  void flushPath();
310  void storePath();
311 
315  virtual void blitCursor( wxMemoryDC& clientDC );
316 
318  void drawPoly( const std::deque<VECTOR2D>& aPointList );
319  void drawPoly( const VECTOR2D aPointList[], int aListSize );
320  void drawPoly( const SHAPE_LINE_CHAIN& aLineChain );
321 
327  unsigned int getNewGroupNumber();
328 
329  void syncLineWidth( bool aForceWidth = false, double aWidth = 0.0 );
331  const VECTOR2D roundp( const VECTOR2D& v );
332 
333 
335  static constexpr cairo_format_t GAL_FORMAT = CAIRO_FORMAT_ARGB32;
336 };
337 
338 
339 class CAIRO_GAL : public CAIRO_GAL_BASE, public wxWindow
340 {
341 public:
357  CAIRO_GAL( GAL_DISPLAY_OPTIONS& aDisplayOptions,
358  wxWindow* aParent, wxEvtHandler* aMouseListener = NULL,
359  wxEvtHandler* aPaintListener = NULL, const wxString& aName = wxT( "CairoCanvas" ) );
360 
361  virtual ~CAIRO_GAL();
362 
364  bool IsVisible() const override
365  {
366  return IsShownOnScreen() && !GetClientRect().IsEmpty();
367  }
368 
369  virtual void ResizeScreen( int aWidth, int aHeight ) override;
370 
371  virtual bool Show( bool aShow ) 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 char* bitmapBuffer;
424  int stride;
428 
430  virtual void beginDrawing() override;
431 
433  virtual void endDrawing() override;
434 
436  void initSurface();
437 
439  void deinitSurface();
440 
442  void allocateBitmaps();
443 
445  void deleteBitmaps();
446 
448  void setCompositor();
449 
450  // Event handlers
456  void onPaint( wxPaintEvent& aEvent );
457 
463  void skipMouseEvent( wxMouseEvent& aEvent );
464 
466  bool updatedGalDisplayOptions( const GAL_DISPLAY_OPTIONS& aOptions ) override;
467 };
468 
469 } // namespace KIGFX
470 
471 #endif // CAIROGAL_H_
virtual void SetNegativeDrawMode(bool aSetting) override
Sets negative draw mode in the renderer.
Definition: cairo_gal.cpp:908
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:1391
virtual void DrawBitmap(const BITMAP_BASE &aBitmap) override
Draw a bitmap image.
Definition: cairo_gal.cpp:448
virtual void ResizeScreen(int aWidth, int aHeight) override
Resizes the canvas.
Definition: cairo_gal.cpp:514
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:759
virtual void ChangeGroupColor(int aGroupNumber, const COLOR4D &aNewColor) override
Changes the color used to draw the group.
Definition: cairo_gal.cpp:856
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:1475
Class CAIRO_GAL is the cairo implementation of the graphics abstraction layer.
Definition: class_module.h:58
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:1188
virtual void ResizeScreen(int aWidth, int aHeight) override
Resizes the canvas.
Definition: cairo_gal.cpp:1289
void deinitSurface()
Destroy Cairo surfaces when are not needed anymore.
Definition: cairo_gal.cpp:1411
virtual void SetIsStroke(bool aIsStrokeEnabled) override
Enable/disable stroked outlines.
Definition: cairo_gal.cpp:549
virtual void EnableDepthTest(bool aEnabled=false) override
Definition: cairo_gal.cpp:920
virtual void ChangeGroupDepth(int aGroupNumber, int aDepth) override
Changes the depth (Z-axis position) of the group.
Definition: cairo_gal.cpp:874
cairo_surface_t * surface
Cairo surface.
Definition: cairo_gal.h:305
void onPaint(wxPaintEvent &aEvent)
Paint event handler.
Definition: cairo_gal.cpp:1461
std::deque< GROUP_ELEMENT > GROUP
A graphic group type definition.
Definition: cairo_gal.h:290
virtual ~CAIRO_GAL()
Definition: cairo_gal.cpp:1233
virtual void Translate(const VECTOR2D &aTranslation) override
Translate the context.
Definition: cairo_gal.cpp:663
CAIRO_GAL_BASE(GAL_DISPLAY_OPTIONS &aDisplayOptions)
Definition: cairo_gal.cpp:46
void setCompositor()
Prepare the compositor.
Definition: cairo_gal.cpp:1446
void storePath()
Store the actual path.
Definition: cairo_gal.cpp:1037
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:388
virtual void DeleteGroup(int aGroupNumber) override
Delete the group from the memory.
Definition: cairo_gal.cpp:881
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:426
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:952
bool IsVisible() const override
Definition: cairo_gal.h:364
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:619
std::vector< cairo_matrix_t > xformStack
Definition: cairo_gal.h:307
GAL super
Super class definition.
Definition: cairo_gal.h:251
bool validCompositor
Compositor initialization flag.
Definition: cairo_gal.h:413
const double angle_xform(const double aAngle)
Transform according to the rotation from currentWorld2Screen transform matrix:
Definition: cairo_gal.cpp:118
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:901
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:279
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:225
virtual void ClearScreen() override
Clear the screen.
Definition: cairo_gal.cpp:526
virtual void ClearTarget(RENDER_TARGET aTarget) override
Clears the target for rendering.
Definition: cairo_gal.cpp:1365
virtual void DrawLine(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint) override
Draw a line.
Definition: cairo_gal.cpp:187
GROUP * currentGroup
Currently used group.
Definition: cairo_gal.h:293
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:291
virtual void DrawArcSegment(const VECTOR2D &aCenterPoint, double aRadius, double aStartAngle, double aEndAngle, double aWidth) override
Draw an arc segment.
Definition: cairo_gal.cpp:331
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:96
COLOR4D backgroundColor
Background color.
Definition: cairo_gal.h:427
virtual void DrawCursor(const VECTOR2D &aCursorPosition) override
Draw the cursor.
Definition: cairo_gal.cpp:914
void drawGridPoint(const VECTOR2D &aPoint, double aSize)
Definition: cairo_gal.cpp:1002
wxEvtHandler * paintListener
Paint listener.
Definition: cairo_gal.h:418
const double xform(double x)
Definition: cairo_gal.cpp:164
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:1331
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:1467
Save the transformation matrix.
Definition: cairo_gal.h:270
virtual void SetIsFill(bool aIsFillEnabled) override
Enable/disable fill.
Definition: cairo_gal.cpp:534
const VECTOR2D roundp(const VECTOR2D &v)
Definition: cairo_gal.cpp:178
virtual void DrawArc(const VECTOR2D &aCenterPoint, double aRadius, double aStartAngle, double aEndAngle) override
Draw an arc.
Definition: cairo_gal.cpp:295
int stride
Stride value for Cairo.
Definition: cairo_gal.h:424
virtual void SetStrokeColor(const COLOR4D &aColor) override
Set the stroke color.
Definition: cairo_gal.cpp:564
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:391
virtual void beginDrawing() override
Definition: cairo_gal.cpp:1239
virtual void Restore() override
Restore the context.
Definition: cairo_gal.cpp:721
virtual bool Show(bool aShow) override
Shows/hides the GAL canvas.
Definition: cairo_gal.cpp:1306
virtual int BeginGroup() override
Begin a group.
Definition: cairo_gal.cpp:743
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:132
virtual RENDER_TARGET GetTarget() const override
Gets the currently used target for rendering.
Definition: cairo_gal.cpp:1359
Class 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:1103
cairo_matrix_t cairoWorldScreenMatrix
Cairo world to screen transformation matrix.
Definition: cairo_gal.h:300
virtual void DrawGrid() override
Definition: cairo_gal.cpp:1499
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:703
virtual void beginDrawing() override
Definition: cairo_gal.cpp:84
virtual void endDrawing() override
Definition: cairo_gal.cpp:1253
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:969
virtual void SetLineWidth(float aLineWidth) override
Set the line width.
Definition: cairo_gal.cpp:600
virtual void Scale(const VECTOR2D &aScale) override
Scale the context.
Definition: cairo_gal.cpp:683
void deleteBitmaps()
Allocate the bitmaps for drawing.
Definition: cairo_gal.cpp:1439
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:766
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:201
virtual int BeginGroup() override
Begin a group.
Definition: cairo_gal.cpp:1317
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:417
unsigned char * bitmapBuffer
Storage of the cairo image.
Definition: cairo_gal.h:423
void allocateBitmaps()
Allocate the bitmaps for drawing.
Definition: cairo_gal.cpp:1425
virtual void Transform(const MATRIX3x3D &aTransformation) override
Transform the context.
Definition: cairo_gal.cpp:626
unsigned int mainBuffer
Handle to the main buffer.
Definition: cairo_gal.h:410
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:426
wxWindow * parentWindow
Parent window.
Definition: cairo_gal.h:416
virtual void EndGroup() override
End the group.
Definition: cairo_gal.cpp:1324
virtual void Flush() override
Force all remaining objects to be drawn.
Definition: cairo_gal.cpp:520
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:1176
cairo_matrix_t currentWorld2Screen
Definition: cairo_gal.h:302
virtual void blitCursor(wxMemoryDC &clientDC)
Blits cursor into the current screen.
Definition: cairo_gal.cpp:1085
Restore the transformation matrix.
Definition: cairo_gal.h:271
virtual void SetFillColor(const COLOR4D &aColor) override
Set the fill color.
Definition: cairo_gal.cpp:582
void drawGridCross(const VECTOR2D &aPoint)
Definition: cairo_gal.cpp:982
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:644
static constexpr cairo_format_t GAL_FORMAT
Format used to store pixels.
Definition: cairo_gal.h:335
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39