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

Unified Diff: src/gpu/GrTextContext.cpp

Issue 16952006: Replace fixed-size array of effect stages in GrDrawState with two appendable arrays, one for color,… (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: fix comments Created 7 years, 6 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/GrSWMaskHelper.cpp ('k') | src/gpu/gl/GrGLProgramDesc.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrTextContext.cpp
diff --git a/src/gpu/GrTextContext.cpp b/src/gpu/GrTextContext.cpp
index ad6fe8905ce396faec11794c1bfd5110b2ce3e82..0794e2cd0f8308f61aca95782263faa5100f9d9b 100644
--- a/src/gpu/GrTextContext.cpp
+++ b/src/gpu/GrTextContext.cpp
@@ -18,17 +18,15 @@
#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;
void GrTextContext::flushGlyphs() {
if (NULL == fDrawTarget) {
return;
}
- GrDrawTarget::AutoStateRestore asr(fDrawTarget, GrDrawTarget::kPreserve_ASRInit);
+
GrDrawState* drawState = fDrawTarget->drawState();
+ GrDrawState::AutoRestoreEffects are(drawState);
drawState->setFromPaint(fPaint, SkMatrix::I(), fContext->getRenderTarget());
if (fCurrVertex > 0) {
@@ -38,9 +36,9 @@ void GrTextContext::flushGlyphs() {
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->addCoverageEffect(
+ GrSimpleTextureEffect::CreateWithCustomCoords(fCurrTexture, params),
+ kGlyphCoordsAttributeIndex)->unref();
if (!GrPixelConfigIsAlphaOnly(fCurrTexture->config())) {
if (kOne_GrBlendCoeff != fPaint.getSrcBlendCoeff() ||
« no previous file with comments | « src/gpu/GrSWMaskHelper.cpp ('k') | src/gpu/gl/GrGLProgramDesc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698