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

Public Member Functions

 TiledScaledBitmapGM ()
 
- 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 onOnceBeforeDraw () 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
 

Static Protected Member Functions

static SkBitmap make_bm (int width, int height)
 

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 28 of file tiledscaledbitmap.cpp.

Constructor & Destructor Documentation

◆ TiledScaledBitmapGM()

skiagm::TiledScaledBitmapGM::TiledScaledBitmapGM ( )
inline

Definition at line 31 of file tiledscaledbitmap.cpp.

31 {
32 }

Member Function Documentation

◆ getISize()

SkISize skiagm::TiledScaledBitmapGM::getISize ( )
inlineoverrideprotectedvirtual

Implements skiagm::GM.

Definition at line 37 of file tiledscaledbitmap.cpp.

37{ return SkISize::Make(1016, 616); }
static constexpr SkISize Make(int32_t w, int32_t h)
Definition: SkSize.h:20

◆ getName()

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

Implements skiagm::GM.

Definition at line 35 of file tiledscaledbitmap.cpp.

35{ return SkString("tiledscaledbitmap"); }

◆ make_bm()

static SkBitmap skiagm::TiledScaledBitmapGM::make_bm ( int  width,
int  height 
)
inlinestaticprotected

Definition at line 39 of file tiledscaledbitmap.cpp.

39 {
40 SkBitmap bm;
43 SkCanvas canvas(bm);
45 paint.setAntiAlias(true);
46 canvas.drawCircle(width/2.f, height/2.f, width/4.f, paint);
47 return bm;
48 }
constexpr SkColor SK_ColorTRANSPARENT
Definition: SkColor.h:99
void allocN32Pixels(int width, int height, bool isOpaque=false)
Definition: SkBitmap.cpp:232
void eraseColor(SkColor4f) const
Definition: SkBitmap.cpp:442
SkScalar width()
Definition: gm.h:159
SkScalar height()
Definition: gm.h:162
const Paint & paint
Definition: color_source.cc:38

◆ onDraw()

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

Reimplemented from skiagm::GM.

Definition at line 54 of file tiledscaledbitmap.cpp.

54 {
56
57 paint.setAntiAlias(true);
58
59 SkMatrix mat;
60 mat.setScale(121.f/360.f, 93.f/288.f);
61 mat.postTranslate(-72, -72);
62
65 canvas->drawRect({ 8, 8, 1008, 608 }, paint);
66 }
sk_sp< SkShader > makeShader(SkTileMode tmx, SkTileMode tmy, const SkSamplingOptions &, const SkMatrix *localMatrix=nullptr) const
Definition: SkBitmap.cpp:669
void drawRect(const SkRect &rect, const SkPaint &paint)
Definition: SkCanvas.cpp:1673
SkMatrix & postTranslate(SkScalar dx, SkScalar dy)
Definition: SkMatrix.cpp:281
SkMatrix & setScale(SkScalar sx, SkScalar sy, SkScalar px, SkScalar py)
Definition: SkMatrix.cpp:296
static constexpr SkCubicResampler Mitchell()

◆ onOnceBeforeDraw()

void skiagm::TiledScaledBitmapGM::onOnceBeforeDraw ( )
inlineoverrideprotectedvirtual

Reimplemented from skiagm::GM.

Definition at line 50 of file tiledscaledbitmap.cpp.

50 {
51 fBitmap = make_bm(360, 288);
52 }
static SkBitmap make_bm(int width, int height)

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