38static const char*
TILE_NAMES[] = {
"decal",
"repeat",
"mirror",
"clamp" };
78 paint.setStrokeWidth(2.0f);
105 static constexpr SkScalar SWEEP_ANG = 45.0;
107 SWEEP_ANG, SWEEP_ANG, 0,
nullptr);
113 0.0, 0.0, 0,
nullptr);
146 draw_row(canvas,
"sweep-45: empty, blue, blue, red 45 degree sector then green",
149 draw_row(canvas,
"2pt-conic-1: empty, blue, blue, full red circle on green",
constexpr SkColor SK_ColorBLUE
constexpr SkColor SK_ColorRED
constexpr SkColor SK_ColorBLACK
constexpr SkColor SK_ColorGREEN
constexpr SkColor SK_ColorWHITE
static sk_sp< SkShader > make_radial()
SkISize getISize() override
void onDraw(SkCanvas *canvas) override
SkString getName() const override
void drawRect(const SkRect &rect, const SkPaint &paint)
void translate(SkScalar dx, SkScalar dy)
void drawString(const char str[], SkScalar x, SkScalar y, const SkFont &font, const SkPaint &paint)
static sk_sp< SkShader > MakeTwoPointConical(const SkPoint &start, SkScalar startRadius, const SkPoint &end, SkScalar endRadius, const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, uint32_t flags=0, const SkMatrix *localMatrix=nullptr)
static sk_sp< SkShader > MakeSweep(SkScalar cx, SkScalar cy, const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, SkScalar startAngle, SkScalar endAngle, uint32_t flags, const SkMatrix *localMatrix)
static sk_sp< SkShader > MakeRadial(const SkPoint ¢er, SkScalar radius, const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, uint32_t flags=0, const SkMatrix *localMatrix=nullptr)
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)
void setAntiAlias(bool aa)
@ kStrokeAndFill_Style
sets to stroke and fill geometry
static const int COLOR_CT
static void draw_tile_header(SkCanvas *canvas)
static void draw_row(SkCanvas *canvas, const char *desc, GradientFactory factory)
static const SkColor COLORS[]
static sk_sp< SkShader > make_linear(SkTileMode mode)
sk_sp< SkShader >(* GradientFactory)(SkTileMode tm)
static const char * TILE_NAMES[]
static const SkScalar POS[]
static constexpr int TILE_SIZE
static const SkTileMode TILE_MODES[]
static sk_sp< SkShader > make_2pt_conic(SkTileMode mode)
static sk_sp< SkShader > make_sweep(SkTileMode mode)
static const SkPoint CENTER
static constexpr int TILE_GAP
static sk_sp< SkShader > make_2pt_conic_zero_rad(SkTileMode mode)
static const int TILE_MODE_CT
static sk_sp< SkShader > make_sweep_zero_ang(SkTileMode mode)
static constexpr SkISize Make(int32_t w, int32_t h)
static constexpr SkPoint Make(float x, float y)
static constexpr SkRect MakeWH(float w, float h)