aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm
diff options
context:
space:
mode:
authorGravatar Brian Salomon <bsalomon@google.com>2018-06-19 14:33:47 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-06-19 20:01:29 +0000
commit92be2f74db81f0ed480b55c58cbde39270f9b772 (patch)
treed2b7135f511a318f10c5c86f2537c07051c922bd /gm
parentf5ac906476cd26f2967a48340940e6af580fa71f (diff)
Revert "Revert "Change how vertex/instance attributes are handled in geometry processors.""
This reverts commit 5045e501d2aec23e5f1e4b46346033ac3202c6b0. TBR=csmartdalton@google.com Change-Id: Ifbf5f1d8f8ef340fdc69653e931b6d68d4bf0854 Reviewed-on: https://skia-review.googlesource.com/135862 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'gm')
-rw-r--r--gm/beziereffects.cpp17
-rw-r--r--gm/convexpolyeffect.cpp5
2 files changed, 9 insertions, 13 deletions
diff --git a/gm/beziereffects.cpp b/gm/beziereffects.cpp
index 1c26989df2..26da791746 100644
--- a/gm/beziereffects.cpp
+++ b/gm/beziereffects.cpp
@@ -93,14 +93,13 @@ private:
void onPrepareDraws(Target* target) override {
QuadHelper helper;
- size_t vertexStride = this->gp()->getVertexStride();
- SkASSERT(vertexStride == sizeof(SkPoint));
- SkPoint* pts = reinterpret_cast<SkPoint*>(helper.init(target, vertexStride, 1));
+ SkASSERT(this->gp()->debugOnly_vertexStride() == sizeof(SkPoint));
+ SkPoint* pts = reinterpret_cast<SkPoint*>(helper.init(target, sizeof(SkPoint), 1));
if (!pts) {
return;
}
SkRect rect = this->rect();
- SkPointPriv::SetRectTriStrip(pts, rect, vertexStride);
+ SkPointPriv::SetRectTriStrip(pts, rect, sizeof(SkPoint));
helper.recordDraw(target, this->gp(), this->makePipeline(target));
}
@@ -285,9 +284,8 @@ private:
void onPrepareDraws(Target* target) override {
QuadHelper helper;
- size_t vertexStride = this->gp()->getVertexStride();
- SkASSERT(vertexStride == sizeof(Vertex));
- Vertex* verts = reinterpret_cast<Vertex*>(helper.init(target, vertexStride, 1));
+ SkASSERT(this->gp()->debugOnly_vertexStride() == sizeof(Vertex));
+ Vertex* verts = reinterpret_cast<Vertex*>(helper.init(target, sizeof(Vertex), 1));
if (!verts) {
return;
}
@@ -507,9 +505,8 @@ private:
void onPrepareDraws(Target* target) override {
QuadHelper helper;
- size_t vertexStride = this->gp()->getVertexStride();
- SkASSERT(vertexStride == sizeof(Vertex));
- Vertex* verts = reinterpret_cast<Vertex*>(helper.init(target, vertexStride, 1));
+ SkASSERT(this->gp()->debugOnly_vertexStride() == sizeof(Vertex));
+ Vertex* verts = reinterpret_cast<Vertex*>(helper.init(target, sizeof(Vertex), 1));
if (!verts) {
return;
}
diff --git a/gm/convexpolyeffect.cpp b/gm/convexpolyeffect.cpp
index 18c5ebdcdc..496b6b173f 100644
--- a/gm/convexpolyeffect.cpp
+++ b/gm/convexpolyeffect.cpp
@@ -83,10 +83,9 @@ private:
sk_sp<GrGeometryProcessor> gp(GrDefaultGeoProcFactory::Make(
color, Coverage::kSolid_Type, LocalCoords::kUnused_Type, SkMatrix::I()));
- size_t vertexStride = gp->getVertexStride();
- SkASSERT(vertexStride == sizeof(SkPoint));
+ SkASSERT(gp->debugOnly_vertexStride() == sizeof(SkPoint));
QuadHelper helper;
- SkPoint* verts = reinterpret_cast<SkPoint*>(helper.init(target, vertexStride, 1));
+ SkPoint* verts = reinterpret_cast<SkPoint*>(helper.init(target, sizeof(SkPoint), 1));
if (!verts) {
return;
}