Flutter Engine
The Flutter Engine
Functions
skbug_9319.cpp File Reference
#include "gm/gm.h"
#include "include/core/SkBlurTypes.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkMaskFilter.h"
#include "include/core/SkPaint.h"
#include "include/core/SkRRect.h"
#include "include/core/SkRect.h"

Go to the source code of this file.

Functions

 DEF_SIMPLE_GM (skbug_9319, canvas, 256, 512)
 

Function Documentation

◆ DEF_SIMPLE_GM()

DEF_SIMPLE_GM ( skbug_9319  ,
canvas  ,
256  ,
512   
)

Definition at line 17 of file skbug_9319.cpp.

17 {
18 SkPaint p;
19 p.setAntiAlias(true);
20 p.setMaskFilter(SkMaskFilter::MakeBlur(kNormal_SkBlurStyle, 0.5f));
21
22 const auto r = SkRect::MakeXYWH(10, 10, 100, 100);
23
24 {
25 SkAutoCanvasRestore acr(canvas, true);
26 // Clip out interior so that the outer portion stands out.
27 canvas->clipRect(r, SkClipOp::kDifference);
28 canvas->drawRect(r, p);
29 }
30
31 canvas->translate(0, 120);
32
33
34 // RRect for comparison.
35 const auto rr = SkRRect::MakeRectXY(r, .1f, .1f);
36 {
37 SkAutoCanvasRestore acr(canvas, true);
38 canvas->clipRRect(rr, SkClipOp::kDifference);
39 canvas->drawRRect(rr, p);
40 }
41}
@ kNormal_SkBlurStyle
fuzzy inside and outside
Definition: SkBlurTypes.h:12
static sk_sp< SkMaskFilter > MakeBlur(SkBlurStyle style, SkScalar sigma, bool respectCTM=true)
static SkRRect MakeRectXY(const SkRect &rect, SkScalar xRad, SkScalar yRad)
Definition: SkRRect.h:180
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
Definition: SkRect.h:659