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

Public Member Functions

 ManyCirclesGM ()
 
- 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
 

Static Protected Attributes

static const int kWidth = 800
 
static const int kHeight = 600
 

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 31 of file manypaths.cpp.

Constructor & Destructor Documentation

◆ ManyCirclesGM()

skiagm::ManyCirclesGM::ManyCirclesGM ( )
inline

Definition at line 35 of file manypaths.cpp.

35 {
36 this->setBGColor(0xFFFFFFFF);
37 }
void setBGColor(SkColor)
Definition: gm.cpp:159

Member Function Documentation

◆ getISize()

SkISize skiagm::ManyCirclesGM::getISize ( )
inlineoverrideprotectedvirtual

Implements skiagm::GM.

Definition at line 45 of file manypaths.cpp.

45{ return SkISize::Make(kWidth, kHeight); }
static const int kWidth
Definition: manypaths.cpp:40
static const int kHeight
Definition: manypaths.cpp:41
static constexpr SkISize Make(int32_t w, int32_t h)
Definition: SkSize.h:20

◆ getName()

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

Implements skiagm::GM.

Definition at line 43 of file manypaths.cpp.

43{ return SkString("manycircles"); }

◆ onDraw()

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

Reimplemented from skiagm::GM.

Definition at line 47 of file manypaths.cpp.

47 {
48 SkRandom rand(1);
50 paint.setAntiAlias(true);
51 int total = 10000;
52 while (total--) {
53 SkScalar x = rand.nextF() * kWidth - 100;
54 SkScalar y = rand.nextF() * kHeight - 100;
55 SkScalar w = rand.nextF() * 200;
56 SkRect circle = SkRect::MakeXYWH(x, y, w, w);
57 paint.setColor(gen_color(&rand));
58 canvas->drawOval(circle, paint);
59 }
60 }
void drawOval(const SkRect &oval, const SkPaint &paint)
Definition: SkCanvas.cpp:1698
const Paint & paint
Definition: color_source.cc:38
float SkScalar
Definition: extension.cpp:12
double y
double x
static SkColor gen_color(SkRandom *rand)
Definition: manypaths.cpp:22
SkScalar w
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
Definition: SkRect.h:659

Member Data Documentation

◆ kHeight

const int skiagm::ManyCirclesGM::kHeight = 600
staticprotected

Definition at line 41 of file manypaths.cpp.

◆ kWidth

const int skiagm::ManyCirclesGM::kWidth = 800
staticprotected

Definition at line 40 of file manypaths.cpp.


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