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

Side by Side Diff: src/gpu/GrTextContext.cpp

Issue 18686007: Make GrPaint have a variable sized array of color and coverage stages rather than a fixed size. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: rob's comments Created 7 years, 5 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/gpu/GrSWMaskHelper.cpp ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2010 Google Inc. 2 * Copyright 2010 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 8
9 9
10 #include "GrTextContext.h" 10 #include "GrTextContext.h"
(...skipping 25 matching lines...) Expand all
36 GrTextureParams params(SkShader::kRepeat_TileMode, false); 36 GrTextureParams params(SkShader::kRepeat_TileMode, false);
37 37
38 // This effect could be stored with one of the cache objects (atlas?) 38 // This effect could be stored with one of the cache objects (atlas?)
39 drawState->addCoverageEffect( 39 drawState->addCoverageEffect(
40 GrSimpleTextureEffect::CreateWithCustomCoords(fC urrTexture, params), 40 GrSimpleTextureEffect::CreateWithCustomCoords(fC urrTexture, params),
41 kGlyphCoordsAttributeIndex)->unref(); 41 kGlyphCoordsAttributeIndex)->unref();
42 42
43 if (!GrPixelConfigIsAlphaOnly(fCurrTexture->config())) { 43 if (!GrPixelConfigIsAlphaOnly(fCurrTexture->config())) {
44 if (kOne_GrBlendCoeff != fPaint.getSrcBlendCoeff() || 44 if (kOne_GrBlendCoeff != fPaint.getSrcBlendCoeff() ||
45 kISA_GrBlendCoeff != fPaint.getDstBlendCoeff() || 45 kISA_GrBlendCoeff != fPaint.getDstBlendCoeff() ||
46 fPaint.hasColorStage()) { 46 fPaint.numColorStages()) {
47 GrPrintf("LCD Text will not draw correctly.\n"); 47 GrPrintf("LCD Text will not draw correctly.\n");
48 } 48 }
49 // setup blend so that we get mask * paintColor + (1-mask)*dstColor 49 // setup blend so that we get mask * paintColor + (1-mask)*dstColor
50 drawState->setBlendConstant(fPaint.getColor()); 50 drawState->setBlendConstant(fPaint.getColor());
51 drawState->setBlendFunc(kConstC_GrBlendCoeff, kISC_GrBlendCoeff); 51 drawState->setBlendFunc(kConstC_GrBlendCoeff, kISC_GrBlendCoeff);
52 // don't modulate by the paint's color in the frag since we're 52 // don't modulate by the paint's color in the frag since we're
53 // already doing it via the blend const. 53 // already doing it via the blend const.
54 drawState->setColor(0xffffffff); 54 drawState->setColor(0xffffffff);
55 } else { 55 } else {
56 // set back to normal in case we took LCD path previously. 56 // set back to normal in case we took LCD path previously.
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 SkFixedToFloat(vx + width), 240 SkFixedToFloat(vx + width),
241 SkFixedToFloat(vy + height), 241 SkFixedToFloat(vy + height),
242 2 * sizeof(SkPoint)); 242 2 * sizeof(SkPoint));
243 fVertices[2*fCurrVertex+1].setRectFan(SkFixedToFloat(texture->normalizeFixed X(tx)), 243 fVertices[2*fCurrVertex+1].setRectFan(SkFixedToFloat(texture->normalizeFixed X(tx)),
244 SkFixedToFloat(texture->normalizeFixed Y(ty)), 244 SkFixedToFloat(texture->normalizeFixed Y(ty)),
245 SkFixedToFloat(texture->normalizeFixed X(tx + width)), 245 SkFixedToFloat(texture->normalizeFixed X(tx + width)),
246 SkFixedToFloat(texture->normalizeFixed Y(ty + height)), 246 SkFixedToFloat(texture->normalizeFixed Y(ty + height)),
247 2 * sizeof(SkPoint)); 247 2 * sizeof(SkPoint));
248 fCurrVertex += 4; 248 fCurrVertex += 4;
249 } 249 }
OLDNEW
« no previous file with comments | « src/gpu/GrSWMaskHelper.cpp ('k') | src/gpu/SkGpuDevice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698