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

Public Member Functions

 ShallowGradientGM (MakeShaderProc proc, const char name[], bool dither)
 
- 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
 

Private Member Functions

SkString getName () const override
 
SkISize getISize () override
 
void onDraw (SkCanvas *canvas) 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
 
- 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 DrawResult onDraw (SkCanvas *, SkString *errorMsg)
 
virtual bool onAnimate (double)
 
virtual bool onGetControls (SkMetaData *)
 
virtual void onSetControls (const SkMetaData &)
 
GraphiteTestContextgraphiteTestContext () const
 

Detailed Description

Definition at line 45 of file shallowgradient.cpp.

Constructor & Destructor Documentation

◆ ShallowGradientGM()

ShallowGradientGM::ShallowGradientGM ( MakeShaderProc  proc,
const char  name[],
bool  dither 
)
inline

Definition at line 47 of file shallowgradient.cpp.

48 : fProc(proc), fName(name), fDither(dither) {}
const char * name
Definition fuchsia.cc:50

Member Function Documentation

◆ getISize()

SkISize ShallowGradientGM::getISize ( )
inlineoverrideprivatevirtual

Implements skiagm::GM.

Definition at line 59 of file shallowgradient.cpp.

59{ return {800, 800}; }

◆ getName()

SkString ShallowGradientGM::getName ( ) const
inlineoverrideprivatevirtual

Implements skiagm::GM.

Definition at line 55 of file shallowgradient.cpp.

55 {
56 return SkStringPrintf("shallow_gradient_%s%s", fName, fDither ? "" : "_nodither");
57 }
SK_API SkString static SkString SkStringPrintf()
Definition SkString.h:287

◆ onDraw()

void ShallowGradientGM::onDraw ( SkCanvas canvas)
inlineoverrideprivatevirtual

Reimplemented from skiagm::GM.

Definition at line 61 of file shallowgradient.cpp.

61 {
62 const SkColor colors[] = { 0xFF555555, 0xFF444444 };
63 const int colorCount = std::size(colors);
64
65 SkRect r = { 0, 0, this->width(), this->height() };
67
69 paint.setShader(fProc(colors, colorCount, size));
70 paint.setDither(fDither);
71 canvas->drawRect(r, paint);
72 }
uint32_t SkColor
Definition SkColor.h:37
void drawRect(const SkRect &rect, const SkPaint &paint)
SkScalar width()
Definition gm.h:159
SkScalar height()
Definition gm.h:162
const Paint & paint
PODArray< SkColor > colors
Definition SkRecords.h:276
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition switches.h:259
constexpr float height() const
Definition SkRect.h:769
constexpr float width() const
Definition SkRect.h:762
static constexpr SkSize Make(SkScalar w, SkScalar h)
Definition SkSize.h:56

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