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

Public Member Functions

 DegenerateGradientGM ()
 
- 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 128 of file gradients_degenerate.cpp.

Constructor & Destructor Documentation

◆ DegenerateGradientGM()

DegenerateGradientGM::DegenerateGradientGM ( )
inline

Definition at line 130 of file gradients_degenerate.cpp.

130 {
131
132 }

Member Function Documentation

◆ getISize()

SkISize DegenerateGradientGM::getISize ( )
inlineoverrideprotectedvirtual

Implements skiagm::GM.

Definition at line 137 of file gradients_degenerate.cpp.

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

◆ getName()

SkString DegenerateGradientGM::getName ( ) const
inlineoverrideprotectedvirtual

Implements skiagm::GM.

Definition at line 135 of file gradients_degenerate.cpp.

135{ return SkString("degenerate_gradients"); }

◆ onDraw()

void DegenerateGradientGM::onDraw ( SkCanvas canvas)
inlineoverrideprotectedvirtual

Reimplemented from skiagm::GM.

Definition at line 139 of file gradients_degenerate.cpp.

139 {
140 canvas->translate(3 * TILE_GAP, 3 * TILE_GAP);
141 draw_tile_header(canvas);
142
143 draw_row(canvas, "linear: empty, blue, blue, green", make_linear);
144 draw_row(canvas, "radial: empty, blue, blue, green", make_radial);
145 draw_row(canvas, "sweep-0: empty, blue, blue, green", make_sweep_zero_ang);
146 draw_row(canvas, "sweep-45: empty, blue, blue, red 45 degree sector then green",
147 make_sweep);
148 draw_row(canvas, "2pt-conic-0: empty, blue, blue, green", make_2pt_conic_zero_rad);
149 draw_row(canvas, "2pt-conic-1: empty, blue, blue, full red circle on green",
151 }
void translate(SkScalar dx, SkScalar dy)
Definition: SkCanvas.cpp:1278
static void draw_tile_header(SkCanvas *canvas)
static void draw_row(SkCanvas *canvas, const char *desc, GradientFactory factory)
static sk_sp< SkShader > make_linear(SkTileMode mode)
static sk_sp< SkShader > make_2pt_conic(SkTileMode mode)
static sk_sp< SkShader > make_radial(SkTileMode mode)
static sk_sp< SkShader > make_sweep(SkTileMode mode)
static constexpr int TILE_GAP
static sk_sp< SkShader > make_2pt_conic_zero_rad(SkTileMode mode)
static sk_sp< SkShader > make_sweep_zero_ang(SkTileMode mode)

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