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

Unified Diff: src/gpu/GrBitmapTextContext.cpp

Issue 502533004: Revert of 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
« no previous file with comments | « src/gpu/GrAARectRenderer.cpp ('k') | src/gpu/GrContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrBitmapTextContext.cpp
diff --git a/src/gpu/GrBitmapTextContext.cpp b/src/gpu/GrBitmapTextContext.cpp
index 17439b5672c6dbdca16c9ef4e7bd211fcaf10007..c992b9527f9202252e3fe31c7d94d0b96a00d0b2 100755
--- a/src/gpu/GrBitmapTextContext.cpp
+++ b/src/gpu/GrBitmapTextContext.cpp
@@ -40,16 +40,12 @@
{kVec2f_GrVertexAttribType, sizeof(SkPoint) , kEffect_GrVertexAttribBinding}
};
-static const size_t kTextVASize = 2 * sizeof(SkPoint);
-
// position + color + texture coord
extern const GrVertexAttrib gTextVertexWithColorAttribs[] = {
{kVec2f_GrVertexAttribType, 0, kPosition_GrVertexAttribBinding},
{kVec4ub_GrVertexAttribType, sizeof(SkPoint), kColor_GrVertexAttribBinding},
{kVec2f_GrVertexAttribType, sizeof(SkPoint) + sizeof(GrColor), kEffect_GrVertexAttribBinding}
};
-
-static const size_t kTextVAColorSize = 2 * sizeof(SkPoint) + sizeof(GrColor);
};
@@ -180,12 +176,10 @@
bool useColorVerts = kA8_GrMaskFormat == fStrike->getMaskFormat();
if (useColorVerts) {
fDrawTarget->drawState()->setVertexAttribs<gTextVertexWithColorAttribs>(
- SK_ARRAY_COUNT(gTextVertexWithColorAttribs),
- kTextVAColorSize);
+ SK_ARRAY_COUNT(gTextVertexWithColorAttribs));
} else {
fDrawTarget->drawState()->setVertexAttribs<gTextVertexAttribs>(
- SK_ARRAY_COUNT(gTextVertexAttribs),
- kTextVASize);
+ SK_ARRAY_COUNT(gTextVertexAttribs));
}
fVertexCount = 4*fSkPaint.textToGlyphs(text, byteLength, NULL);
bool success = fDrawTarget->reserveVertexAndIndexSpace(fVertexCount,
@@ -565,7 +559,7 @@
size_t vertSize = useColorVerts ? (2 * sizeof(SkPoint) + sizeof(GrColor)) :
(2 * sizeof(SkPoint));
- SkASSERT(vertSize == fDrawTarget->getDrawState().getVertexStride());
+ SkASSERT(vertSize == fDrawTarget->getDrawState().getVertexSize());
SkPoint* positions = reinterpret_cast<SkPoint*>(
reinterpret_cast<intptr_t>(fVertices) + vertSize * fCurrVertex);
« no previous file with comments | « src/gpu/GrAARectRenderer.cpp ('k') | src/gpu/GrContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698