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

Public Member Functions

 StrokeRectAnisotropicGM ()
 
- 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 33 of file strokerect_anisotropic.cpp.

Constructor & Destructor Documentation

◆ StrokeRectAnisotropicGM()

StrokeRectAnisotropicGM::StrokeRectAnisotropicGM ( )
inline

Definition at line 35 of file strokerect_anisotropic.cpp.

35{}

Member Function Documentation

◆ getISize()

SkISize StrokeRectAnisotropicGM::getISize ( )
inlineoverrideprotectedvirtual

Implements skiagm::GM.

Definition at line 40 of file strokerect_anisotropic.cpp.

40{ return SkISize::Make(160, 160); }
static constexpr SkISize Make(int32_t w, int32_t h)
Definition: SkSize.h:20

◆ getName()

SkString StrokeRectAnisotropicGM::getName ( ) const
inlineoverrideprotectedvirtual

Implements skiagm::GM.

Definition at line 38 of file strokerect_anisotropic.cpp.

38{ return SkString("strokerect_anisotropic"); }

◆ onDraw()

void StrokeRectAnisotropicGM::onDraw ( SkCanvas canvas)
inlineoverrideprotectedvirtual

Reimplemented from skiagm::GM.

Definition at line 42 of file strokerect_anisotropic.cpp.

42 {
43
44 SkPaint aaPaint;
45 aaPaint.setColor(SkColorSetARGB(255, 0, 0, 0));
46 aaPaint.setAntiAlias(true);
47 aaPaint.setStrokeWidth(10);
49
50 SkPaint bwPaint;
51 bwPaint.setColor(SkColorSetARGB(255, 0, 0, 0));
52 bwPaint.setStrokeWidth(10);
54
55 // The two miter columns
56 draw_sqooshed_rect(canvas, { 20.0f, 40.5f }, aaPaint); // whole pixels
57 draw_sqooshed_rect(canvas, { 20.0f, 110.5f }, bwPaint); // whole pixels
58
59 draw_sqooshed_rect(canvas, { 60.5f, 40.0f }, aaPaint); // half pixels
60 draw_sqooshed_rect(canvas, { 60.5f, 110.0f }, bwPaint); // half pixels
61
64
65 // The two bevel columns
66 draw_sqooshed_rect(canvas, { 100.0f, 40.5f }, aaPaint); // whole pixels
67 draw_sqooshed_rect(canvas, { 100.0f, 110.5f }, bwPaint); // whole pixels
68
69 draw_sqooshed_rect(canvas, { 140.5f, 40.0f }, aaPaint); // half pixels
70 draw_sqooshed_rect(canvas, { 140.5f, 110.0f }, bwPaint); // half pixels
71 }
static constexpr SkColor SkColorSetARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
Definition: SkColor.h:49
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 setStrokeJoin(Join join)
Definition: SkPaint.cpp:189
@ kBevel_Join
connects outside edges
Definition: SkPaint.h:361
void setStrokeWidth(SkScalar width)
Definition: SkPaint.cpp:159
static void draw_sqooshed_rect(SkCanvas *canvas, SkVector xlate, const SkPaint &p)

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