Flutter Engine
The Flutter Engine
Public Member Functions | Protected Attributes | List of all members
RuntimeShaderGM Class Reference
Inheritance diagram for RuntimeShaderGM:
skiagm::GM ClipSuperRRect ColorCubeColorFilterRT ColorCubeRT LinearGradientRT SimpleRT SpiralRT ThresholdRT UnsharpRT

Public Member Functions

 RuntimeShaderGM (const char *name, SkISize size, const char *sksl, uint32_t flags=0)
 
void onOnceBeforeDraw () override
 
bool runAsBench () const override
 
SkString getName () const override
 
SkISize getISize () override
 
bool onAnimate (double nanos) override
 
- 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 Attributes

SkString fName
 
SkISize fSize
 
uint32_t fFlags
 
float fSecs = 0.0f
 
SkString fSkSL
 
sk_sp< SkRuntimeEffectfEffect
 

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 void onDraw (SkCanvas *)
 
virtual bool onAnimate (double)
 
virtual bool onGetControls (SkMetaData *)
 
virtual void onSetControls (const SkMetaData &)
 
GraphiteTestContextgraphiteTestContext () const
 

Detailed Description

Definition at line 34 of file runtimeshader.cpp.

Constructor & Destructor Documentation

◆ RuntimeShaderGM()

RuntimeShaderGM::RuntimeShaderGM ( const char *  name,
SkISize  size,
const char *  sksl,
uint32_t  flags = 0 
)
inline

Definition at line 36 of file runtimeshader.cpp.

37 : fName(name), fSize(size), fFlags(flags), fSkSL(sksl) {}
FlutterSemanticsFlag flags
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32
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 RuntimeShaderGM::getISize ( )
inlineoverridevirtual

Implements skiagm::GM.

Definition at line 51 of file runtimeshader.cpp.

51{ return fSize; }

◆ getName()

SkString RuntimeShaderGM::getName ( ) const
inlineoverridevirtual

Implements skiagm::GM.

Definition at line 50 of file runtimeshader.cpp.

50{ return fName; }

◆ onAnimate()

bool RuntimeShaderGM::onAnimate ( double  nanos)
inlineoverridevirtual

Reimplemented from skiagm::GM.

Definition at line 53 of file runtimeshader.cpp.

53 {
54 fSecs = nanos / (1000 * 1000 * 1000);
56 }
static constexpr bool SkToBool(const T &x)
Definition: SkTo.h:35
@ kAnimate_RTFlag

◆ onOnceBeforeDraw()

void RuntimeShaderGM::onOnceBeforeDraw ( )
inlineoverridevirtual

Reimplemented from skiagm::GM.

Reimplemented in ThresholdRT, UnsharpRT, ColorCubeRT, and ColorCubeColorFilterRT.

Definition at line 39 of file runtimeshader.cpp.

39 {
40 auto [effect, error] = (fFlags & kColorFilter_RTFlag)
43 if (!effect) {
44 SkDebugf("RuntimeShader error: %s\n", error.c_str());
45 }
46 fEffect = std::move(effect);
47 }
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
sk_sp< SkRuntimeEffect > fEffect
static Result MakeForColorFilter(SkString sksl, const Options &)
static Result MakeForShader(SkString sksl, const Options &)
const uint8_t uint32_t uint32_t GError ** error
@ kColorFilter_RTFlag

◆ runAsBench()

bool RuntimeShaderGM::runAsBench ( ) const
inlineoverridevirtual

Reimplemented from skiagm::GM.

Definition at line 49 of file runtimeshader.cpp.

49{ return SkToBool(fFlags & kBench_RTFlag); }
@ kBench_RTFlag

Member Data Documentation

◆ fEffect

sk_sp<SkRuntimeEffect> RuntimeShaderGM::fEffect
protected

Definition at line 65 of file runtimeshader.cpp.

◆ fFlags

uint32_t RuntimeShaderGM::fFlags
protected

Definition at line 61 of file runtimeshader.cpp.

◆ fName

SkString RuntimeShaderGM::fName
protected

Definition at line 59 of file runtimeshader.cpp.

◆ fSecs

float RuntimeShaderGM::fSecs = 0.0f
protected

Definition at line 62 of file runtimeshader.cpp.

◆ fSize

SkISize RuntimeShaderGM::fSize
protected

Definition at line 60 of file runtimeshader.cpp.

◆ fSkSL

SkString RuntimeShaderGM::fSkSL
protected

Definition at line 64 of file runtimeshader.cpp.


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