Flutter Engine
The Flutter Engine
Protected Member Functions | List of all members
skiagm::ContourStartGM Class Reference
Inheritance diagram for skiagm::ContourStartGM:
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 27 of file pathcontourstart.cpp.

Member Function Documentation

◆ getISize()

SkISize skiagm::ContourStartGM::getISize ( )
inlineoverrideprotectedvirtual

Implements skiagm::GM.

Definition at line 53 of file pathcontourstart.cpp.

53{ return SkISize::Make(kImageWidth, kImageHeight); }
static constexpr SkISize Make(int32_t w, int32_t h)
Definition: SkSize.h:20

◆ getName()

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

Implements skiagm::GM.

Definition at line 51 of file pathcontourstart.cpp.

51{ return SkString("contour_start"); }

◆ onDraw()

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

Reimplemented from skiagm::GM.

Definition at line 55 of file pathcontourstart.cpp.

55 {
56
57 drawDirs(canvas, [](const SkRect& rect, SkPathDirection dir, unsigned startIndex) {
58 return SkPath::Rect(rect, dir, startIndex);
59 });
60
61 drawDirs(canvas, [](const SkRect& rect, SkPathDirection dir, unsigned startIndex) {
62 return SkPath::Oval(rect, dir, startIndex);
63 });
64
65 drawDirs(canvas, [](const SkRect& rect, SkPathDirection dir, unsigned startIndex) {
67 const SkVector radii[4] = { {15, 15}, {15, 15}, {15, 15}, {15, 15}};
68 rrect.setRectRadii(rect, radii);
69 return SkPath::RRect(rrect, dir, startIndex);
70 });
71
72 drawDirs(canvas, [](const SkRect& rect, SkPathDirection dir, unsigned startIndex) {
75 return SkPath::RRect(rrect, dir, startIndex);
76 });
77
78 drawDirs(canvas, [](const SkRect& rect, SkPathDirection dir, unsigned startIndex) {
81 return SkPath::RRect(rrect, dir, startIndex);
82 });
83
84 }
SkPathDirection
Definition: SkPathTypes.h:34
static SkPath RRect(const SkRRect &, SkPathDirection dir=SkPathDirection::kCW)
Definition: SkPath.cpp:3602
static SkPath Rect(const SkRect &, SkPathDirection=SkPathDirection::kCW, unsigned startIndex=0)
Definition: SkPath.cpp:3586
static SkPath Oval(const SkRect &, SkPathDirection=SkPathDirection::kCW)
Definition: SkPath.cpp:3590
void setOval(const SkRect &oval)
Definition: SkRRect.cpp:30
void setRectRadii(const SkRect &rect, const SkVector radii[4])
Definition: SkRRect.cpp:189
void setRect(const SkRect &rect)
Definition: SkRRect.h:126
SkRRect rrect
Definition: SkRecords.h:232
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 to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets dir
Definition: switches.h:145

◆ onOnceBeforeDraw()

void skiagm::ContourStartGM::onOnceBeforeDraw ( )
inlineoverrideprotectedvirtual

Reimplemented from skiagm::GM.

Definition at line 29 of file pathcontourstart.cpp.

29 {
30 const SkScalar kMaxDashLen = 100;
31 const SkScalar kDashGrowth = 1.2f;
32
33 STArray<100, SkScalar> intervals;
34 for (SkScalar len = 1; len < kMaxDashLen; len *= kDashGrowth) {
35 intervals.push_back(len);
36 intervals.push_back(len);
37 }
38
39 fDashPaint.setAntiAlias(true);
41 fDashPaint.setStrokeWidth(6);
42 fDashPaint.setColor(0xff008000);
43 fDashPaint.setPathEffect(SkDashPathEffect::Make(intervals.begin(), intervals.size(), 0));
44
45 fPointsPaint.setColor(0xff800000);
46 fPointsPaint.setStrokeWidth(3);
47
48 fRect = SkRect::MakeLTRB(10, 10, 100, 70);
49 }
static sk_sp< SkPathEffect > Make(const SkScalar intervals[], int count, SkScalar phase)
void setStyle(Style style)
Definition: SkPaint.cpp:105
void setColor(SkColor color)
Definition: SkPaint.cpp:119
void setAntiAlias(bool aa)
Definition: SkPaint.h:170
@ kStroke_Style
set to stroke geometry
Definition: SkPaint.h:194
void setPathEffect(sk_sp< SkPathEffect > pathEffect)
void setStrokeWidth(SkScalar width)
Definition: SkPaint.cpp:159
int size() const
Definition: SkTArray.h:421
float SkScalar
Definition: extension.cpp:12
static constexpr SkRect MakeLTRB(float l, float t, float r, float b)
Definition: SkRect.h:646

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