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

Public Member Functions

 ImageBlurTiledGM (SkScalar sigmaX, SkScalar sigmaY)
 
- 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 28 of file imageblurtiled.cpp.

Constructor & Destructor Documentation

◆ ImageBlurTiledGM()

skiagm::ImageBlurTiledGM::ImageBlurTiledGM ( SkScalar  sigmaX,
SkScalar  sigmaY 
)
inline

Definition at line 30 of file imageblurtiled.cpp.

31 : fSigmaX(sigmaX), fSigmaY(sigmaY) {
32 }

Member Function Documentation

◆ getISize()

SkISize skiagm::ImageBlurTiledGM::getISize ( )
inlineoverrideprotectedvirtual

Implements skiagm::GM.

Definition at line 37 of file imageblurtiled.cpp.

37{ return SkISize::Make(WIDTH, HEIGHT); }
#define WIDTH
#define HEIGHT
static constexpr SkISize Make(int32_t w, int32_t h)
Definition: SkSize.h:20

◆ getName()

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

Implements skiagm::GM.

Definition at line 35 of file imageblurtiled.cpp.

35{ return SkString("imageblurtiled"); }

◆ onDraw()

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

Reimplemented from skiagm::GM.

Definition at line 39 of file imageblurtiled.cpp.

39 {
41 paint.setImageFilter(SkImageFilters::Blur(fSigmaX, fSigmaY, nullptr));
42 const SkScalar tileSize = SkIntToScalar(128);
44 for (SkScalar y = bounds.top(); y < bounds.bottom(); y += tileSize) {
45 for (SkScalar x = bounds.left(); x < bounds.right(); x += tileSize) {
46 canvas->save();
47 canvas->clipRect(SkRect::MakeXYWH(x, y, tileSize, tileSize));
48 canvas->saveLayer(nullptr, &paint);
49 const char* str[] = {
50 "The quick",
51 "brown fox",
52 "jumped over",
53 "the lazy dog.",
54 };
56 int posY = 0;
57 for (unsigned i = 0; i < std::size(str); i++) {
58 posY += 100;
59 canvas->drawString(str[i], 0, SkIntToScalar(posY), font, SkPaint());
60 }
61 canvas->restore();
62 canvas->restore();
63 }
64 }
65 }
#define SkIntToScalar(x)
Definition: SkScalar.h:57
int saveLayer(const SkRect *bounds, const SkPaint *paint)
Definition: SkCanvas.cpp:496
void clipRect(const SkRect &rect, SkClipOp op, bool doAntiAlias)
Definition: SkCanvas.cpp:1361
void restore()
Definition: SkCanvas.cpp:461
SkRect getLocalClipBounds() const
Definition: SkCanvas.cpp:1586
int save()
Definition: SkCanvas.cpp:447
void drawString(const char str[], SkScalar x, SkScalar y, const SkFont &font, const SkPaint &paint)
Definition: SkCanvas.h:1803
Definition: SkFont.h:35
static sk_sp< SkImageFilter > Blur(SkScalar sigmaX, SkScalar sigmaY, SkTileMode tileMode, sk_sp< SkImageFilter > input, const CropRect &cropRect={})
const Paint & paint
Definition: color_source.cc:38
float SkScalar
Definition: extension.cpp:12
double y
double x
Optional< SkRect > bounds
Definition: SkRecords.h:189
sk_sp< SkTypeface > DefaultPortableTypeface()
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition: switches.h:259
font
Font Metadata and Metrics.
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
Definition: SkRect.h:659

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