diff options
author | Mike Klein <mtklein@google.com> | 2018-06-19 01:40:57 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-06-19 01:41:10 +0000 |
commit | 5045e501d2aec23e5f1e4b46346033ac3202c6b0 (patch) | |
tree | b0179c300d6bc1822b0d945be812fff267bb414a /gm | |
parent | 63b3bfb711d7e3d4f9ad75681d77a69a3c454ab0 (diff) |
Revert "Change how vertex/instance attributes are handled in geometry processors."
This reverts commit 19c1233c447f625c2522e7ecd0a0adecc629bb2f.
Reason for revert: want to make sure Google3 can roll
Original change's description:
> Change how vertex/instance attributes are handled in geometry processors.
>
> * No longer register vertex/instance attributes on base class, just counts
>
> * Separate instance and vertex attributes and remove InputRate and offset
>
> * Make attributes constexpr where possible
>
> Change-Id: I1f1d5e772fa177a96d2aeb805aab7b69f35bfae6
> Reviewed-on: https://skia-review.googlesource.com/132405
> Commit-Queue: Brian Salomon <bsalomon@google.com>
> Reviewed-by: Chris Dalton <csmartdalton@google.com>
TBR=egdaniel@google.com,bsalomon@google.com,csmartdalton@google.com
Change-Id: I4800632515e14fbf54af52826928ac915657b59f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/135661
Reviewed-by: Mike Klein <mtklein@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
Diffstat (limited to 'gm')
-rw-r--r-- | gm/beziereffects.cpp | 17 | ||||
-rw-r--r-- | gm/convexpolyeffect.cpp | 5 |
2 files changed, 13 insertions, 9 deletions
diff --git a/gm/beziereffects.cpp b/gm/beziereffects.cpp index 7f7bf8ffb7..dea6150549 100644 --- a/gm/beziereffects.cpp +++ b/gm/beziereffects.cpp @@ -91,13 +91,14 @@ private: void onPrepareDraws(Target* target) override { QuadHelper helper; - SkASSERT(this->gp()->debugOnly_vertexStride() == sizeof(SkPoint)); - SkPoint* pts = reinterpret_cast<SkPoint*>(helper.init(target, sizeof(SkPoint), 1)); + size_t vertexStride = this->gp()->getVertexStride(); + SkASSERT(vertexStride == sizeof(SkPoint)); + SkPoint* pts = reinterpret_cast<SkPoint*>(helper.init(target, vertexStride, 1)); if (!pts) { return; } SkRect rect = this->rect(); - SkPointPriv::SetRectTriStrip(pts, rect, sizeof(SkPoint)); + SkPointPriv::SetRectTriStrip(pts, rect, vertexStride); helper.recordDraw(target, this->gp(), this->makePipeline(target)); } @@ -281,8 +282,9 @@ private: void onPrepareDraws(Target* target) override { QuadHelper helper; - SkASSERT(this->gp()->debugOnly_vertexStride() == sizeof(Vertex)); - Vertex* verts = reinterpret_cast<Vertex*>(helper.init(target, sizeof(Vertex), 1)); + size_t vertexStride = this->gp()->getVertexStride(); + SkASSERT(vertexStride == sizeof(Vertex)); + Vertex* verts = reinterpret_cast<Vertex*>(helper.init(target, vertexStride, 1)); if (!verts) { return; } @@ -500,8 +502,9 @@ private: void onPrepareDraws(Target* target) override { QuadHelper helper; - SkASSERT(this->gp()->debugOnly_vertexStride() == sizeof(Vertex)); - Vertex* verts = reinterpret_cast<Vertex*>(helper.init(target, sizeof(Vertex), 1)); + size_t vertexStride = this->gp()->getVertexStride(); + SkASSERT(vertexStride == sizeof(Vertex)); + Vertex* verts = reinterpret_cast<Vertex*>(helper.init(target, vertexStride, 1)); if (!verts) { return; } diff --git a/gm/convexpolyeffect.cpp b/gm/convexpolyeffect.cpp index da3d0657ae..8f8d1b4d50 100644 --- a/gm/convexpolyeffect.cpp +++ b/gm/convexpolyeffect.cpp @@ -81,9 +81,10 @@ private: sk_sp<GrGeometryProcessor> gp(GrDefaultGeoProcFactory::Make( color, Coverage::kSolid_Type, LocalCoords::kUnused_Type, SkMatrix::I())); - SkASSERT(gp->debugOnly_vertexStride() == sizeof(SkPoint)); + size_t vertexStride = gp->getVertexStride(); + SkASSERT(vertexStride == sizeof(SkPoint)); QuadHelper helper; - SkPoint* verts = reinterpret_cast<SkPoint*>(helper.init(target, sizeof(SkPoint), 1)); + SkPoint* verts = reinterpret_cast<SkPoint*>(helper.init(target, vertexStride, 1)); if (!verts) { return; } |