40 {
41 constexpr int kBig = 65536;
43
45 SkRect insetRect = bigRect;
46 insetRect.
inset(20, 20);
47
51
52
53
54 const SkScalar kLeftTopPad = 3*kSigma;
55 const SkScalar kRightBotPad = kCloseUpSize-3*kSigma;
56
57
59 { -kLeftTopPad, -kLeftTopPad },
60 { kBig-kRightBotPad, -kLeftTopPad },
61 { kBig-kRightBotPad, kBig-kRightBotPad },
62 { -kLeftTopPad, kBig-kRightBotPad },
63 { kBig/2-kCloseUpSize/2, kBig/2-kCloseUpSize/2 },
64 };
65
69
73
74 int desiredX = 0, desiredY = 0;
75
76 for (int i = 0; i < 2; ++i) {
79
80 for (
int k = 0; k < (
int)std::size(origins); ++k) {
82
87
89
91 desiredY-origins[k].fY);
92
93 if (0 == i) {
94 canvas->
drawRect(bigRect, blurPaint);
95 } else {
96 canvas->
drawPath(rectori, blurPaint);
97 }
99 canvas->
drawRect(clipRect, outlinePaint);
100
101 desiredX += kCloseUpSize;
102 }
103
104 desiredX = 0;
105 desiredY += kCloseUpSize;
106 }
107 }
108 }
constexpr SkColor SK_ColorRED
constexpr SkColor SK_ColorBLACK
Type::kYUV Type::kRGBA() int(0.7 *637)
static SkScalar SK_SPI ConvertRadiusToSigma(SkScalar radius)
void drawRect(const SkRect &rect, const SkPaint &paint)
void clipRect(const SkRect &rect, SkClipOp op, bool doAntiAlias)
void translate(SkScalar dx, SkScalar dy)
void drawPath(const SkPath &path, const SkPaint &paint)
static sk_sp< SkMaskFilter > MakeBlur(SkBlurStyle style, SkScalar sigma, bool respectCTM=true)
void setStyle(Style style)
void setColor(SkColor color)
void setAntiAlias(bool aa)
@ kStroke_Style
set to stroke geometry
void setMaskFilter(sk_sp< SkMaskFilter > maskFilter)
SkPathBuilder & addRect(const SkRect &, SkPathDirection, unsigned startIndex)
clipRect(r.rect, r.opAA.op(), r.opAA.aa())) template<> void Draw
void inset(float dx, float dy)
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)
static constexpr SkRect MakeWH(float w, float h)