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

Public Member Functions

 DrawBitmapRect3 ()
 
- 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 135 of file bitmaprect.cpp.

Constructor & Destructor Documentation

◆ DrawBitmapRect3()

DrawBitmapRect3::DrawBitmapRect3 ( )
inline

Definition at line 137 of file bitmaprect.cpp.

137 {
139 }
constexpr SkColor SK_ColorBLACK
Definition: SkColor.h:103
void setBGColor(SkColor)
Definition: gm.cpp:159

Member Function Documentation

◆ getISize()

SkISize DrawBitmapRect3::getISize ( )
inlineoverrideprotectedvirtual

Implements skiagm::GM.

Definition at line 148 of file bitmaprect.cpp.

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

◆ getName()

SkString DrawBitmapRect3::getName ( ) const
inlineoverrideprotectedvirtual

Implements skiagm::GM.

Definition at line 142 of file bitmaprect.cpp.

142 {
143 SkString str;
144 str.printf("3x3bitmaprect");
145 return str;
146 }
void printf(const char format[],...) SK_PRINTF_LIKE(2
Definition: SkString.cpp:534

◆ onDraw()

void DrawBitmapRect3::onDraw ( SkCanvas canvas)
inlineoverrideprotectedvirtual

Reimplemented from skiagm::GM.

Definition at line 150 of file bitmaprect.cpp.

150 {
151
154
155 SkRect srcR = { 0.5f, 0.5f, 2.5f, 2.5f };
156 SkRect dstR = { 100, 100, 300, 200 };
157
158 canvas->drawImageRect(ToolUtils::MakeTextureImage(canvas, bitmap.asImage()),
159 srcR, dstR, SkSamplingOptions(),
161 }
static void make_3x3_bitmap(SkBitmap *bitmap)
Definition: bitmaprect.cpp:106
@ kStrict_SrcRectConstraint
sample only inside bounds; slower
Definition: SkCanvas.h:1542
void drawImageRect(const SkImage *, const SkRect &src, const SkRect &dst, const SkSamplingOptions &, const SkPaint *, SrcRectConstraint)
Definition: SkCanvas.cpp:2333
sk_sp< SkImage > MakeTextureImage(SkCanvas *canvas, sk_sp< SkImage > orig)
Definition: bitmap.py:1

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