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

Public Member Functions

 BitmapPremulGM ()
 
- 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 91 of file bitmappremul.cpp.

Constructor & Destructor Documentation

◆ BitmapPremulGM()

skiagm::BitmapPremulGM::BitmapPremulGM ( )
inline

Definition at line 93 of file bitmappremul.cpp.

93 {
95 }
constexpr SkColor SK_ColorWHITE
Definition: SkColor.h:122
void setBGColor(SkColor)
Definition: gm.cpp:159

Member Function Documentation

◆ getISize()

SkISize skiagm::BitmapPremulGM::getISize ( )
inlineoverrideprotectedvirtual

Implements skiagm::GM.

Definition at line 100 of file bitmappremul.cpp.

100{ return SkISize::Make(SLIDE_SIZE * 2, SLIDE_SIZE * 2); }
constexpr int SLIDE_SIZE
static constexpr SkISize Make(int32_t w, int32_t h)
Definition: SkSize.h:20

◆ getName()

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

Implements skiagm::GM.

Definition at line 98 of file bitmappremul.cpp.

98{ return SkString("bitmap_premul"); }

◆ onDraw()

void skiagm::BitmapPremulGM::onDraw ( SkCanvas canvas)
inlineoverrideprotectedvirtual

Reimplemented from skiagm::GM.

Definition at line 102 of file bitmappremul.cpp.

102 {
103 SkScalar slideSize = SkIntToScalar(SLIDE_SIZE);
104 canvas->drawImage(make_argb8888_gradient(), 0, 0);
105 canvas->drawImage(make_argb4444_gradient(), slideSize, 0);
106 canvas->drawImage(make_argb8888_stripes(), 0, slideSize);
107 canvas->drawImage(make_argb4444_stripes(), slideSize, slideSize);
108 }
#define SkIntToScalar(x)
Definition: SkScalar.h:57
static sk_sp< SkImage > make_argb4444_stripes()
static sk_sp< SkImage > make_argb4444_gradient()
static sk_sp< SkImage > make_argb8888_gradient()
static sk_sp< SkImage > make_argb8888_stripes()
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
Definition: SkCanvas.h:1528
float SkScalar
Definition: extension.cpp:12

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