aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrTextContext.cpp
diff options
context:
space:
mode:
authorGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-03-20 17:47:16 +0000
committerGravatar reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-03-20 17:47:16 +0000
commit67e7cde5c5e59a8f1de7ee28276b8193ecb2bc7f (patch)
treefbb2c63213570deb6062b3eb8e9ba1a13c0431d4 /src/gpu/GrTextContext.cpp
parent113994051b41366a7b25851d05cd56e89866a33b (diff)
revert 8265-8264 (broke build)
git-svn-id: http://skia.googlecode.com/svn/trunk@8268 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/GrTextContext.cpp')
-rw-r--r--src/gpu/GrTextContext.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/gpu/GrTextContext.cpp b/src/gpu/GrTextContext.cpp
index ab2bc424d6..5ff13b0fdc 100644
--- a/src/gpu/GrTextContext.cpp
+++ b/src/gpu/GrTextContext.cpp
@@ -18,10 +18,12 @@
#include "SkPath.h"
#include "SkStrokeRec.h"
-// glyph rendering shares this stage with edge rendering (kEdgeEffectStage in GrContext) && SW path
-// rendering (kPathMaskStage in GrSWMaskHelper)
-static const int kGlyphMaskStage = GrPaint::kTotalStages;
-static const int kGlyphCoordsAttributeIndex = 1;
+enum {
+ // glyph rendering shares this stage with edge rendering
+ // (kEdgeEffectStage in GrContext) && SW path rendering
+ // (kPathMaskStage in GrSWMaskHelper)
+ kGlyphMaskStage = GrPaint::kTotalStages,
+};
void GrTextContext::flushGlyphs() {
if (NULL == fDrawTarget) {
@@ -33,11 +35,7 @@ void GrTextContext::flushGlyphs() {
GrAssert(GrIsALIGN4(fCurrVertex));
GrAssert(fCurrTexture);
GrTextureParams params(SkShader::kRepeat_TileMode, false);
-
- // This effect could be stored with one of the cache objects (atlas?)
- drawState->setEffect(kGlyphMaskStage,
- GrSimpleTextureEffect::CreateWithCustomCoords(fCurrTexture, params),
- kGlyphCoordsAttributeIndex)->unref();
+ drawState->createTextureEffect(kGlyphMaskStage, fCurrTexture, SkMatrix::I(), params);
if (!GrPixelConfigIsAlphaOnly(fCurrTexture->config())) {
if (kOne_GrBlendCoeff != fPaint.getSrcBlendCoeff() ||
@@ -197,7 +195,7 @@ HAS_ATLAS:
{kVec2f_GrVertexAttribType, 0},
{kVec2f_GrVertexAttribType, sizeof(GrPoint)}
};
- static const GrAttribBindings kAttribBindings = 0;
+ static const GrAttribBindings kAttribBindings = GrDrawState::ExplicitTexCoordAttribBindingsBit(kGlyphMaskStage);
// If we need to reserve vertices allow the draw target to suggest
// a number of verts to reserve and whether to perform a flush.
@@ -216,6 +214,7 @@ HAS_ATLAS:
fDrawTarget->drawState()->setVertexAttribs(kVertexAttribs, SK_ARRAY_COUNT(kVertexAttribs));
}
fDrawTarget->drawState()->setAttribIndex(GrDrawState::kPosition_AttribIndex, 0);
+ fDrawTarget->drawState()->setAttribIndex(GrDrawState::kTexCoord_AttribIndex, 1);
fDrawTarget->drawState()->setAttribBindings(kAttribBindings);
fMaxVertices = kDefaultRequestedVerts;
// ignore return, no point in flushing again.