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

Public Member Functions

 BlurredClippedCircleGM ()
 
- 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 26 of file blurredclippedcircle.cpp.

Constructor & Destructor Documentation

◆ BlurredClippedCircleGM()

skiagm::BlurredClippedCircleGM::BlurredClippedCircleGM ( )
inline

Definition at line 28 of file blurredclippedcircle.cpp.

28 {
29 this->setBGColor(0xFFCCCCCC);
30 }
void setBGColor(SkColor)
Definition: gm.cpp:159

Member Function Documentation

◆ getISize()

SkISize skiagm::BlurredClippedCircleGM::getISize ( )
inlineoverrideprotectedvirtual

Implements skiagm::GM.

Definition at line 35 of file blurredclippedcircle.cpp.

35{ return SkISize::Make(kWidth, kHeight); }
static constexpr SkISize Make(int32_t w, int32_t h)
Definition: SkSize.h:20

◆ getName()

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

Implements skiagm::GM.

Definition at line 33 of file blurredclippedcircle.cpp.

33{ return SkString("blurredclippedcircle"); }

◆ onDraw()

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

Reimplemented from skiagm::GM.

Definition at line 37 of file blurredclippedcircle.cpp.

37 {
38 SkPaint whitePaint;
39 whitePaint.setColor(SK_ColorWHITE);
41 whitePaint.setAntiAlias(true);
42
43 // This scale exercises precision limits in the circle blur effect (crbug.com/560651)
44 constexpr float kScale = 2.0f;
45 canvas->scale(kScale, kScale);
46
47 canvas->save();
48 SkRect clipRect1 = SkRect::MakeLTRB(0, 0, kWidth, kHeight);
49 canvas->clipRect(clipRect1);
50
51 canvas->save();
52
53 canvas->clipRect(clipRect1);
54 canvas->drawRect(clipRect1, whitePaint);
55
56 canvas->save();
57
58 SkRect clipRect2 = SkRect::MakeLTRB(8, 8, 288, 288);
61
62 SkRect r = SkRect::MakeLTRB(4, 4, 292, 292);
64
66
67 paint.setMaskFilter(SkMaskFilter::MakeBlur(
69 1.366025f));
71 paint.setAntiAlias(true);
72
73 canvas->drawRRect(rr, paint);
74
75 canvas->restore();
76 canvas->restore();
77 canvas->restore();
78 }
@ kSrcIn
r = s * da
@ kNormal_SkBlurStyle
fuzzy inside and outside
Definition: SkBlurTypes.h:12
constexpr SkColor SK_ColorRED
Definition: SkColor.h:126
constexpr SkColor SK_ColorWHITE
Definition: SkColor.h:122
void drawRect(const SkRect &rect, const SkPaint &paint)
Definition: SkCanvas.cpp:1673
void clipRect(const SkRect &rect, SkClipOp op, bool doAntiAlias)
Definition: SkCanvas.cpp:1361
void restore()
Definition: SkCanvas.cpp:461
void drawRRect(const SkRRect &rrect, const SkPaint &paint)
Definition: SkCanvas.cpp:1705
int save()
Definition: SkCanvas.cpp:447
void scale(SkScalar sx, SkScalar sy)
Definition: SkCanvas.cpp:1289
void clipRRect(const SkRRect &rrect, SkClipOp op, bool doAntiAlias)
Definition: SkCanvas.cpp:1439
static sk_sp< SkColorFilter > Blend(const SkColor4f &c, sk_sp< SkColorSpace >, SkBlendMode mode)
static sk_sp< SkMaskFilter > MakeBlur(SkBlurStyle style, SkScalar sigma, bool respectCTM=true)
void setColor(SkColor color)
Definition: SkPaint.cpp:119
void setAntiAlias(bool aa)
Definition: SkPaint.h:170
void setBlendMode(SkBlendMode mode)
Definition: SkPaint.cpp:151
static SkRRect MakeOval(const SkRect &oval)
Definition: SkRRect.h:162
const Paint & paint
Definition: color_source.cc:38
clipRRect(r.rrect, r.opAA.op(), r.opAA.aa())) DRAW(ClipRect
static constexpr SkRect MakeLTRB(float l, float t, float r, float b)
Definition: SkRect.h:646

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