OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 #include "GrDistanceFieldTextContext.h" | 8 #include "GrDistanceFieldTextContext.h" |
9 #include "GrAtlas.h" | 9 #include "GrAtlas.h" |
10 #include "GrDrawTarget.h" | 10 #include "GrDrawTarget.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 void GrDistanceFieldTextContext::flushGlyphs() { | 94 void GrDistanceFieldTextContext::flushGlyphs() { |
95 if (NULL == fDrawTarget) { | 95 if (NULL == fDrawTarget) { |
96 return; | 96 return; |
97 } | 97 } |
98 | 98 |
99 GrDrawState* drawState = fDrawTarget->drawState(); | 99 GrDrawState* drawState = fDrawTarget->drawState(); |
100 GrDrawState::AutoRestoreEffects are(drawState); | 100 GrDrawState::AutoRestoreEffects are(drawState); |
101 drawState->setFromPaint(fPaint, fContext->getMatrix(), fContext->getRenderTa
rget()); | 101 drawState->setFromPaint(fPaint, fContext->getMatrix(), fContext->getRenderTa
rget()); |
102 | 102 |
103 if (fCurrVertex > 0) { | 103 if (fCurrVertex > 0) { |
| 104 fContext->getFontCache()->updateTextures(); |
| 105 |
104 // setup our sampler state for our text texture/atlas | 106 // setup our sampler state for our text texture/atlas |
105 SkASSERT(SkIsAlign4(fCurrVertex)); | 107 SkASSERT(SkIsAlign4(fCurrVertex)); |
106 SkASSERT(fCurrTexture); | 108 SkASSERT(fCurrTexture); |
107 GrTextureParams params(SkShader::kRepeat_TileMode, GrTextureParams::kBil
erp_FilterMode); | 109 GrTextureParams params(SkShader::kRepeat_TileMode, GrTextureParams::kBil
erp_FilterMode); |
108 | 110 |
109 // Effects could be stored with one of the cache objects (atlas?) | 111 // Effects could be stored with one of the cache objects (atlas?) |
110 if (fUseLCDText) { | 112 if (fUseLCDText) { |
111 bool useBGR = SkDeviceProperties::Geometry::kBGR_Layout == | 113 bool useBGR = SkDeviceProperties::Geometry::kBGR_Layout == |
112 fDeviceProperties.fG
eometry.getLayout(); | 114 fDeviceProperties.fG
eometry.getLayout(); |
113 drawState->addCoverageEffect(GrDistanceFieldLCDTextureEffect::Create
( | 115 drawState->addCoverageEffect(GrDistanceFieldLCDTextureEffect::Create
( |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 SkScalarToFixed(y) - (glyph.fAdvanceY >> a
lignShift) | 497 SkScalarToFixed(y) - (glyph.fAdvanceY >> a
lignShift) |
496 + SK_FixedHalf, //d1g.fHalfSampleY, | 498 + SK_FixedHalf, //d1g.fHalfSampleY, |
497 fontScaler); | 499 fontScaler); |
498 } | 500 } |
499 pos += scalarsPerPosition; | 501 pos += scalarsPerPosition; |
500 } | 502 } |
501 } | 503 } |
502 | 504 |
503 this->finish(); | 505 this->finish(); |
504 } | 506 } |
OLD | NEW |