Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
SkAutoCanvasMatrixPaint Class Reference

#include <SkCanvasPriv.h>

Inheritance diagram for SkAutoCanvasMatrixPaint:
SkNoncopyable

Public Member Functions

 SkAutoCanvasMatrixPaint (SkCanvas *, const SkMatrix *, const SkPaint *, const SkRect &bounds)
 
 ~SkAutoCanvasMatrixPaint ()
 

Detailed Description

Definition at line 32 of file SkCanvasPriv.h.

Constructor & Destructor Documentation

◆ SkAutoCanvasMatrixPaint()

SkAutoCanvasMatrixPaint::SkAutoCanvasMatrixPaint ( SkCanvas canvas,
const SkMatrix matrix,
const SkPaint paint,
const SkRect bounds 
)

Definition at line 31 of file SkCanvasPriv.cpp.

33 : fCanvas(canvas)
34 , fSaveCount(canvas->getSaveCount()) {
35 if (paint) {
36 SkRect newBounds = bounds;
37 if (matrix) {
38 matrix->mapRect(&newBounds);
39 }
40 canvas->saveLayer(&newBounds, paint);
41 } else if (matrix) {
42 canvas->save();
43 }
44
45 if (matrix) {
46 canvas->concat(*matrix);
47 }
48}
int saveLayer(const SkRect *bounds, const SkPaint *paint)
Definition: SkCanvas.cpp:496
int getSaveCount() const
Definition: SkCanvas.cpp:431
int save()
Definition: SkCanvas.cpp:447
void concat(const SkMatrix &matrix)
Definition: SkCanvas.cpp:1318
const Paint & paint
Definition: color_source.cc:38
unsigned useCenter Optional< SkMatrix > matrix
Definition: SkRecords.h:258
Optional< SkRect > bounds
Definition: SkRecords.h:189

◆ ~SkAutoCanvasMatrixPaint()

SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint ( )

Definition at line 50 of file SkCanvasPriv.cpp.

50 {
51 fCanvas->restoreToCount(fSaveCount);
52}
void restoreToCount(int saveCount)
Definition: SkCanvas.cpp:478

The documentation for this class was generated from the following files: