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

Private Member Functions

SkString getName () const override
 
SkISize getISize () override
 
void modifyGrContextOptions (GrContextOptions *ctxOptions) override
 
DrawResult onDraw (SkCanvas *canvas, SkString *errorMsg) override
 

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 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 []
 
- Protected Member Functions inherited from skiagm::GM
virtual DrawResult onGpuSetup (SkCanvas *, SkString *, GraphiteTestContext *)
 
virtual void onGpuTeardown ()
 
virtual void onOnceBeforeDraw ()
 
virtual void onDraw (SkCanvas *)
 
virtual bool onAnimate (double)
 
virtual bool onGetControls (SkMetaData *)
 
virtual void onSetControls (const SkMetaData &)
 
GraphiteTestContextgraphiteTestContext () const
 

Detailed Description

Definition at line 17 of file batchedconvexpaths.cpp.

Member Function Documentation

◆ getISize()

SkISize skiagm::BatchedConvexPathsGM::getISize ( )
inlineoverrideprivatevirtual

Implements skiagm::GM.

Definition at line 20 of file batchedconvexpaths.cpp.

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

◆ getName()

SkString skiagm::BatchedConvexPathsGM::getName ( ) const
inlineoverrideprivatevirtual

Implements skiagm::GM.

Definition at line 19 of file batchedconvexpaths.cpp.

19{ return SkString("batchedconvexpaths"); }

◆ modifyGrContextOptions()

void skiagm::BatchedConvexPathsGM::modifyGrContextOptions ( GrContextOptions ctxOptions)
inlineoverrideprivatevirtual

Reimplemented from skiagm::GM.

Definition at line 22 of file batchedconvexpaths.cpp.

22 {
23 // Ensure our paths don't go through the atlas path renderer.
24 ctxOptions->fGpuPathRenderers &= ~GpuPathRenderers::kAtlas;
25 }
GpuPathRenderers

◆ onDraw()

DrawResult skiagm::BatchedConvexPathsGM::onDraw ( SkCanvas canvas,
SkString errorMsg 
)
inlineoverrideprivatevirtual

Reimplemented from skiagm::GM.

Definition at line 27 of file batchedconvexpaths.cpp.

27 {
28 canvas->clear(SK_ColorBLACK);
29 for (uint32_t i = 0; i < 10; ++i) {
30 SkAutoCanvasRestore acr(canvas, true);
31
32 int numPoints = (i + 3) * 3;
34 path.moveTo(1, 0);
35 for (float j = 1; j < numPoints; j += 3) {
36 constexpr float k2PI = SK_ScalarPI * 2;
37 path.cubicTo(cosf(j/numPoints * k2PI), sinf(j/numPoints * k2PI),
38 cosf((j+1)/numPoints * k2PI), sinf((j+1)/numPoints * k2PI),
39 j+2 == numPoints ? 1 : cosf((j+2)/numPoints * k2PI),
40 j+2 == numPoints ? 0 : sinf((j+2)/numPoints * k2PI));
41 }
42 float scale = 256 - i*24;
43 canvas->translate(scale + (256 - scale) * .33f, scale + (256 - scale) * .33f);
44 canvas->scale(scale, scale);
45
47 paint.setColor(((i + 123458383u) * 285018463u) | 0xff808080);
48 paint.setAlphaf(0.3f);
49 paint.setAntiAlias(true);
50
51 canvas->drawPath(path, paint);
52 }
53 return DrawResult::kOk;
54 }
constexpr SkColor SK_ColorBLACK
Definition SkColor.h:103
#define SK_ScalarPI
Definition SkScalar.h:21
void translate(SkScalar dx, SkScalar dy)
void clear(SkColor color)
Definition SkCanvas.h:1199
void drawPath(const SkPath &path, const SkPaint &paint)
void scale(SkScalar sx, SkScalar sy)
const Paint & paint
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
const Scalar scale

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