FuzzCanvas: fix drawVertices BUG=skia:6314

Change-Id: I5f55a0fc03d4fe780b35529df9eeb385639501f2
Reviewed-on: https://skia-review.googlesource.com/9173
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
This commit is contained in:
Hal Canary 2017-03-02 15:27:23 -05:00 committed by Skia Commit-Bot
parent cd667b6e58
commit 68b9b57638

View File

@ -1097,7 +1097,6 @@ void fuzz_canvas(Fuzz* fuzz, SkCanvas* canvas, int depth = 4) {
SkPoint vertices[kMaxCount];
SkPoint texs[kMaxCount];
SkColor colors[kMaxCount];
uint16_t indices[kMaxCount];
fuzz->nextRange(&vertexCount, 3, kMaxCount);
fuzz->nextN(vertices, vertexCount);
bool useTexs, useColors;
@ -1109,8 +1108,12 @@ void fuzz_canvas(Fuzz* fuzz, SkCanvas* canvas, int depth = 4) {
fuzz->nextN(colors, vertexCount);
}
int indexCount = 0;
uint16_t indices[kMaxCount * 2];
if (make_bool(fuzz)) {
fuzz->nextRange(&indexCount, 3, kMaxCount);
fuzz->nextRange(&indexCount, vertexCount, vertexCount + kMaxCount);
for (int i = 0; i < indexCount; ++i) {
fuzz->nextRange(&indices[i], 0, vertexCount - 1);
}
}
canvas->drawVertices(vertexMode, vertexCount, vertices,
useTexs ? texs : nullptr,