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

Public Member Functions

 GammaShaderTextGM ()
 
- 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 onOnceBeforeDraw () 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 117 of file gammatext.cpp.

Constructor & Destructor Documentation

◆ GammaShaderTextGM()

GammaShaderTextGM::GammaShaderTextGM ( )
inline

Definition at line 122 of file gammatext.cpp.

122 {
124 for (size_t i = 0; i < std::size(fShaders); ++i) {
125 fColors[i] = colors[i];
126 }
127 }
uint32_t SkColor
Definition: SkColor.h:37
constexpr SkColor SK_ColorBLUE
Definition: SkColor.h:135
constexpr SkColor SK_ColorRED
Definition: SkColor.h:126
constexpr SkColor SK_ColorBLACK
Definition: SkColor.h:103
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

Member Function Documentation

◆ getISize()

SkISize GammaShaderTextGM::getISize ( )
inlineoverrideprotectedvirtual

Implements skiagm::GM.

Definition at line 132 of file gammatext.cpp.

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

◆ getName()

SkString GammaShaderTextGM::getName ( ) const
inlineoverrideprotectedvirtual

Implements skiagm::GM.

Definition at line 130 of file gammatext.cpp.

130{ return SkString("gammagradienttext"); }

◆ onDraw()

void GammaShaderTextGM::onDraw ( SkCanvas canvas)
inlineoverrideprotectedvirtual

Reimplemented from skiagm::GM.

Definition at line 140 of file gammatext.cpp.

140 {
142 paint.setAntiAlias(true);
144 SkASSERT(tf);
145 SkFont font(tf, 18);
147
148 for (size_t i = 0; i < std::size(fShaders); ++i) {
149 draw_pair(canvas, font, fColors[i], fShaders[i]);
150 canvas->translate(0, 80);
151 }
152 }
#define SkASSERT(cond)
Definition: SkAssert.h:116
void translate(SkScalar dx, SkScalar dy)
Definition: SkCanvas.cpp:1278
static constexpr SkFontStyle Italic()
Definition: SkFontStyle.h:72
Definition: SkFont.h:35
@ kSubpixelAntiAlias
glyph positioned in pixel using transparency
const Paint & paint
Definition: color_source.cc:38
static void draw_pair(SkCanvas *canvas, const SkFont &font, SkColor color, const sk_sp< SkShader > &shader)
Definition: gammatext.cpp:105
sk_sp< SkTypeface > CreatePortableTypeface(const char *name, SkFontStyle style)
font
Font Metadata and Metrics.

◆ onOnceBeforeDraw()

void GammaShaderTextGM::onOnceBeforeDraw ( )
inlineoverrideprotectedvirtual

Reimplemented from skiagm::GM.

Definition at line 134 of file gammatext.cpp.

134 {
135 for (size_t i = 0; i < std::size(fShaders); ++i) {
136 fShaders[i] = make_gradient(fColors[i]);
137 }
138 }
static sk_sp< SkShader > make_gradient(SkColor c)
Definition: gammatext.cpp:97

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