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

Unified Diff: src/gpu/GrDistanceFieldTextContext.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/GrContext.cpp ('k') | src/gpu/GrDrawState.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDistanceFieldTextContext.cpp
diff --git a/src/gpu/GrDistanceFieldTextContext.cpp b/src/gpu/GrDistanceFieldTextContext.cpp
index 6c51d01421b3a790a55b6bb41ef6b5d03fa4307e..9cf53ce41062e936e8fb27f05c1f330b00802fa4 100755
--- a/src/gpu/GrDistanceFieldTextContext.cpp
+++ b/src/gpu/GrDistanceFieldTextContext.cpp
@@ -44,8 +44,6 @@
{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},
@@ -53,8 +51,6 @@
{kVec2f_GrVertexAttribType, sizeof(SkPoint) + sizeof(GrColor), kEffect_GrVertexAttribBinding}
};
-static const size_t kTextVAColorSize = 2 * sizeof(SkPoint) + sizeof(GrColor);
-
};
GrDistanceFieldTextContext::GrDistanceFieldTextContext(GrContext* context,
@@ -359,7 +355,7 @@
size_t vertSize = fUseLCDText ? (2 * sizeof(SkPoint))
: (2 * sizeof(SkPoint) + sizeof(GrColor));
- SkASSERT(vertSize == fDrawTarget->getDrawState().getVertexStride());
+ SkASSERT(vertSize == fDrawTarget->getDrawState().getVertexSize());
SkPoint* positions = reinterpret_cast<SkPoint*>(
reinterpret_cast<intptr_t>(fVertices) + vertSize * fCurrVertex);
@@ -467,12 +463,10 @@
SkASSERT(NULL == fVertices);
if (!fUseLCDText) {
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,
« no previous file with comments | « src/gpu/GrContext.cpp ('k') | src/gpu/GrDrawState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698