diff options
author | Mike Reed <reed@google.com> | 2017-04-05 14:01:25 -0400 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-04-06 12:58:46 +0000 |
commit | 9d9172fe2c798eb2a1fe2cce51feb157050294d9 (patch) | |
tree | 1c3d1a2b4d2c8aaf3cafc732280c85077edf1a05 | |
parent | dc57b5d49647b6f6685df998ee7d81200ba7f652 (diff) |
remove legacy vertices flag and code
Bug: skia:6366
Change-Id: Ibea5f71c5ff570e4f3ccec7d064893602c3335cf
Reviewed-on: https://skia-review.googlesource.com/11359
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
-rw-r--r-- | include/core/SkCanvas.h | 43 | ||||
-rw-r--r-- | include/core/SkVertices.h | 27 | ||||
-rw-r--r-- | src/core/SkCanvas.cpp | 18 | ||||
-rw-r--r-- | src/core/SkVertices.cpp | 10 |
4 files changed, 0 insertions, 98 deletions
diff --git a/include/core/SkCanvas.h b/include/core/SkCanvas.h index 4c875e8f44..c44965e110 100644 --- a/include/core/SkCanvas.h +++ b/include/core/SkCanvas.h @@ -1099,49 +1099,6 @@ public: } #endif -#ifdef SK_SUPPORT_LEGACY_CANVAS_VERTICES - enum VertexMode { - kTriangles_VertexMode, - kTriangleStrip_VertexMode, - kTriangleFan_VertexMode - }; - - /** Draw the array of vertices, interpreted as triangles (based on mode). - - If both textures and vertex-colors are NULL, it strokes hairlines with - the paint's color. This behavior is a useful debugging mode to visualize - the mesh. - - @param vmode How to interpret the array of vertices - @param vertexCount The number of points in the vertices array (and - corresponding texs and colors arrays if non-null) - @param vertices Array of vertices for the mesh - @param texs May be null. If not null, specifies the coordinate - in _texture_ space (not uv space) for each vertex. - @param colors May be null. If not null, specifies a color for each - vertex, to be interpolated across the triangle. - @param mode Used if both texs and colors are present and paint has a - shader. In this case the colors are combined with the texture - using mode, before being drawn using the paint. - @param indices If not null, array of indices to reference into the - vertex (texs, colors) array. - @param indexCount number of entries in the indices array (if not null) - @param paint Specifies the shader/texture if present. - */ - void drawVertices(VertexMode vmode, int vertexCount, - const SkPoint vertices[], const SkPoint texs[], - const SkColor colors[], SkBlendMode mode, - const uint16_t indices[], int indexCount, - const SkPaint& paint); - void drawVertices(VertexMode vmode, int vertexCount, - const SkPoint vertices[], const SkPoint texs[], - const SkColor colors[], const uint16_t indices[], int indexCount, - const SkPaint& paint) { - this->drawVertices(vmode, vertexCount, vertices, texs, colors, SkBlendMode::kModulate, - indices, indexCount, paint); - } -#endif - /** Draw vertices from an immutable SkVertices object. @param vertices The mesh to draw. diff --git a/include/core/SkVertices.h b/include/core/SkVertices.h index 7006850fbc..a245c18502 100644 --- a/include/core/SkVertices.h +++ b/include/core/SkVertices.h @@ -14,10 +14,6 @@ #include "SkRect.h" #include "SkRefCnt.h" -#ifdef SK_SUPPORT_LEGACY_CANVAS_VERTICES -#include "SkCanvas.h" -#endif - /** * An immutable set of vertex data that can be used with SkCanvas::drawVertices. */ @@ -47,25 +43,6 @@ public: return MakeCopy(mode, vertexCount, positions, texs, colors, 0, nullptr); } -#ifdef SK_SUPPORT_LEGACY_CANVAS_VERTICES - static sk_sp<SkVertices> MakeCopy(SkCanvas::VertexMode mode, int vertexCount, - const SkPoint positions[], - const SkPoint texs[], - const SkColor colors[], - int indexCount, - const uint16_t indices[]) { - return MakeCopy(static_cast<VertexMode>(mode), vertexCount, positions, texs, colors, - indexCount, indices); - } - - static sk_sp<SkVertices> MakeCopy(SkCanvas::VertexMode mode, int vertexCount, - const SkPoint positions[], - const SkPoint texs[], - const SkColor colors[]) { - return MakeCopy(static_cast<VertexMode>(mode), vertexCount, positions, texs, colors); - } -#endif - struct Sizes; enum BuilderFlags { @@ -76,10 +53,6 @@ public: public: Builder(VertexMode mode, int vertexCount, int indexCount, uint32_t flags); -#ifdef SK_SUPPORT_LEGACY_CANVAS_VERTICES - Builder(SkCanvas::VertexMode mode, int vertexCount, int indexCount, uint32_t flags); -#endif - bool isValid() const { return fVertices != nullptr; } // if the builder is invalid, these will return 0 diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp index 9a02c19129..cd1600ad72 100644 --- a/src/core/SkCanvas.cpp +++ b/src/core/SkCanvas.cpp @@ -51,12 +51,6 @@ #include "SkClipOpPriv.h" #include "SkVertices.h" -#ifdef SK_SUPPORT_LEGACY_CANVAS_VERTICES -static_assert((int)SkCanvas::kTriangles_VertexMode == (int)SkVertices::kTriangles_VertexMode, ""); -static_assert((int)SkCanvas::kTriangleStrip_VertexMode == (int)SkVertices::kTriangleStrip_VertexMode, ""); -static_assert((int)SkCanvas::kTriangleFan_VertexMode == (int)SkVertices::kTriangleFan_VertexMode, ""); -#endif - #define RETURN_ON_NULL(ptr) do { if (nullptr == (ptr)) return; } while (0) class SkNoPixelsDevice : public SkBaseDevice { @@ -1804,18 +1798,6 @@ void SkCanvas::drawPoints(PointMode mode, size_t count, const SkPoint pts[], con this->onDrawPoints(mode, count, pts, paint); } -#ifdef SK_SUPPORT_LEGACY_CANVAS_VERTICES -void SkCanvas::drawVertices(VertexMode vmode, int vertexCount, const SkPoint positions[], - const SkPoint texs[], const SkColor colors[], SkBlendMode bmode, - const uint16_t indices[], int indexCount, const SkPaint& paint) { - auto vertices = SkVertices::MakeCopy(vmode, vertexCount, positions, texs, colors, - indexCount, indices); - if (vertices) { - this->onDrawVerticesObject(vertices.get(), bmode, paint); - } -} -#endif - void SkCanvas::drawVertices(const sk_sp<SkVertices>& vertices, SkBlendMode mode, const SkPaint& paint) { RETURN_ON_NULL(vertices); diff --git a/src/core/SkVertices.cpp b/src/core/SkVertices.cpp index 83204b54d5..f9cd39cf93 100644 --- a/src/core/SkVertices.cpp +++ b/src/core/SkVertices.cpp @@ -63,16 +63,6 @@ SkVertices::Builder::Builder(VertexMode mode, int vertexCount, int indexCount, this->init(mode, vertexCount, indexCount, sizes); } -#ifdef SK_SUPPORT_LEGACY_CANVAS_VERTICES -SkVertices::Builder::Builder(SkCanvas::VertexMode mode, int vertexCount, int indexCount, - uint32_t builderFlags) { - bool hasTexs = SkToBool(builderFlags & SkVertices::kHasTexCoords_BuilderFlag); - bool hasColors = SkToBool(builderFlags & SkVertices::kHasColors_BuilderFlag); - this->init(static_cast<VertexMode>(mode), vertexCount, indexCount, - SkVertices::Sizes(vertexCount, indexCount, hasTexs, hasColors)); -} -#endif - void SkVertices::Builder::init(VertexMode mode, int vertexCount, int indexCount, const SkVertices::Sizes& sizes) { if (!sizes.isValid()) { |