Flutter Engine
The Flutter Engine
SkNWayCanvas.h
Go to the documentation of this file.
1
2/*
3 * Copyright 2011 Google Inc.
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
8
9#ifndef SkNWayCanvas_DEFINED
10#define SkNWayCanvas_DEFINED
11
14#include "include/core/SkM44.h"
21
22#include <cstddef>
23
24namespace sktext {
25class GlyphRunList;
26}
27
28class SkCanvas;
29class SkData;
30class SkDrawable;
31class SkImage;
32class SkMatrix;
33class SkPaint;
34class SkPath;
35class SkPicture;
36class SkRRect;
37class SkRegion;
38class SkShader;
39class SkTextBlob;
40class SkVertices;
41enum class SkBlendMode;
42enum class SkClipOp;
43struct SkDrawShadowRec;
44struct SkPoint;
45struct SkRSXform;
46struct SkRect;
47
48namespace sktext::gpu { class Slug; }
49
50class SK_API SkNWayCanvas : public SkCanvasVirtualEnforcer<SkNoDrawCanvas> {
51public:
52 SkNWayCanvas(int width, int height);
53 ~SkNWayCanvas() override;
54
55 virtual void addCanvas(SkCanvas*);
56 virtual void removeCanvas(SkCanvas*);
57 virtual void removeAll();
58
59protected:
61
62 void willSave() override;
63 SaveLayerStrategy getSaveLayerStrategy(const SaveLayerRec&) override;
64 bool onDoSaveBehind(const SkRect*) override;
65 void willRestore() override;
66
67 void didConcat44(const SkM44&) override;
68 void didSetM44(const SkM44&) override;
69 void didScale(SkScalar, SkScalar) override;
70 void didTranslate(SkScalar, SkScalar) override;
71
72 void onDrawDRRect(const SkRRect&, const SkRRect&, const SkPaint&) override;
73 void onDrawGlyphRunList(const sktext::GlyphRunList&, const SkPaint&) override;
74 void onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y,
75 const SkPaint& paint) override;
76 void onDrawSlug(const sktext::gpu::Slug* slug, const SkPaint& paint) override;
77 void onDrawPatch(const SkPoint cubics[12], const SkColor colors[4],
78 const SkPoint texCoords[4], SkBlendMode, const SkPaint& paint) override;
79
80 void onDrawPaint(const SkPaint&) override;
81 void onDrawBehind(const SkPaint&) override;
82 void onDrawPoints(PointMode, size_t count, const SkPoint pts[], const SkPaint&) override;
83 void onDrawRect(const SkRect&, const SkPaint&) override;
84 void onDrawRegion(const SkRegion&, const SkPaint&) override;
85 void onDrawOval(const SkRect&, const SkPaint&) override;
86 void onDrawArc(const SkRect&, SkScalar, SkScalar, bool, const SkPaint&) override;
87 void onDrawRRect(const SkRRect&, const SkPaint&) override;
88 void onDrawPath(const SkPath&, const SkPaint&) override;
89
90 void onDrawImage2(const SkImage*, SkScalar, SkScalar, const SkSamplingOptions&,
91 const SkPaint*) override;
92 void onDrawImageRect2(const SkImage*, const SkRect&, const SkRect&, const SkSamplingOptions&,
93 const SkPaint*, SrcRectConstraint) override;
94 void onDrawImageLattice2(const SkImage*, const Lattice&, const SkRect&, SkFilterMode,
95 const SkPaint*) override;
96 void onDrawAtlas2(const SkImage*, const SkRSXform[], const SkRect[], const SkColor[], int,
97 SkBlendMode, const SkSamplingOptions&, const SkRect*, const SkPaint*) override;
98
99 void onDrawVerticesObject(const SkVertices*, SkBlendMode, const SkPaint&) override;
100 void onDrawShadowRec(const SkPath&, const SkDrawShadowRec&) override;
101
102 void onClipRect(const SkRect&, SkClipOp, ClipEdgeStyle) override;
103 void onClipRRect(const SkRRect&, SkClipOp, ClipEdgeStyle) override;
104 void onClipPath(const SkPath&, SkClipOp, ClipEdgeStyle) override;
105 void onClipShader(sk_sp<SkShader>, SkClipOp) override;
106 void onClipRegion(const SkRegion&, SkClipOp) override;
107 void onResetClip() override;
108
109 void onDrawPicture(const SkPicture*, const SkMatrix*, const SkPaint*) override;
110 void onDrawDrawable(SkDrawable*, const SkMatrix*) override;
111 void onDrawAnnotation(const SkRect&, const char[], SkData*) override;
112
113 void onDrawEdgeAAQuad(const SkRect&, const SkPoint[4], QuadAAFlags, const SkColor4f&,
114 SkBlendMode) override;
115 void onDrawEdgeAAImageSet2(const ImageSetEntry[], int count, const SkPoint[], const SkMatrix[],
116 const SkSamplingOptions&,const SkPaint*, SrcRectConstraint) override;
117 class Iter;
118private:
120};
121
122
123#endif
int count
Definition: FontMgrTest.cpp:50
#define SK_API
Definition: SkAPI.h:35
SkBlendMode
Definition: SkBlendMode.h:38
SkClipOp
Definition: SkClipOp.h:13
uint32_t SkColor
Definition: SkColor.h:37
SkFilterMode
void onDrawPoints(SkCanvas::PointMode mode, size_t count, const SkPoint pts[], const SkPaint &paint) override=0
void onDrawRect(const SkRect &rect, const SkPaint &paint) override=0
void onDrawRegion(const SkRegion &region, const SkPaint &paint) override=0
void onDrawShadowRec(const SkPath &, const SkDrawShadowRec &) override=0
void onDrawPicture(const SkPicture *picture, const SkMatrix *matrix, const SkPaint *paint) override=0
void onDrawBehind(const SkPaint &) override
void onDrawRRect(const SkRRect &rrect, const SkPaint &paint) override=0
void onDrawTextBlob(const SkTextBlob *blob, SkScalar x, SkScalar y, const SkPaint &paint) override=0
void onDrawAnnotation(const SkRect &rect, const char key[], SkData *value) override=0
void onDrawOval(const SkRect &rect, const SkPaint &paint) override=0
void onDrawDrawable(SkDrawable *drawable, const SkMatrix *matrix) override=0
void onDrawArc(const SkRect &rect, SkScalar startAngle, SkScalar sweepAngle, bool useCenter, const SkPaint &paint) override=0
void onDrawDRRect(const SkRRect &outer, const SkRRect &inner, const SkPaint &paint) override=0
void onDrawPatch(const SkPoint cubics[12], const SkColor colors[4], const SkPoint texCoords[4], SkBlendMode mode, const SkPaint &paint) override=0
void onDrawPath(const SkPath &path, const SkPaint &paint) override=0
void onDrawPaint(const SkPaint &paint) override=0
void onDrawEdgeAAQuad(const SkRect &rect, const SkPoint clip[4], SkCanvas::QuadAAFlags aaFlags, const SkColor4f &color, SkBlendMode mode) override=0
SrcRectConstraint
Definition: SkCanvas.h:1541
SaveLayerStrategy
Definition: SkCanvas.h:2263
Definition: SkData.h:25
Definition: SkM44.h:150
SkTDArray< SkCanvas * > fList
Definition: SkNWayCanvas.h:60
Definition: SkPath.h:59
const Paint & paint
Definition: color_source.cc:38
float SkScalar
Definition: extension.cpp:12
double y
double x
PODArray< SkColor > colors
Definition: SkRecords.h:276
int32_t height
int32_t width