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

Public Member Functions

 PictureGM ()
 
- 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
 
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 47 of file picture.cpp.

Constructor & Destructor Documentation

◆ PictureGM()

PictureGM::PictureGM ( )
inline

Definition at line 49 of file picture.cpp.

50 : fPicture(nullptr)
51 {}

Member Function Documentation

◆ getISize()

SkISize PictureGM::getISize ( )
inlineoverrideprotectedvirtual

Implements skiagm::GM.

Definition at line 60 of file picture.cpp.

60{ return SkISize::Make(450, 120); }
static constexpr SkISize Make(int32_t w, int32_t h)
Definition: SkSize.h:20

◆ getName()

SkString PictureGM::getName ( ) const
inlineoverrideprotectedvirtual

Implements skiagm::GM.

Definition at line 58 of file picture.cpp.

58{ return SkString("pictures"); }

◆ onDraw()

void PictureGM::onDraw ( SkCanvas canvas)
inlineoverrideprotectedvirtual

Reimplemented from skiagm::GM.

Definition at line 62 of file picture.cpp.

62 {
63 canvas->translate(10, 10);
64
67
68 canvas->drawPicture(fPicture);
69
70 matrix.setTranslate(110, 0);
71 canvas->drawPicture(fPicture, &matrix, nullptr);
72
73 matrix.postTranslate(110, 0);
74 canvas->drawPicture(fPicture, &matrix, &paint);
75
76 paint.setAlphaf(0.5f);
77 matrix.postTranslate(110, 0);
78 canvas->drawPicture(fPicture, &matrix, &paint);
79 }
void translate(SkScalar dx, SkScalar dy)
Definition: SkCanvas.cpp:1278
void drawPicture(const SkPicture *picture)
Definition: SkCanvas.h:1961
const Paint & paint
Definition: color_source.cc:38
unsigned useCenter Optional< SkMatrix > matrix
Definition: SkRecords.h:258

◆ onOnceBeforeDraw()

void PictureGM::onOnceBeforeDraw ( )
inlineoverrideprotectedvirtual

Reimplemented from skiagm::GM.

Definition at line 54 of file picture.cpp.

54 {
55 fPicture = make_picture();
56 }
static sk_sp< SkPicture > make_picture()
Definition: picture.cpp:22

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