Flutter Engine
The Flutter Engine
Public Member Functions | Protected Member Functions | List of all members
skiagm::PathEffectGM Class Reference
Inheritance diagram for skiagm::PathEffectGM:
skiagm::GM

Public Member Functions

 PathEffectGM ()
 
- Public Member Functions inherited from skiagm::GM
 GM (SkColor backgroundColor=SK_ColorWHITE)
 
virtual ~GM ()
 
void setMode (Mode mode)
 
Mode getMode () const
 
DrawResult gpuSetup (SkCanvas *, SkString *errorMsg, GraphiteTestContext *=nullptr)
 
void gpuTeardown ()
 
void onceBeforeDraw ()
 
DrawResult draw (SkCanvas *canvas)
 
DrawResult draw (SkCanvas *, SkString *errorMsg)
 
void drawBackground (SkCanvas *)
 
DrawResult drawContent (SkCanvas *canvas)
 
DrawResult drawContent (SkCanvas *, SkString *errorMsg)
 
virtual SkISize getISize ()=0
 
virtual SkString getName () const =0
 
virtual bool runAsBench () const
 
SkScalar width ()
 
SkScalar height ()
 
SkColor getBGColor () const
 
void setBGColor (SkColor)
 
void drawSizeBounds (SkCanvas *, SkColor)
 
bool animate (double)
 
virtual bool onChar (SkUnichar)
 
bool getControls (SkMetaData *controls)
 
void setControls (const SkMetaData &controls)
 
virtual void modifyGrContextOptions (GrContextOptions *)
 
virtual void modifyGraphiteContextOptions (skgpu::graphite::ContextOptions *) const
 
virtual bool isBazelOnly () const
 
virtual std::map< std::string, std::string > getGoldKeys () const
 

Protected Member Functions

SkString getName () const override
 
SkISize getISize () override
 
void onDraw (SkCanvas *canvas) override
 
- Protected Member Functions inherited from skiagm::GM
virtual DrawResult onGpuSetup (SkCanvas *, SkString *, GraphiteTestContext *)
 
virtual void onGpuTeardown ()
 
virtual void onOnceBeforeDraw ()
 
virtual DrawResult onDraw (SkCanvas *, SkString *errorMsg)
 
virtual void onDraw (SkCanvas *)
 
virtual bool onAnimate (double)
 
virtual bool onGetControls (SkMetaData *)
 
virtual void onSetControls (const SkMetaData &)
 
GraphiteTestContextgraphiteTestContext () const
 

Additional Inherited Members

- Public Types inherited from skiagm::GM
enum  Mode { kGM_Mode , kSample_Mode , kBench_Mode }
 
using DrawResult = skiagm::DrawResult
 
using GraphiteTestContext = skiatest::graphite::GraphiteTestContext
 
- Static Public Attributes inherited from skiagm::GM
static constexpr char kErrorMsg_DrawSkippedGpuOnly []
 

Detailed Description

Definition at line 113 of file patheffects.cpp.

Constructor & Destructor Documentation

◆ PathEffectGM()

skiagm::PathEffectGM::PathEffectGM ( )
inline

Definition at line 115 of file patheffects.cpp.

115{}

Member Function Documentation

◆ getISize()

SkISize skiagm::PathEffectGM::getISize ( )
inlineoverrideprotectedvirtual

Implements skiagm::GM.

Definition at line 120 of file patheffects.cpp.

120{ return SkISize::Make(800, 600); }
static constexpr SkISize Make(int32_t w, int32_t h)
Definition: SkSize.h:20

◆ getName()

SkString skiagm::PathEffectGM::getName ( ) const
inlineoverrideprotectedvirtual

Implements skiagm::GM.

Definition at line 118 of file patheffects.cpp.

118{ return SkString("patheffect"); }

◆ onDraw()

void skiagm::PathEffectGM::onDraw ( SkCanvas canvas)
inlineoverrideprotectedvirtual

Reimplemented from skiagm::GM.

Definition at line 122 of file patheffects.cpp.

122 {
124 paint.setAntiAlias(true);
126
128 {20, 20},
129 {70, 120},
130 {120, 30},
131 {170, 80},
132 {240, 50},
133 }, false);
134
135 canvas->save();
136 for (size_t i = 0; i < std::size(gPE); i++) {
137 gPE[i](&paint);
138 canvas->drawPath(path, paint);
139 canvas->translate(0, 75);
140 }
141 canvas->restore();
142
143 path.reset();
144 SkRect r = { 0, 0, 250, 120 };
147 .detach();
148
149 canvas->translate(320, 20);
150 for (size_t i = 0; i < std::size(gPE2); i++) {
151 gPE2[i](&paint);
152 canvas->drawPath(path, paint);
153 canvas->translate(0, 160);
154 }
155
156 const SkIRect rect = SkIRect::MakeXYWH(20, 20, 60, 60);
157 for (size_t i = 0; i < std::size(gPE); i++) {
158 SkPaint p;
159 p.setAntiAlias(true);
160 p.setStyle(SkPaint::kFill_Style);
161 gPE[i](&p);
162 canvas->drawIRect(rect, p);
163 canvas->translate(75, 0);
164 }
165 }
void restore()
Definition: SkCanvas.cpp:461
void translate(SkScalar dx, SkScalar dy)
Definition: SkCanvas.cpp:1278
void drawIRect(const SkIRect &rect, const SkPaint &paint)
Definition: SkCanvas.h:1358
int save()
Definition: SkCanvas.cpp:447
void drawPath(const SkPath &path, const SkPaint &paint)
Definition: SkCanvas.cpp:1747
@ kStroke_Style
set to stroke geometry
Definition: SkPaint.h:194
@ kFill_Style
set to fill geometry
Definition: SkPaint.h:193
SkPathBuilder & addRect(const SkRect &, SkPathDirection, unsigned startIndex)
SkPathBuilder & addOval(const SkRect &, SkPathDirection, unsigned startIndex)
Definition: SkPath.h:59
static SkPath Polygon(const SkPoint pts[], int count, bool isClosed, SkPathFillType=SkPathFillType::kWinding, bool isVolatile=false)
Definition: SkPath.cpp:3614
const Paint & paint
Definition: color_source.cc:38
sk_sp< SkBlender > blender SkRect rect
Definition: SkRecords.h:350
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
Definition: switches.h:57
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition: switches.h:259
constexpr PE_Proc gPE[]
Definition: patheffects.cpp:89
constexpr PE_Proc gPE2[]
Definition: SkRect.h:32
static constexpr SkIRect MakeXYWH(int32_t x, int32_t y, int32_t w, int32_t h)
Definition: SkRect.h:104
SkRect makeInset(float dx, float dy) const
Definition: SkRect.h:987

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