Flutter Engine
The Flutter Engine
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) {
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
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)
Definition: SkCanvas.cpp:1278
void drawVertices(const SkVertices *vertices, SkBlendMode mode, const SkPaint &paint)
Definition: SkCanvas.cpp:1720
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[])
Definition: SkVertices.cpp:200
@ kTriangles_VertexMode
Definition: SkVertices.h:31
REG_FIDDLE(draw_vertices, 256, 256, false, 6)
PODArray< SkRect > texs
Definition: SkRecords.h:333
sk_sp< const SkImage > image
Definition: SkRecords.h:269
PODArray< SkColor > colors
Definition: SkRecords.h:276
static void draw_vertices(SkCanvas *canvas, SkImage *image)
Definition: savelayer.cpp:195