Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
draw_vertices.cpp
Go to the documentation of this file.
1// Copyright 2020 Google LLC.
2// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
4REG_FIDDLE(draw_vertices, 256, 256, false, 6) {
5// draw_vertices
6void draw(SkCanvas* canvas) {
7 SkPaint p;
8 p.setAntiAlias(true);
9
10 SkPoint pts[3] = {{64, 32}, {0, 224}, {128, 224}};
12 canvas->drawVertices(
15
16 canvas->translate(120, 0);
17
19 SkPoint texs[3] = {{0, 0}, {0, 128}, {64, 256}};
20 canvas->drawVertices(
23}
24} // END FIDDLE
@ kSrcOver
r = s + (1-sa)*d
uint32_t SkColor
Definition SkColor.h:37
constexpr SkColor SK_ColorBLUE
Definition SkColor.h:135
constexpr SkColor SK_ColorRED
Definition SkColor.h:126
constexpr SkColor SK_ColorGREEN
Definition SkColor.h:131
static void draw(SkCanvas *canvas, SkRect &target, int x, int y)
Definition aaclip.cpp:27
void translate(SkScalar dx, SkScalar dy)
void drawVertices(const SkVertices *vertices, SkBlendMode mode, const SkPaint &paint)
sk_sp< SkShader > makeShader(SkTileMode tmx, SkTileMode tmy, const SkSamplingOptions &, const SkMatrix *localMatrix=nullptr) const
Definition SkImage.cpp:179
static sk_sp< SkVertices > MakeCopy(VertexMode mode, int vertexCount, const SkPoint positions[], const SkPoint texs[], const SkColor colors[], int indexCount, const uint16_t indices[])
@ kTriangles_VertexMode
Definition SkVertices.h:31
sk_sp< SkImage > image
Definition examples.cpp:29
#define REG_FIDDLE(NAME, W, H, TEXT, I)
Definition examples.h:60
static void draw_vertices(SkCanvas *canvas, SkImage *image)