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

Protected Member Functions

void onOnceBeforeDraw () override
 
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
 
- 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
 
- Static Public Attributes inherited from skiagm::GM
static constexpr char kErrorMsg_DrawSkippedGpuOnly []
 

Detailed Description

Definition at line 301 of file pathfill.cpp.

Member Function Documentation

◆ getISize()

SkISize PathFillGM::getISize ( )
inlineoverrideprotectedvirtual

Implements skiagm::GM.

Definition at line 322 of file pathfill.cpp.

322{ return SkISize::Make(640, 480); }
static constexpr SkISize Make(int32_t w, int32_t h)
Definition: SkSize.h:20

◆ getName()

SkString PathFillGM::getName ( ) const
inlineoverrideprotectedvirtual

Implements skiagm::GM.

Definition at line 320 of file pathfill.cpp.

320{ return SkString("pathfill"); }

◆ onDraw()

void PathFillGM::onDraw ( SkCanvas canvas)
inlineoverrideprotectedvirtual

Reimplemented from skiagm::GM.

Definition at line 324 of file pathfill.cpp.

324 {
326 paint.setAntiAlias(true);
327
328 for (size_t i = 0; i < N; i++) {
329 canvas->drawPath(fPath[i], paint);
330 canvas->translate(SkIntToScalar(0), fDY[i]);
331 }
332
333 canvas->save();
334 canvas->scale(0.300000011920929f, 0.300000011920929f);
335 canvas->translate(50, 50);
336 canvas->drawPath(fInfoPath, paint);
337 canvas->restore();
338
339 canvas->scale(2, 2);
340 canvas->translate(5, 15);
341 canvas->drawPath(fAccessibilityPath, paint);
342
343 canvas->scale(0.5f, 0.5f);
344 canvas->translate(5, 50);
345 canvas->drawPath(fVisualizerPath, paint);
346 }
#define SkIntToScalar(x)
Definition: SkScalar.h:57
void restore()
Definition: SkCanvas.cpp:461
void translate(SkScalar dx, SkScalar dy)
Definition: SkCanvas.cpp:1278
int save()
Definition: SkCanvas.cpp:447
void drawPath(const SkPath &path, const SkPaint &paint)
Definition: SkCanvas.cpp:1747
void scale(SkScalar sx, SkScalar sy)
Definition: SkCanvas.cpp:1289
const Paint & paint
Definition: color_source.cc:38
#define N
Definition: pathfill.cpp:299

◆ onOnceBeforeDraw()

void PathFillGM::onOnceBeforeDraw ( )
inlineoverrideprotectedvirtual

Reimplemented from skiagm::GM.

Definition at line 308 of file pathfill.cpp.

308 {
309 for (size_t i = 0; i < N; i++) {
310 auto [path, dy] = gProcs[i]();
311 fPath[i] = path;
312 fDY[i] = dy;
313 }
314
315 fInfoPath = make_info();
316 fAccessibilityPath = make_accessibility();
317 fVisualizerPath = make_visualizer();
318 }
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
constexpr MakePathProc gProcs[]
Definition: pathfill.cpp:286
static SkPath make_info()
Definition: pathfill.cpp:172
static SkPath make_accessibility()
Definition: pathfill.cpp:203
static SkPath make_visualizer()
Definition: pathfill.cpp:237

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