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

Public Member Functions

 GraphiteReplayGM ()=default
 
- 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

void onOnceBeforeDraw () override
 
SkString getName () const override
 
SkISize getISize () override
 
bool onAnimate (double nanos) override
 
DrawResult onDraw (SkCanvas *canvas, SkString *errorMsg) 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 29 of file graphite_replay.cpp.

Constructor & Destructor Documentation

◆ GraphiteReplayGM()

skiagm::GraphiteReplayGM::GraphiteReplayGM ( )
default

Member Function Documentation

◆ getISize()

SkISize skiagm::GraphiteReplayGM::getISize ( )
inlineoverrideprotectedvirtual

Implements skiagm::GM.

Definition at line 41 of file graphite_replay.cpp.

41{ return SkISize::Make(kTileWidth * 3, kTileHeight * 2); }
static constexpr SkISize Make(int32_t w, int32_t h)
Definition: SkSize.h:20

◆ getName()

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

Implements skiagm::GM.

Definition at line 39 of file graphite_replay.cpp.

39{ return SkString("graphite-replay"); }

◆ onAnimate()

bool skiagm::GraphiteReplayGM::onAnimate ( double  nanos)
inlineoverrideprotectedvirtual

Reimplemented from skiagm::GM.

Definition at line 43 of file graphite_replay.cpp.

43 {
44 fStartX = kTileWidth * (1.0f + sinf(nanos * 1e-9)) * 0.5f;
45 return true;
46 }

◆ onDraw()

DrawResult skiagm::GraphiteReplayGM::onDraw ( SkCanvas canvas,
SkString errorMsg 
)
inlineoverrideprotectedvirtual

Reimplemented from skiagm::GM.

Definition at line 48 of file graphite_replay.cpp.

48 {
49#if defined(SK_GRAPHITE)
50 skgpu::graphite::Recorder* recorder = canvas->recorder();
51 if (recorder) {
52 this->drawGraphite(canvas, recorder);
53 return DrawResult::kOk;
54 }
55#endif
56 return this->drawNonGraphite(canvas, errorMsg);
57 }
virtual skgpu::graphite::Recorder * recorder() const
Definition: SkCanvas.cpp:1641

◆ onOnceBeforeDraw()

void skiagm::GraphiteReplayGM::onOnceBeforeDraw ( )
inlineoverrideprotectedvirtual

Reimplemented from skiagm::GM.

Definition at line 34 of file graphite_replay.cpp.

34 {
36 fImage = ToolUtils::GetResourceAsImage("images/mandrill_128.png");
37 }
constexpr SkColor SK_ColorBLACK
Definition: SkColor.h:103
void setBGColor(SkColor)
Definition: gm.cpp:159
sk_sp< SkImage > GetResourceAsImage(const char *resource)
Definition: DecodeUtils.h:25

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