29 if (v0.mode() != v1.
mode()) {
39 if (!!v0.texCoords() != !!v1.
texCoords()) {
42 if (!!v0.colors() != !!v1.
colors()) {
46 for (
int i = 0; i < v0.vertexCount(); ++i) {
47 if (v0.positions()[i] != v1.
positions()[i]) {
51 if (v0.texCoords()[i] != v1.
texCoords()[i]) {
56 if (v0.colors()[i] != v1.
colors()[i]) {
61 for (
int i = 0; i < v0.indexCount(); ++i) {
62 if (v0.indices()[i] != v1.
indices()[i]) {
71 v0->priv().encode(writer);
74 writer.writeToMemory(buf.
get());
93 for (
auto texF : texFlags) {
94 for (
auto colF : colFlags) {
95 uint32_t
flags = texF | colF;
99 for (
int i = 0; i < vCount; ++i) {
101 builder.positions()[i].set(
x, 1);
102 if (builder.texCoords()) {
103 builder.texCoords()[i].set(
x, 2);
105 if (builder.colors()) {
109 for (
int i = 0; i < iCount; ++i) {
110 builder.indices()[i] = i % vCount;
150 SkColor colors[] = { c, c, c };
161 SkPoint pts[] = { { -10, 1 }, { -10, 2 }, { 1e9f, 1.5f } };
166 while (
void* addr = iter.
next(&loc)) {
static constexpr SkColor SkColorSetARGB(U8CPU a, U8CPU r, U8CPU g, U8CPU b)
constexpr SkColor SK_ColorBLACK
#define DEF_TEST(name, reporter)
#define REPORTER_ASSERT(r, cond,...)
static void fill_triangle(SkCanvas *canvas, const SkPoint pts[], SkColor c)
static bool equal(const SkVertices *vert0, const SkVertices *vert1)
static void self_test(const sk_sp< SkVertices > &v0, skiatest::Reporter *reporter)
void drawVertices(const SkVertices *vertices, SkBlendMode mode, const SkPaint &paint)
SkVertices::VertexMode mode() const
const SkColor * colors() const
const uint16_t * indices() const
const SkPoint * texCoords() const
static sk_sp< SkVertices > Decode(SkReadBuffer &)
const SkPoint * positions() const
@ kHasTexCoords_BuilderFlag
static sk_sp< SkVertices > MakeCopy(VertexMode mode, int vertexCount, const SkPoint positions[], const SkPoint texs[], const SkColor colors[], int indexCount, const uint16_t indices[])
@ kTriangleFan_VertexMode
FlutterSemanticsFlag flags
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
static SkImageInfo MakeN32Premul(int width, int height)