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

Public Member Functions

 ImageBlurRepeatModeGM ()
 
- 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
 
bool runAsBench () const 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 77 of file imageblurrepeatmode.cpp.

Constructor & Destructor Documentation

◆ ImageBlurRepeatModeGM()

skiagm::ImageBlurRepeatModeGM::ImageBlurRepeatModeGM ( )
inline

Definition at line 79 of file imageblurrepeatmode.cpp.

79 {
80 this->setBGColor(0xFFCCCCCC);
81 }
void setBGColor(SkColor)
Definition: gm.cpp:159

Member Function Documentation

◆ getISize()

SkISize skiagm::ImageBlurRepeatModeGM::getISize ( )
inlineoverrideprotectedvirtual

Implements skiagm::GM.

Definition at line 86 of file imageblurrepeatmode.cpp.

86{ return SkISize::Make(850, 920); }
static constexpr SkISize Make(int32_t w, int32_t h)
Definition: SkSize.h:20

◆ getName()

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

Implements skiagm::GM.

Definition at line 84 of file imageblurrepeatmode.cpp.

84{ return SkString("imageblurrepeatmode"); }

◆ onDraw()

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

Reimplemented from skiagm::GM.

Definition at line 90 of file imageblurrepeatmode.cpp.

90 {
92 { make_image(canvas, 1), make_image(canvas, 2), make_image(canvas, 3) };
94
95 canvas->translate(0, 30);
96 // Test different kernel size, including the one to launch 2d Gaussian
97 // blur.
98 for (auto sigma: { 0.6f, 3.0f, 8.0f, 20.0f }) {
99 // FIXME crops
100 canvas->save();
101 filter = SkImageFilters::Blur(
102 sigma, 0.0f, SkTileMode::kRepeat, nullptr, image[0]->bounds());
103 draw_image(canvas, image[0], std::move(filter));
104 canvas->translate(image[0]->width() + 20, 0);
105
106 filter = SkImageFilters::Blur(
107 0.0f, sigma, SkTileMode::kRepeat, nullptr, image[1]->bounds());
108 draw_image(canvas, image[1], std::move(filter));
109 canvas->translate(image[1]->width() + 20, 0);
110
111 filter = SkImageFilters::Blur(
112 sigma, sigma, SkTileMode::kRepeat, nullptr, image[2]->bounds());
113 draw_image(canvas, image[2], std::move(filter));
114 canvas->translate(image[2]->width() + 20, 0);
115
116 canvas->restore();
117 canvas->translate(0, image[0]->height() + 20);
118 }
119 }
void restore()
Definition: SkCanvas.cpp:461
void translate(SkScalar dx, SkScalar dy)
Definition: SkCanvas.cpp:1278
int save()
Definition: SkCanvas.cpp:447
static sk_sp< SkImageFilter > Blur(SkScalar sigmaX, SkScalar sigmaY, SkTileMode tileMode, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
SkScalar width()
Definition: gm.h:159
SkScalar height()
Definition: gm.h:162
static void draw_image(SkCanvas *canvas, const sk_sp< SkImage > image, sk_sp< SkImageFilter > filter)
Optional< SkRect > bounds
Definition: SkRecords.h:189
sk_sp< const SkImage > image
Definition: SkRecords.h:269
static sk_sp< SkImage > make_image(SkColorType colorType, SkAlphaType alphaType)

◆ runAsBench()

bool skiagm::ImageBlurRepeatModeGM::runAsBench ( ) const
inlineoverrideprotectedvirtual

Reimplemented from skiagm::GM.

Definition at line 88 of file imageblurrepeatmode.cpp.

88{ return true; }

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