Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Protected Member Functions | Protected Attributes | List of all members
skiagm::StLouisArchGM Class Reference
Inheritance diagram for skiagm::StLouisArchGM:
skiagm::GM

Protected Member Functions

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

Protected Attributes

const SkScalar kWidth = 256
 
const SkScalar kHeight = 256
 

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 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 22 of file stlouisarch.cpp.

Member Function Documentation

◆ getISize()

SkISize skiagm::StLouisArchGM::getISize ( )
inlineoverrideprotectedvirtual

Implements skiagm::GM.

Definition at line 26 of file stlouisarch.cpp.

26{ return SkISize::Make((int)kWidth, (int)kHeight); }
const SkScalar kWidth
const SkScalar kHeight
static constexpr SkISize Make(int32_t w, int32_t h)
Definition SkSize.h:20

◆ getName()

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

Implements skiagm::GM.

Definition at line 24 of file stlouisarch.cpp.

24{ return SkString("stlouisarch"); }

◆ onDraw()

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

Reimplemented from skiagm::GM.

Definition at line 74 of file stlouisarch.cpp.

74 {
75 canvas->save();
76 canvas->scale(1, -1);
77 canvas->translate(0, -kHeight);
78 for (int p = 0; p < fPaths.size(); ++p) {
80 paint.setARGB(0xff, 0, 0, 0);
81 paint.setAntiAlias(true);
83 paint.setStrokeWidth(0);
84 canvas->drawPath(fPaths[p], paint);
85 }
86 canvas->restore();
87 }
void restore()
Definition SkCanvas.cpp:465
void translate(SkScalar dx, SkScalar dy)
int save()
Definition SkCanvas.cpp:451
void drawPath(const SkPath &path, const SkPaint &paint)
void scale(SkScalar sx, SkScalar sy)
@ kStroke_Style
set to stroke geometry
Definition SkPaint.h:194
int size() const
Definition SkTArray.h:416
const Paint & paint

◆ onOnceBeforeDraw()

void skiagm::StLouisArchGM::onOnceBeforeDraw ( )
inlineoverrideprotectedvirtual

Reimplemented from skiagm::GM.

Definition at line 28 of file stlouisarch.cpp.

28 {
29 {
30 SkPath* bigQuad = &fPaths.push_back();
31 bigQuad->moveTo(0, 0);
32 bigQuad->quadTo(kWidth/2, kHeight, kWidth, 0);
33 }
34
35 {
36 SkPath* degenBigQuad = &fPaths.push_back();
37 SkScalar yPos = kHeight / 2 + 10;
38 degenBigQuad->moveTo(0, yPos);
39 degenBigQuad->quadTo(0, yPos, kWidth, yPos);
40 }
41
42
43 {
44 SkPath* bigCubic = &fPaths.push_back();
45 bigCubic->moveTo(0, 0);
46 bigCubic->cubicTo(0, kHeight,
48 kWidth, 0);
49 }
50
51 {
52 SkPath* degenBigCubic = &fPaths.push_back();
53 SkScalar yPos = kHeight / 2;
54 degenBigCubic->moveTo(0, yPos);
55 degenBigCubic->cubicTo(0, yPos,
56 0, yPos,
57 kWidth, yPos);
58 }
59
60 {
61 SkPath* bigConic = &fPaths.push_back();
62 bigConic->moveTo(0, 0);
63 bigConic->conicTo(kWidth/2, kHeight, kWidth, 0, .5);
64 }
65
66 {
67 SkPath* degenBigConic = &fPaths.push_back();
68 SkScalar yPos = kHeight / 2 - 10;
69 degenBigConic->moveTo(0, yPos);
70 degenBigConic->conicTo(0, yPos, kWidth, yPos, .5);
71 }
72 }
SkPath & moveTo(SkScalar x, SkScalar y)
Definition SkPath.cpp:678
SkPath & quadTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2)
Definition SkPath.cpp:736
SkPath & cubicTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar x3, SkScalar y3)
Definition SkPath.cpp:789
SkPath & conicTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar w)
Definition SkPath.cpp:756
float SkScalar
Definition extension.cpp:12

Member Data Documentation

◆ kHeight

const SkScalar skiagm::StLouisArchGM::kHeight = 256
protected

Definition at line 90 of file stlouisarch.cpp.

◆ kWidth

const SkScalar skiagm::StLouisArchGM::kWidth = 256
protected

Definition at line 89 of file stlouisarch.cpp.


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