| 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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 GrDrawState::AutoRestoreEffects are(drawState); | 181 GrDrawState::AutoRestoreEffects are(drawState); |
| 182 drawState->setFromPaint(fPaint, fContext->getMatrix(), fContext->getRenderTa
rget()); | 182 drawState->setFromPaint(fPaint, fContext->getMatrix(), fContext->getRenderTa
rget()); |
| 183 | 183 |
| 184 if (fCurrVertex > 0) { | 184 if (fCurrVertex > 0) { |
| 185 // setup our sampler state for our text texture/atlas | 185 // setup our sampler state for our text texture/atlas |
| 186 SkASSERT(SkIsAlign4(fCurrVertex)); | 186 SkASSERT(SkIsAlign4(fCurrVertex)); |
| 187 | 187 |
| 188 // get our current color | 188 // get our current color |
| 189 SkColor filteredColor; | 189 SkColor filteredColor; |
| 190 SkColorFilter* colorFilter = fSkPaint.getColorFilter(); | 190 SkColorFilter* colorFilter = fSkPaint.getColorFilter(); |
| 191 if (NULL != colorFilter) { | 191 if (colorFilter) { |
| 192 filteredColor = colorFilter->filterColor(fSkPaint.getColor()); | 192 filteredColor = colorFilter->filterColor(fSkPaint.getColor()); |
| 193 } else { | 193 } else { |
| 194 filteredColor = fSkPaint.getColor(); | 194 filteredColor = fSkPaint.getColor(); |
| 195 } | 195 } |
| 196 this->setupCoverageEffect(filteredColor); | 196 this->setupCoverageEffect(filteredColor); |
| 197 | 197 |
| 198 // Effects could be stored with one of the cache objects (atlas?) | 198 // Effects could be stored with one of the cache objects (atlas?) |
| 199 int coordsIdx = drawState->hasColorVertexAttribute() ? kGlyphCoordsWithC
olorAttributeIndex : | 199 int coordsIdx = drawState->hasColorVertexAttribute() ? kGlyphCoordsWithC
olorAttributeIndex : |
| 200 kGlyphCoordsNoCol
orAttributeIndex; | 200 kGlyphCoordsNoCol
orAttributeIndex; |
| 201 drawState->addCoverageEffect(fCachedEffect.get(), coordsIdx); | 201 drawState->addCoverageEffect(fCachedEffect.get(), coordsIdx); |
| (...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 652 SkScalarToFixed(x) - (glyph.fAdvanceX >> a
lignShift), | 652 SkScalarToFixed(x) - (glyph.fAdvanceX >> a
lignShift), |
| 653 SkScalarToFixed(y) - (glyph.fAdvanceY >> a
lignShift), | 653 SkScalarToFixed(y) - (glyph.fAdvanceY >> a
lignShift), |
| 654 fontScaler); | 654 fontScaler); |
| 655 } | 655 } |
| 656 pos += scalarsPerPosition; | 656 pos += scalarsPerPosition; |
| 657 } | 657 } |
| 658 } | 658 } |
| 659 | 659 |
| 660 this->finish(); | 660 this->finish(); |
| 661 } | 661 } |
| OLD | NEW |