Revert[2] "More SkVertices implementation work""
The fix was to release the array of vertices in the picturerecorder
destructor (where we also release textblobs etc.
This reverts commit 1eb3fef136bc75bd8e8ed717ec7c5d4ab26def62.
BUG=skia:
Change-Id: I3bf4acd6ad209205b0832a3cb7f94cd89dfcefc5
Reviewed-on: https://skia-review.googlesource.com/9826
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
diff --git a/src/core/SkRecorder.cpp b/src/core/SkRecorder.cpp
index fb0bda7..9b38bcd 100644
--- a/src/core/SkRecorder.cpp
+++ b/src/core/SkRecorder.cpp
@@ -331,15 +331,13 @@
const SkPoint texs[], const SkColor colors[],
SkBlendMode bmode,
const uint16_t indices[], int indexCount, const SkPaint& paint) {
- APPEND(DrawVertices, paint,
- vmode,
- vertexCount,
- this->copy(vertices, vertexCount),
- texs ? this->copy(texs, vertexCount) : nullptr,
- colors ? this->copy(colors, vertexCount) : nullptr,
- bmode,
- this->copy(indices, indexCount),
- indexCount);
+ this->onDrawVerticesObject(SkVertices::MakeCopy(vmode, vertexCount, vertices, texs, colors,
+ indexCount, indices).get(), bmode, paint);
+}
+
+void SkRecorder::onDrawVerticesObject(const SkVertices* vertices, SkBlendMode bmode,
+ const SkPaint& paint) {
+ APPEND(DrawVertices, paint, sk_ref_sp(const_cast<SkVertices*>(vertices)), bmode);
}
void SkRecorder::onDrawPatch(const SkPoint cubics[12], const SkColor colors[4],