31 const SkPoint pts[] = { { 100.f / 4.f, 0.f }, { 3.f * 100.f / 4.f, 100.f } };
50 paint.setStrokeWidth(0.5f);
51 SkPoint corners[4] = { bottom[0], bottom[3], top[0], top[3] };
62 paint.setStrokeWidth(2);
83 {100,100},{150,50},{250,150}, {300,100},
87 {300,300},{250,250},{150,350},{100,300},
93 {0.0f, 0.0f}, {100.0f, 0.0f}, {100.0f,100.0f}, {0.0f, 100.0f}
116 texStorage[0].
set(0, 0);
117 texStorage[1].
set(
w, 0);
118 texStorage[2].
set(
w,
h);
119 texStorage[3].
set(0,
h);
126 for (
int y = 0;
y < 3;
y++) {
127 for (
int x = 0;
x < 4;
x++) {
138 paint.setShader(shader);
140 paint.setShader(
nullptr);
143 paint.setShader(shader);
145 paint.setShader(
nullptr);
162 dopatch(canvas, colors,
nullptr,
nullptr);
176 localM[6] = 0.00001f;
183 dopatch(canvas, colors,
nullptr,
nullptr);
188 canvas->translate(-75, -75);
191 0x80FF0000, 0x80FF0000, 0x80FF0000, 0x80FF0000,
196 canvas->translate(300, 0);
204 paint.setColor(colors[0]);
205 canvas->drawPath(path,
paint);
@ kColorDodge
brighten destination to reflect source
constexpr SkColor SK_ColorYELLOW
constexpr SkColor SK_ColorMAGENTA
constexpr SkColor SK_ColorCYAN
constexpr SkColor SK_ColorBLUE
constexpr SkColor SK_ColorRED
constexpr SkColor SK_ColorBLACK
constexpr SkColor SK_ColorGREEN
constexpr SkColor SK_ColorWHITE
static bool left(const SkPoint &p0, const SkPoint &p1)
static bool right(const SkPoint &p0, const SkPoint &p1)
void drawPoints(PointMode mode, size_t count, const SkPoint pts[], const SkPaint &paint)
void drawPatch(const SkPoint cubics[12], const SkColor colors[4], const SkPoint texCoords[4], SkBlendMode mode, const SkPaint &paint)
void translate(SkScalar dx, SkScalar dy)
@ kLines_PointMode
draw each pair of points as a line segment
@ kPoints_PointMode
draw each point separately
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)
static void GetTopCubic(const SkPoint cubics[12], SkPoint points[4])
static void GetRightCubic(const SkPoint cubics[12], SkPoint points[4])
static void GetLeftCubic(const SkPoint cubics[12], SkPoint points[4])
static void GetBottomCubic(const SkPoint cubics[12], SkPoint points[4])
#define DEF_SIMPLE_GM(NAME, CANVAS, W, H)
static void dopatch(SkCanvas *canvas, const SkColor colors[], sk_sp< SkImage > img, const SkMatrix *localMatrix)
const SkPoint gTexCoords[SkPatchUtils::kNumCorners]
const SkPoint gCubics[SkPatchUtils::kNumCtrlPts]
static sk_sp< SkShader > make_shader()
static void draw_control_points(SkCanvas *canvas, const SkPoint cubics[12])
void set(float x, float y)