diff options
author | Mike Reed <reed@google.com> | 2017-03-17 09:50:46 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-03-17 14:27:33 +0000 |
commit | e88a1cb20e6b4c9f099070112225a88693a4630b (patch) | |
tree | c35774aef5ec56eb377d5bb9ed1ea2694e72efc6 /src/core/SkLiteDL.cpp | |
parent | a392dbaa998e9f137103f7a7e86f89cb7224552f (diff) |
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>
Diffstat (limited to 'src/core/SkLiteDL.cpp')
-rw-r--r-- | src/core/SkLiteDL.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/core/SkLiteDL.cpp b/src/core/SkLiteDL.cpp index b990c70b1a..2da6eb5ef6 100644 --- a/src/core/SkLiteDL.cpp +++ b/src/core/SkLiteDL.cpp @@ -15,6 +15,7 @@ #include "SkRegion.h" #include "SkRSXform.h" #include "SkTextBlob.h" +#include "SkVertices.h" #ifndef SKLITEDL_PAGE #define SKLITEDL_PAGE 4096 @@ -54,7 +55,7 @@ namespace { M(DrawImage) M(DrawImageNine) M(DrawImageRect) M(DrawImageLattice) \ M(DrawText) M(DrawPosText) M(DrawPosTextH) \ M(DrawTextOnPath) M(DrawTextRSXform) M(DrawTextBlob) \ - M(DrawPatch) M(DrawPoints) M(DrawVertices) M(DrawAtlas) + M(DrawPatch) M(DrawPoints) M(DrawVertices) M(DrawVerticesObject) M(DrawAtlas) #define M(T) T, enum class Type : uint8_t { TYPES(M) }; @@ -502,6 +503,17 @@ namespace { indices, nindices, paint); } }; + struct DrawVerticesObject final : Op { + static const auto kType = Type::DrawVerticesObject; + DrawVerticesObject(const SkVertices* v, SkBlendMode m, const SkPaint& p) + : vertices(sk_ref_sp(const_cast<SkVertices*>(v))), mode(m), paint(p) {} + sk_sp<SkVertices> vertices; + SkBlendMode mode; + SkPaint paint; + void draw(SkCanvas* c, const SkMatrix&) { + c->drawVertices(vertices, mode, paint); + } + }; struct DrawAtlas final : Op { static const auto kType = Type::DrawAtlas; DrawAtlas(const SkImage* atlas, int count, SkBlendMode xfermode, @@ -714,6 +726,9 @@ void SkLiteDL::drawVertices(SkCanvas::VertexMode mode, int count, const SkPoint colors, colors ? count : 0, indices, indices ? nindices : 0); } +void SkLiteDL::drawVertices(const SkVertices* vertices, SkBlendMode mode, const SkPaint& paint) { + this->push<DrawVerticesObject>(0, vertices, mode, paint); +} void SkLiteDL::drawAtlas(const SkImage* atlas, const SkRSXform xforms[], const SkRect texs[], const SkColor colors[], int count, SkBlendMode xfermode, const SkRect* cull, const SkPaint* paint) { |