| 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 "SkColorFilter.h" | 10 #include "SkColorFilter.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 void GrDistanceFieldTextContext::flushGlyphs() { | 99 void GrDistanceFieldTextContext::flushGlyphs() { |
| 100 if (NULL == fDrawTarget) { | 100 if (NULL == fDrawTarget) { |
| 101 return; | 101 return; |
| 102 } | 102 } |
| 103 | 103 |
| 104 GrDrawState* drawState = fDrawTarget->drawState(); | 104 GrDrawState* drawState = fDrawTarget->drawState(); |
| 105 GrDrawState::AutoRestoreEffects are(drawState); | 105 GrDrawState::AutoRestoreEffects are(drawState); |
| 106 drawState->setFromPaint(fPaint, fContext->getMatrix(), fContext->getRenderTa
rget()); | 106 drawState->setFromPaint(fPaint, fContext->getMatrix(), fContext->getRenderTa
rget()); |
| 107 | 107 |
| 108 if (fCurrVertex > 0) { | 108 if (fCurrVertex > 0) { |
| 109 fContext->getFontCache()->updateTextures(); | |
| 110 | |
| 111 // setup our sampler state for our text texture/atlas | 109 // setup our sampler state for our text texture/atlas |
| 112 SkASSERT(SkIsAlign4(fCurrVertex)); | 110 SkASSERT(SkIsAlign4(fCurrVertex)); |
| 113 SkASSERT(fCurrTexture); | 111 SkASSERT(fCurrTexture); |
| 114 GrTextureParams params(SkShader::kRepeat_TileMode, GrTextureParams::kBil
erp_FilterMode); | 112 GrTextureParams params(SkShader::kRepeat_TileMode, GrTextureParams::kBil
erp_FilterMode); |
| 115 GrTextureParams gammaParams(SkShader::kClamp_TileMode, GrTextureParams::
kNone_FilterMode); | 113 GrTextureParams gammaParams(SkShader::kClamp_TileMode, GrTextureParams::
kNone_FilterMode); |
| 116 | 114 |
| 117 // Effects could be stored with one of the cache objects (atlas?) | 115 // Effects could be stored with one of the cache objects (atlas?) |
| 118 SkColor filteredColor; | 116 SkColor filteredColor; |
| 119 SkColorFilter* colorFilter = fSkPaint.getColorFilter(); | 117 SkColorFilter* colorFilter = fSkPaint.getColorFilter(); |
| 120 if (NULL != colorFilter) { | 118 if (NULL != colorFilter) { |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 SkScalarToFixed(x) - (glyph.fAdvanceX >> a
lignShift), | 567 SkScalarToFixed(x) - (glyph.fAdvanceX >> a
lignShift), |
| 570 SkScalarToFixed(y) - (glyph.fAdvanceY >> a
lignShift), | 568 SkScalarToFixed(y) - (glyph.fAdvanceY >> a
lignShift), |
| 571 fontScaler); | 569 fontScaler); |
| 572 } | 570 } |
| 573 pos += scalarsPerPosition; | 571 pos += scalarsPerPosition; |
| 574 } | 572 } |
| 575 } | 573 } |
| 576 | 574 |
| 577 this->finish(); | 575 this->finish(); |
| 578 } | 576 } |
| OLD | NEW |