| OLD | NEW |
| 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 15 matching lines...) Expand all Loading... |
| 26 } | 26 } |
| 27 | 27 |
| 28 GrDrawState* drawState = fDrawTarget->drawState(); | 28 GrDrawState* drawState = fDrawTarget->drawState(); |
| 29 GrDrawState::AutoRestoreEffects are(drawState); | 29 GrDrawState::AutoRestoreEffects are(drawState); |
| 30 drawState->setFromPaint(fPaint, SkMatrix::I(), fContext->getRenderTarget()); | 30 drawState->setFromPaint(fPaint, SkMatrix::I(), fContext->getRenderTarget()); |
| 31 | 31 |
| 32 if (fCurrVertex > 0) { | 32 if (fCurrVertex > 0) { |
| 33 // setup our sampler state for our text texture/atlas | 33 // setup our sampler state for our text texture/atlas |
| 34 GrAssert(GrIsALIGN4(fCurrVertex)); | 34 GrAssert(GrIsALIGN4(fCurrVertex)); |
| 35 GrAssert(fCurrTexture); | 35 GrAssert(fCurrTexture); |
| 36 GrTextureParams params(SkShader::kRepeat_TileMode, false); | 36 GrTextureParams params(SkShader::kRepeat_TileMode, GrTextureParams::kNon
e_FilterMode); |
| 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.numColorStages()) { | 46 fPaint.numColorStages()) { |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 } |
| OLD | NEW |