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

Public Member Functions

 SpriteBitmapGM ()
 
- 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

Compare output of drawSprite and drawBitmap (esp. clipping and imagefilters)

Definition at line 66 of file spritebitmap.cpp.

Constructor & Destructor Documentation

◆ SpriteBitmapGM()

SpriteBitmapGM::SpriteBitmapGM ( )
inline

Definition at line 68 of file spritebitmap.cpp.

68{}

Member Function Documentation

◆ getISize()

SkISize SpriteBitmapGM::getISize ( )
inlineoverrideprotectedvirtual

Implements skiagm::GM.

Definition at line 73 of file spritebitmap.cpp.

73{ return SkISize::Make(640, 480); }
static constexpr SkISize Make(int32_t w, int32_t h)
Definition: SkSize.h:20

◆ getName()

SkString SpriteBitmapGM::getName ( ) const
inlineoverrideprotectedvirtual

Implements skiagm::GM.

Definition at line 71 of file spritebitmap.cpp.

71{ return SkString("spritebitmap"); }

◆ onDraw()

void SpriteBitmapGM::onDraw ( SkCanvas canvas)
inlineoverrideprotectedvirtual

Reimplemented from skiagm::GM.

Definition at line 75 of file spritebitmap.cpp.

75 {
76 SkBitmap bm;
77 make_bm(&bm);
78
79 int dx = 10;
80 int dy = 10;
81
82 SkScalar sigma = 8;
83 sk_sp<SkImageFilter> filter(SkImageFilters::Blur(sigma, sigma, nullptr));
84
85 draw_1_bitmap(canvas, bm, false, dx, dy, nullptr);
86 dy += bm.height() + 20;
87 draw_1_bitmap(canvas, bm, false, dx, dy, filter);
88 dy += bm.height() + 20;
89 draw_1_bitmap(canvas, bm, true, dx, dy, nullptr);
90 dy += bm.height() + 20;
91 draw_1_bitmap(canvas, bm, true, dx, dy, filter);
92 }
int height() const
Definition: SkBitmap.h:158
static sk_sp< SkImageFilter > Blur(SkScalar sigmaX, SkScalar sigmaY, SkTileMode tileMode, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
float SkScalar
Definition: extension.cpp:12
skia_private::AutoTArray< sk_sp< SkImageFilter > > filters TypedMatrix matrix TypedMatrix matrix SkScalar dx
Definition: SkRecords.h:208
static void draw_1_bitmap(SkCanvas *canvas, const SkBitmap &bm, bool doClip, int dx, int dy, sk_sp< SkImageFilter > filter)
static void make_bm(SkBitmap *bm)

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