| 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 "GrBitmapTextContext.h" | 8 #include "GrBitmapTextContext.h" |
| 9 #include "GrAtlas.h" | 9 #include "GrAtlas.h" |
| 10 #include "GrDrawTarget.h" | 10 #include "GrDrawTarget.h" |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 | 116 |
| 117 }; | 117 }; |
| 118 | 118 |
| 119 void GrBitmapTextContext::drawPackedGlyph(GrGlyph::PackedID packed, | 119 void GrBitmapTextContext::drawPackedGlyph(GrGlyph::PackedID packed, |
| 120 GrFixed vx, GrFixed vy, | 120 GrFixed vx, GrFixed vy, |
| 121 GrFontScaler* scaler) { | 121 GrFontScaler* scaler) { |
| 122 if (NULL == fDrawTarget) { | 122 if (NULL == fDrawTarget) { |
| 123 return; | 123 return; |
| 124 } | 124 } |
| 125 if (NULL == fStrike) { | 125 if (NULL == fStrike) { |
| 126 #if SK_DISTANCEFIELD_FONTS |
| 127 fStrike = fContext->getFontCache()->getStrike(scaler, true); |
| 128 #else |
| 126 fStrike = fContext->getFontCache()->getStrike(scaler); | 129 fStrike = fContext->getFontCache()->getStrike(scaler); |
| 130 #endif |
| 127 } | 131 } |
| 128 | 132 |
| 129 GrGlyph* glyph = fStrike->getGlyph(packed, scaler); | 133 GrGlyph* glyph = fStrike->getGlyph(packed, scaler); |
| 130 if (NULL == glyph || glyph->fBounds.isEmpty()) { | 134 if (NULL == glyph || glyph->fBounds.isEmpty()) { |
| 131 return; | 135 return; |
| 132 } | 136 } |
| 133 | 137 |
| 134 vx += SkIntToFixed(glyph->fBounds.fLeft); | 138 vx += SkIntToFixed(glyph->fBounds.fLeft); |
| 135 vy += SkIntToFixed(glyph->fBounds.fTop); | 139 vy += SkIntToFixed(glyph->fBounds.fTop); |
| 136 | 140 |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 SkFixedToFloat(vx + width), | 259 SkFixedToFloat(vx + width), |
| 256 SkFixedToFloat(vy + height), | 260 SkFixedToFloat(vy + height), |
| 257 2 * sizeof(SkPoint)); | 261 2 * sizeof(SkPoint)); |
| 258 fVertices[2*fCurrVertex+1].setRectFan(SkFixedToFloat(texture->normalizeFixed
X(tx)), | 262 fVertices[2*fCurrVertex+1].setRectFan(SkFixedToFloat(texture->normalizeFixed
X(tx)), |
| 259 SkFixedToFloat(texture->normalizeFixed
Y(ty)), | 263 SkFixedToFloat(texture->normalizeFixed
Y(ty)), |
| 260 SkFixedToFloat(texture->normalizeFixed
X(tx + width)), | 264 SkFixedToFloat(texture->normalizeFixed
X(tx + width)), |
| 261 SkFixedToFloat(texture->normalizeFixed
Y(ty + height)), | 265 SkFixedToFloat(texture->normalizeFixed
Y(ty + height)), |
| 262 2 * sizeof(SkPoint)); | 266 2 * sizeof(SkPoint)); |
| 263 fCurrVertex += 4; | 267 fCurrVertex += 4; |
| 264 } | 268 } |
| OLD | NEW |