Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(338)

Unified Diff: src/gpu/GrOvalRenderer.cpp

Issue 511593004: Make setVertexAttribs in GrDrawState take a stride parameter. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/gpu/GrOvalRenderer.cpp
diff --git a/src/gpu/GrOvalRenderer.cpp b/src/gpu/GrOvalRenderer.cpp
index dcce88955926bbfc19145ac89909bf25ccac6629..f368dc8d899c06e02b63128e3db3f9a0b4a1e784 100644
--- a/src/gpu/GrOvalRenderer.cpp
+++ b/src/gpu/GrOvalRenderer.cpp
@@ -519,8 +519,8 @@ void GrOvalRenderer::drawCircle(GrDrawTarget* target,
return;
}
- drawState->setVertexAttribs<gCircleVertexAttribs>(SK_ARRAY_COUNT(gCircleVertexAttribs));
- SkASSERT(sizeof(CircleVertex) == drawState->getVertexSize());
+ drawState->setVertexAttribs<gCircleVertexAttribs>(SK_ARRAY_COUNT(gCircleVertexAttribs),
+ sizeof(CircleVertex));
GrDrawTarget::AutoReleaseGeometry geo(target, 4, 0);
if (!geo.succeeded()) {
@@ -680,8 +680,8 @@ bool GrOvalRenderer::drawEllipse(GrDrawTarget* target,
return false;
}
- drawState->setVertexAttribs<gEllipseVertexAttribs>(SK_ARRAY_COUNT(gEllipseVertexAttribs));
- SkASSERT(sizeof(EllipseVertex) == drawState->getVertexSize());
+ drawState->setVertexAttribs<gEllipseVertexAttribs>(SK_ARRAY_COUNT(gEllipseVertexAttribs),
+ sizeof(EllipseVertex));
GrDrawTarget::AutoReleaseGeometry geo(target, 4, 0);
if (!geo.succeeded()) {
@@ -799,8 +799,8 @@ bool GrOvalRenderer::drawDIEllipse(GrDrawTarget* target,
SkScalar innerRatioX = SkScalarDiv(xRadius, innerXRadius);
SkScalar innerRatioY = SkScalarDiv(yRadius, innerYRadius);
- drawState->setVertexAttribs<gDIEllipseVertexAttribs>(SK_ARRAY_COUNT(gDIEllipseVertexAttribs));
- SkASSERT(sizeof(DIEllipseVertex) == drawState->getVertexSize());
+ drawState->setVertexAttribs<gDIEllipseVertexAttribs>(SK_ARRAY_COUNT(gDIEllipseVertexAttribs),
+ sizeof(DIEllipseVertex));
GrDrawTarget::AutoReleaseGeometry geo(target, 4, 0);
if (!geo.succeeded()) {
@@ -1032,8 +1032,8 @@ bool GrOvalRenderer::drawRRect(GrDrawTarget* target, GrContext* context, bool us
// if the corners are circles, use the circle renderer
if ((!hasStroke || scaledStroke.fX == scaledStroke.fY) && xRadius == yRadius) {
- drawState->setVertexAttribs<gCircleVertexAttribs>(SK_ARRAY_COUNT(gCircleVertexAttribs));
- SkASSERT(sizeof(CircleVertex) == drawState->getVertexSize());
+ drawState->setVertexAttribs<gCircleVertexAttribs>(SK_ARRAY_COUNT(gCircleVertexAttribs),
+ sizeof(CircleVertex));
GrDrawTarget::AutoReleaseGeometry geo(target, 16, 0);
if (!geo.succeeded()) {
@@ -1121,8 +1121,8 @@ bool GrOvalRenderer::drawRRect(GrDrawTarget* target, GrContext* context, bool us
// otherwise we use the ellipse renderer
} else {
- drawState->setVertexAttribs<gEllipseVertexAttribs>(SK_ARRAY_COUNT(gEllipseVertexAttribs));
- SkASSERT(sizeof(EllipseVertex) == drawState->getVertexSize());
+ drawState->setVertexAttribs<gEllipseVertexAttribs>(SK_ARRAY_COUNT(gEllipseVertexAttribs),
+ sizeof(EllipseVertex));
SkScalar innerXRadius = 0.0f;
SkScalar innerYRadius = 0.0f;

Powered by Google App Engine
This is Rietveld 408576698