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

Public Member Functions

 BmpFilterQualityRepeat ()
 
- 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 28 of file bmpfilterqualityrepeat.cpp.

Constructor & Destructor Documentation

◆ BmpFilterQualityRepeat()

BmpFilterQualityRepeat::BmpFilterQualityRepeat ( )
inline

Definition at line 30 of file bmpfilterqualityrepeat.cpp.

30{ this->setBGColor(ToolUtils::color_to_565(0xFFCCBBAA)); }
void setBGColor(SkColor)
Definition: gm.cpp:159
SkColor color_to_565(SkColor color)
Definition: ToolUtils.cpp:139

Member Function Documentation

◆ getISize()

SkISize BmpFilterQualityRepeat::getISize ( )
inlineoverrideprotectedvirtual

Implements skiagm::GM.

Definition at line 51 of file bmpfilterqualityrepeat.cpp.

51{ return SkISize::Make(1000, 400); }
static constexpr SkISize Make(int32_t w, int32_t h)
Definition: SkSize.h:20

◆ getName()

SkString BmpFilterQualityRepeat::getName ( ) const
inlineoverrideprotectedvirtual

Implements skiagm::GM.

Definition at line 49 of file bmpfilterqualityrepeat.cpp.

49{ return SkString("bmp_filter_quality_repeat"); }

◆ onDraw()

void BmpFilterQualityRepeat::onDraw ( SkCanvas canvas)
inlineoverrideprotectedvirtual

Reimplemented from skiagm::GM.

Definition at line 53 of file bmpfilterqualityrepeat.cpp.

53 {
54 this->drawAll(canvas, 2.5f);
55 canvas->translate(0, 250);
56 canvas->scale(0.5, 0.5);
57 this->drawAll(canvas, 1);
58 }
void translate(SkScalar dx, SkScalar dy)
Definition: SkCanvas.cpp:1278
void scale(SkScalar sx, SkScalar sy)
Definition: SkCanvas.cpp:1289

◆ onOnceBeforeDraw()

void BmpFilterQualityRepeat::onOnceBeforeDraw ( )
inlineoverrideprotectedvirtual

Reimplemented from skiagm::GM.

Definition at line 34 of file bmpfilterqualityrepeat.cpp.

34 {
35 fBmp.allocN32Pixels(40, 40, true);
36 SkCanvas canvas(fBmp);
37 SkBitmap colorBmp;
38 colorBmp.allocN32Pixels(20, 20, true);
39 colorBmp.eraseColor(0xFFFF0000);
40 canvas.drawImage(colorBmp.asImage(), 0, 0);
41 colorBmp.eraseColor(ToolUtils::color_to_565(0xFF008200));
42 canvas.drawImage(colorBmp.asImage(), 20, 0);
43 colorBmp.eraseColor(ToolUtils::color_to_565(0xFFFF9000));
44 canvas.drawImage(colorBmp.asImage(), 0, 20);
45 colorBmp.eraseColor(ToolUtils::color_to_565(0xFF2000FF));
46 canvas.drawImage(colorBmp.asImage(), 20, 20);
47 }
sk_sp< SkImage > asImage() const
Definition: SkBitmap.cpp:645
void allocN32Pixels(int width, int height, bool isOpaque=false)
Definition: SkBitmap.cpp:232
void eraseColor(SkColor4f) const
Definition: SkBitmap.cpp:442

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