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  // Geometric transforms according to the currentWorld2Screen transform matrix:
223  const double xform( double x ); // scale
224  const VECTOR2D xform( double x, double y ); // rotation, scale and offset
225  const VECTOR2D xform( const VECTOR2D& aP ); // rotation, scale and offset
226 
231  const double angle_xform( const double aAngle );
232 
238  void arc_angles_xform_and_normalize( double& aStartAngle, double& aEndAngle );
239 
241  virtual void beginDrawing() override;
242 
244  virtual void endDrawing() override;
245 
246  void resetContext();
247 
254  void drawGridLine( const VECTOR2D& aStartPoint, const VECTOR2D& aEndPoint );
255  void drawGridCross( const VECTOR2D& aPoint );
256  void drawGridPoint( const VECTOR2D& aPoint, double aSize );
257  void drawAxes( const VECTOR2D& aStartPoint, const VECTOR2D& aEndPoint );
258 
260  typedef GAL super;
261 
263  static const int MAX_CAIRO_ARGUMENTS = 4;
264 
267  {
275  //CMD_TRANSFORM, ///< Transform the actual context
282  };
283 
285  typedef struct
286  {
288  union {
289  double dblArg[MAX_CAIRO_ARGUMENTS];
290  bool boolArg;
291  int intArg;
292  } argument;
293  cairo_path_t* cairoPath;
294  } GROUP_ELEMENT;
295 
296  // Variables for the grouping function
297  bool isGrouping;
299  typedef std::deque<GROUP_ELEMENT> GROUP;
300  std::map<int, GROUP> groups;
301  unsigned int groupCounter;
303 
304  double lineWidth;
308 
309  cairo_matrix_t cairoWorldScreenMatrix;
310  cairo_matrix_t currentXform;
311  cairo_matrix_t currentWorld2Screen;
312  cairo_t* currentContext;
313  cairo_t* context;
314  cairo_surface_t* surface;
315 
316  std::vector<cairo_matrix_t> xformStack;
317 
318  void flushPath();
319  void storePath();
320 
324  virtual void blitCursor( wxMemoryDC& clientDC );
325 
327  void drawPoly( const std::deque<VECTOR2D>& aPointList );
328  void drawPoly( const VECTOR2D aPointList[], int aListSize );
329  void drawPoly( const SHAPE_LINE_CHAIN& aLineChain );
330 
336  unsigned int getNewGroupNumber();
337 
338  void syncLineWidth( bool aForceWidth = false, double aWidth = 0.0 );
340  const VECTOR2D roundp( const VECTOR2D& v );
341 
342 
344  static constexpr cairo_format_t GAL_FORMAT = CAIRO_FORMAT_RGB24;
345 };
346 
347 
348 class CAIRO_GAL : public CAIRO_GAL_BASE, public wxWindow
349 {
350 public:
366  CAIRO_GAL( GAL_DISPLAY_OPTIONS& aDisplayOptions,
367  wxWindow* aParent, wxEvtHandler* aMouseListener = NULL,
368  wxEvtHandler* aPaintListener = NULL, const wxString& aName = wxT( "CairoCanvas" ) );
369 
370  virtual ~CAIRO_GAL();
371 
373  bool IsVisible() const override
374  {
375  return IsShownOnScreen() && !GetClientRect().IsEmpty();
376  }
377 
378  virtual void ResizeScreen( int aWidth, int aHeight ) override;
379 
380  virtual bool Show( bool aShow ) override;
381 
382  virtual void SaveScreen() override;
383 
384  virtual void RestoreScreen() override;
385 
386  virtual int BeginGroup() override;
387 
388  virtual void EndGroup() override;
389 
390  virtual void SetTarget( RENDER_TARGET aTarget ) override;
391 
392  virtual RENDER_TARGET GetTarget() const override;
393 
394  virtual void ClearTarget( RENDER_TARGET aTarget ) override;
395 
401  void PostPaint()
402  {
403  if( paintListener )
404  {
405  wxPaintEvent redrawEvent;
406  wxPostEvent( paintListener, redrawEvent );
407  }
408  }
409 
410  void SetMouseListener( wxEvtHandler* aMouseListener )
411  {
412  mouseListener = aMouseListener;
413  }
414 
415  void SetPaintListener( wxEvtHandler* aPaintListener )
416  {
417  paintListener = aPaintListener;
418  }
419 
420 protected:
421  // Compositor related variables
422  std::shared_ptr<CAIRO_COMPOSITOR> compositor;
423  unsigned int mainBuffer;
424  unsigned int overlayBuffer;
427 
428  // Variables related to wxWidgets
429  wxWindow* parentWindow;
430  wxEvtHandler* mouseListener;
431  wxEvtHandler* paintListener;
432  unsigned int bufferSize;
433  unsigned char* wxOutput;
434 
435  // Variables related to Cairo <-> wxWidgets
436  unsigned int* bitmapBuffer;
437  unsigned int* bitmapBufferBackup;
438  int stride;
442 
444  virtual void beginDrawing() override;
445 
447  virtual void endDrawing() override;
448 
450  void initSurface();
451 
453  void deinitSurface();
454 
456  void allocateBitmaps();
457 
459  void deleteBitmaps();
460 
462  void setCompositor();
463 
464  // Event handlers
470  void onPaint( wxPaintEvent& aEvent );
471 
477  void skipMouseEvent( wxMouseEvent& aEvent );
478 
480  bool updatedGalDisplayOptions( const GAL_DISPLAY_OPTIONS& aOptions ) override;
481 };
482 
483 } // namespace KIGFX
484 
485 #endif // CAIROGAL_H_
virtual void SetNegativeDrawMode(bool aSetting) override
Sets negative draw mode in the renderer.
Definition: cairo_gal.cpp:895
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:1408
virtual void DrawBitmap(const BITMAP_BASE &aBitmap) override
Draw a bitmap image.
Definition: cairo_gal.cpp:435
virtual void ResizeScreen(int aWidth, int aHeight) override
Resizes the canvas.
Definition: cairo_gal.cpp:501
unsigned int groupCounter
Counter used for generating keys for groups.
Definition: cairo_gal.h:301
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:746
virtual void ChangeGroupColor(int aGroupNumber, const COLOR4D &aNewColor) override
Changes the color used to draw the group.
Definition: cairo_gal.cpp:843
bool boolArg
A bool argument.
Definition: cairo_gal.h:290
bool updatedGalDisplayOptions(const GAL_DISPLAY_OPTIONS &aOptions) override
Cairo-specific update handlers
Definition: cairo_gal.cpp:1494
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:1175
virtual void ResizeScreen(int aWidth, int aHeight) override
Resizes the canvas.
Definition: cairo_gal.cpp:1275
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:536
virtual void EnableDepthTest(bool aEnabled=false) override
Definition: cairo_gal.cpp:907
virtual void ChangeGroupDepth(int aGroupNumber, int aDepth) override
Changes the depth (Z-axis position) of the group.
Definition: cairo_gal.cpp:861
cairo_surface_t * surface
Cairo surface.
Definition: cairo_gal.h:314
void onPaint(wxPaintEvent &aEvent)
Paint event handler.
Definition: cairo_gal.cpp:1480
std::deque< GROUP_ELEMENT > GROUP
A graphic group type definition.
Definition: cairo_gal.h:299
virtual ~CAIRO_GAL()
Definition: cairo_gal.cpp:1220
virtual void Translate(const VECTOR2D &aTranslation) override
Translate the context.
Definition: cairo_gal.cpp:650
CAIRO_GAL_BASE(GAL_DISPLAY_OPTIONS &aDisplayOptions)
Definition: cairo_gal.cpp:46
void setCompositor()
Prepare the compositor.
Definition: cairo_gal.cpp:1465
void storePath()
Store the actual path.
Definition: cairo_gal.cpp:1024
Type definition for an graphics group element.
Definition: cairo_gal.h:285
void PostPaint()
Function PostPaint posts an event to m_paint_listener.
Definition: cairo_gal.h:401
virtual void DeleteGroup(int aGroupNumber) override
Delete the group from the memory.
Definition: cairo_gal.cpp:868
static const int MAX_CAIRO_ARGUMENTS
Maximum number of arguments for one command.
Definition: cairo_gal.h:263
bool isInitialized
Are Cairo image & surface ready to use.
Definition: cairo_gal.h:440
virtual void RestoreScreen() override
Restore the screen contents.
Definition: cairo_gal.cpp:1319
unsigned int overlayBuffer
Handle to the overlay buffer.
Definition: cairo_gal.h:424
void drawAxes(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
Definition: cairo_gal.cpp:939
bool IsVisible() const override
Definition: cairo_gal.h:373
Enable/disable filling.
Definition: cairo_gal.h:268
virtual void SetLayerDepth(double aLayerDepth) override
Set the depth of the layer (position on the z-axis)
Definition: cairo_gal.cpp:606
std::vector< cairo_matrix_t > xformStack
Definition: cairo_gal.h:316
GAL super
Super class definition.
Definition: cairo_gal.h:260
bool validCompositor
Compositor initialization flag.
Definition: cairo_gal.h:426
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:266
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:888
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:269
RENDER_TARGET currentTarget
Current rendering target.
Definition: cairo_gal.h:425
unsigned char * wxOutput
wxImage comaptible buffer
Definition: cairo_gal.h:433
virtual void DrawSegment(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint, double aWidth) override
Draw a rounded segment.
Definition: cairo_gal.cpp:215
virtual void ClearScreen() override
Clear the screen.
Definition: cairo_gal.cpp:513
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:177
GROUP * currentGroup
Currently used group.
Definition: cairo_gal.h:302
Class SHAPE_POLY_SET.
std::shared_ptr< CAIRO_COMPOSITOR > compositor
Object for layers compositing.
Definition: cairo_gal.h:422
virtual void endDrawing() override
Definition: cairo_gal.cpp:90
void SetPaintListener(wxEvtHandler *aPaintListener)
Definition: cairo_gal.h:415
std::map< int, GROUP > groups
List of graphic groups.
Definition: cairo_gal.h:300
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:416
virtual void DrawArcSegment(const VECTOR2D &aCenterPoint, double aRadius, double aStartAngle, double aEndAngle, double aWidth) override
Draw an arc segment.
Definition: cairo_gal.cpp:321
cairo_t * context
Cairo image.
Definition: cairo_gal.h:313
bool isGrouping
Is grouping enabled ?
Definition: cairo_gal.h:297
void updateWorldScreenMatrix()
Definition: cairo_gal.cpp:96
COLOR4D backgroundColor
Background color.
Definition: cairo_gal.h:441
virtual void DrawCursor(const VECTOR2D &aCursorPosition) override
Draw the cursor.
Definition: cairo_gal.cpp:901
void drawGridPoint(const VECTOR2D &aPoint, double aSize)
Definition: cairo_gal.cpp:989
wxEvtHandler * paintListener
Paint listener.
Definition: cairo_gal.h:431
const double xform(double x)
Definition: cairo_gal.cpp:154
cairo_path_t * cairoPath
Pointer to a Cairo path.
Definition: cairo_gal.h:293
virtual void SetTarget(RENDER_TARGET aTarget) override
Sets the target for rendering.
Definition: cairo_gal.cpp:1348
unsigned int * bitmapBuffer
Storage of the cairo image.
Definition: cairo_gal.h:436
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:1486
Save the transformation matrix.
Definition: cairo_gal.h:279
virtual void SetIsFill(bool aIsFillEnabled) override
Enable/disable fill.
Definition: cairo_gal.cpp:521
const VECTOR2D roundp(const VECTOR2D &v)
Definition: cairo_gal.cpp:168
virtual void DrawArc(const VECTOR2D &aCenterPoint, double aRadius, double aStartAngle, double aEndAngle) override
Draw an arc.
Definition: cairo_gal.cpp:285
int stride
Stride value for Cairo.
Definition: cairo_gal.h:438
virtual void SetStrokeColor(const COLOR4D &aColor) override
Set the stroke color.
Definition: cairo_gal.cpp:551
cairo_matrix_t currentXform
Definition: cairo_gal.h:310
virtual void DrawRectangle(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint) override
Draw a rectangle.
Definition: cairo_gal.cpp:381
virtual void beginDrawing() override
Definition: cairo_gal.cpp:1226
virtual void Restore() override
Restore the context.
Definition: cairo_gal.cpp:708
virtual bool Show(bool aShow) override
Shows/hides the GAL canvas.
Definition: cairo_gal.cpp:1292
unsigned int * bitmapBufferBackup
Backup storage of the cairo image.
Definition: cairo_gal.h:437
virtual int BeginGroup() override
Begin a group.
Definition: cairo_gal.cpp:730
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:1376
virtual void SaveScreen() override
Save the screen contents.
Definition: cairo_gal.cpp:1303
Class SHAPE_LINE_CHAIN.
GRAPHICS_COMMAND command
Command to execute.
Definition: cairo_gal.h:287
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:1090
cairo_matrix_t cairoWorldScreenMatrix
Cairo world to screen transformation matrix.
Definition: cairo_gal.h:309
virtual void DrawGrid() override
Definition: cairo_gal.cpp:1518
virtual void DrawPolyline(const VECTOR2D aPointList[], int aListSize) override
Definition: cairo_gal.h:103
Translate the context.
Definition: cairo_gal.h:277
virtual void Save() override
Save the context.
Definition: cairo_gal.cpp:690
virtual void beginDrawing() override
Definition: cairo_gal.cpp:84
virtual void endDrawing() override
Definition: cairo_gal.cpp:1240
void SetMouseListener(wxEvtHandler *aMouseListener)
Definition: cairo_gal.h:410
void drawGridLine(const VECTOR2D &aStartPoint, const VECTOR2D &aEndPoint)
Draw a grid line (usually a simplified line function).
Definition: cairo_gal.cpp:956
virtual void SetLineWidth(float aLineWidth) override
Set the line width.
Definition: cairo_gal.cpp:587
virtual void Scale(const VECTOR2D &aScale) override
Scale the context.
Definition: cairo_gal.cpp:670
void deleteBitmaps()
Allocate the bitmaps for drawing.
Definition: cairo_gal.cpp:1457
cairo_t * currentContext
Currently used Cairo context for drawing.
Definition: cairo_gal.h:312
virtual void DrawGroup(int aGroupNumber) override
Draw the stored group.
Definition: cairo_gal.cpp:753
unsigned int bufferSize
Size of buffers cairoOutput, bitmapBuffers.
Definition: cairo_gal.h:432
void syncLineWidth(bool aForceWidth=false, double aWidth=0.0)
Definition: cairo_gal.cpp:191
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:298
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:430
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:613
unsigned int mainBuffer
Handle to the main buffer.
Definition: cairo_gal.h:423
wxWindow * parentWindow
Parent window.
Definition: cairo_gal.h:429
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:507
virtual void DrawPolygon(const VECTOR2D aPointList[], int aListSize) override
Definition: cairo_gal.h:108
Enable/disable stroking.
Definition: cairo_gal.h:269
unsigned int getNewGroupNumber()
Returns a valid key that can be used as a new group number.
Definition: cairo_gal.cpp:1163
cairo_matrix_t currentWorld2Screen
Definition: cairo_gal.h:311
virtual void blitCursor(wxMemoryDC &clientDC)
Blits cursor into the current screen.
Definition: cairo_gal.cpp:1072
Restore the transformation matrix.
Definition: cairo_gal.h:280
virtual void SetFillColor(const COLOR4D &aColor) override
Set the fill color.
Definition: cairo_gal.cpp:569
void drawGridCross(const VECTOR2D &aPoint)
Definition: cairo_gal.cpp:969
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:631
static constexpr cairo_format_t GAL_FORMAT
Format used to store pixels.
Definition: cairo_gal.h:344
Class COLOR4D is the color representation with 4 components: red, green, blue, alpha.
Definition: color4d.h:39