20#include <initializer_list>
29 constexpr SkRect kRect {0, 0, 100, 100};
30 constexpr SkPoint kPts[] {{kRect.fLeft, kRect.fTop}, {kRect.fRight, kRect.fBottom}};
37 canvas->translate(kRect.centerX(), kRect.centerY());
39 for (
auto aa : {
false,
true}) {
41 paint.setShader(shader);
43 paint.setAntiAlias(aa);
51 canvas->drawRect(kRect,
paint);
52 canvas->translate(kRect.width() +
kPad, 0);
55 canvas->drawRect(kRect,
paint);
56 canvas->translate(kRect.width() +
kPad, 0);
59 paint.setStrokeMiter(0.01f);
60 canvas->drawRect(kRect,
paint);
61 canvas->translate(kRect.width() +
kPad, 0);
64 canvas->drawRect(kRect,
paint);
65 canvas->translate(kRect.width() +
kPad, 0);
67 paint.setStrokeWidth(0);
68 canvas->drawRect(kRect,
paint);
71 canvas->translate(0, kRect.height() +
kPad);
constexpr SkColor SK_ColorBLUE
constexpr SkColor SK_ColorRED
static sk_sp< SkShader > MakeLinear(const SkPoint pts[2], const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, uint32_t flags=0, const SkMatrix *localMatrix=nullptr)
@ kStroke_Style
set to stroke geometry
@ kMiter_Join
extends to miter limit
@ kBevel_Join
connects outside edges
static constexpr SkPoint kPts[kPtsCount]
DEF_SIMPLE_GM(hugebitmapshader, canvas, 100, 100)
static constexpr float kStrokeWidth