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

Public Member Functions

 Strokes5GM ()
 
- 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 453 of file strokes.cpp.

Constructor & Destructor Documentation

◆ Strokes5GM()

Strokes5GM::Strokes5GM ( )
inline

Definition at line 455 of file strokes.cpp.

455{}

Member Function Documentation

◆ getISize()

SkISize Strokes5GM::getISize ( )
inlineoverrideprotectedvirtual

Implements skiagm::GM.

Definition at line 460 of file strokes.cpp.

460{ return SkISize::Make(W, H * 2); }
#define W
Definition: strokes.cpp:33
Definition: SkMD5.cpp:130
static constexpr SkISize Make(int32_t w, int32_t h)
Definition: SkSize.h:20

◆ getName()

SkString Strokes5GM::getName ( ) const
inlineoverrideprotectedvirtual

Implements skiagm::GM.

Definition at line 458 of file strokes.cpp.

458{ return SkString("zero_control_stroke"); }

◆ onDraw()

void Strokes5GM::onDraw ( SkCanvas canvas)
inlineoverrideprotectedvirtual

Reimplemented from skiagm::GM.

Definition at line 462 of file strokes.cpp.

462 {
463 SkPaint p;
464 p.setColor(SK_ColorRED);
465 p.setAntiAlias(true);
466 p.setStyle(SkPaint::kStroke_Style);
467 p.setStrokeWidth(40);
468 p.setStrokeCap(SkPaint::kButt_Cap);
469
470 SkPath path;
471 path.moveTo(157.474f,111.753f);
472 path.cubicTo(128.5f,111.5f,35.5f,29.5f,35.5f,29.5f);
473 canvas->drawPath(path, p);
474 path.reset();
475 path.moveTo(250, 50);
476 path.quadTo(280, 80, 280, 80);
477 canvas->drawPath(path, p);
478 path.reset();
479 path.moveTo(150, 50);
480 path.conicTo(180, 80, 180, 80, 0.707f);
481 canvas->drawPath(path, p);
482
483 path.reset();
484 path.moveTo(157.474f,311.753f);
485 path.cubicTo(157.474f,311.753f,85.5f,229.5f,35.5f,229.5f);
486 canvas->drawPath(path, p);
487 path.reset();
488 path.moveTo(280, 250);
489 path.quadTo(280, 250, 310, 280);
490 canvas->drawPath(path, p);
491 path.reset();
492 path.moveTo(180, 250);
493 path.conicTo(180, 250, 210, 280, 0.707f);
494 canvas->drawPath(path, p);
495 }
constexpr SkColor SK_ColorRED
Definition: SkColor.h:126
void drawPath(const SkPath &path, const SkPaint &paint)
Definition: SkCanvas.cpp:1747
@ kButt_Cap
no stroke extension
Definition: SkPaint.h:334
@ kStroke_Style
set to stroke geometry
Definition: SkPaint.h:194
Definition: SkPath.h:59
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

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