diff options
author | 2017-03-16 16:54:38 -0400 | |
---|---|---|
committer | 2017-03-17 11:03:38 +0000 | |
commit | 14583e11fd622c686993b741499060a6f3527055 (patch) | |
tree | a579bd68be7fdaeac5b00951c637385204b43134 /include/core/SkCanvas.h | |
parent | dea7428b96badfac805e515701f785f292c5af2b (diff) |
More SkVertices implementation work
- change virtuals to take const SkVertices*, as we do for TextBobs and Images
- override onDrawVerticesObject in recording canvases
- deserialize raw-vertices into SkVertices object
Possibly a follow-on would intercept the raw-form directly in canvas,
and remove the virtual, and only support the object form.
BUG=skia:6366
Change-Id: I57a932667ccb3b3b004beb802ac3ae6898e3c6e0
Reviewed-on: https://skia-review.googlesource.com/9633
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'include/core/SkCanvas.h')
-rw-r--r-- | include/core/SkCanvas.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h index 81841ba2b4..85531bb74a 100644 --- a/include/core/SkCanvas.h +++ b/include/core/SkCanvas.h @@ -1186,9 +1186,9 @@ public: shader. In this case the colors are combined with the texture using mode, before being drawn using the paint. @param paint Specifies the shader/texture if present. - @param flags Allows the caller to ignore colors or texs on vertices. */ - void drawVertices(sk_sp<SkVertices> vertices, SkBlendMode mode, const SkPaint& paint); + void drawVertices(const SkVertices* vertices, SkBlendMode mode, const SkPaint& paint); + void drawVertices(const sk_sp<SkVertices>& vertices, SkBlendMode mode, const SkPaint& paint); /** Draw a cubic coons patch @@ -1445,12 +1445,10 @@ protected: virtual void onDrawVertices(VertexMode, int vertexCount, const SkPoint vertices[], const SkPoint texs[], const SkColor colors[], SkBlendMode, const uint16_t indices[], int indexCount, const SkPaint&); - virtual void onDrawVerticesObject(sk_sp<SkVertices> vertices, SkBlendMode mode, - const SkPaint& paint, uint32_t flags); + virtual void onDrawVerticesObject(const SkVertices*, SkBlendMode, const SkPaint&); // Subclasses can use this put the vertices object call on the regular draw vertices code path. // This is temporary until we teach recording and other SkCanvas classes about SkVertices. - void onDrawVerticesObjectFallback(sk_sp<SkVertices> vertices, SkBlendMode mode, - const SkPaint& paint, uint32_t flags); + void devolveSkVerticesToRaw(const SkVertices*, SkBlendMode, const SkPaint&); virtual void onDrawAtlas(const SkImage*, const SkRSXform[], const SkRect[], const SkColor[], int count, SkBlendMode, const SkRect* cull, const SkPaint*); |