| 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 | 126 #if SK_DISTANCEFIELD_FONTS |
| 127 fStrike = fContext->getFontCache()->getStrike(scaler, true); | 127 fStrike = fContext->getFontCache()->getStrike(scaler, false); |
| 128 #else | 128 #else |
| 129 fStrike = fContext->getFontCache()->getStrike(scaler); | 129 fStrike = fContext->getFontCache()->getStrike(scaler); |
| 130 #endif | 130 #endif |
| 131 } | 131 } |
| 132 | 132 |
| 133 GrGlyph* glyph = fStrike->getGlyph(packed, scaler); | 133 GrGlyph* glyph = fStrike->getGlyph(packed, scaler); |
| 134 if (NULL == glyph || glyph->fBounds.isEmpty()) { | 134 if (NULL == glyph || glyph->fBounds.isEmpty()) { |
| 135 return; | 135 return; |
| 136 } | 136 } |
| 137 | 137 |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 SkFixedToFloat(vx + width), | 259 SkFixedToFloat(vx + width), |
| 260 SkFixedToFloat(vy + height), | 260 SkFixedToFloat(vy + height), |
| 261 2 * sizeof(SkPoint)); | 261 2 * sizeof(SkPoint)); |
| 262 fVertices[2*fCurrVertex+1].setRectFan(SkFixedToFloat(texture->normalizeFixed
X(tx)), | 262 fVertices[2*fCurrVertex+1].setRectFan(SkFixedToFloat(texture->normalizeFixed
X(tx)), |
| 263 SkFixedToFloat(texture->normalizeFixed
Y(ty)), | 263 SkFixedToFloat(texture->normalizeFixed
Y(ty)), |
| 264 SkFixedToFloat(texture->normalizeFixed
X(tx + width)), | 264 SkFixedToFloat(texture->normalizeFixed
X(tx + width)), |
| 265 SkFixedToFloat(texture->normalizeFixed
Y(ty + height)), | 265 SkFixedToFloat(texture->normalizeFixed
Y(ty + height)), |
| 266 2 * sizeof(SkPoint)); | 266 2 * sizeof(SkPoint)); |
| 267 fCurrVertex += 4; | 267 fCurrVertex += 4; |
| 268 } | 268 } |
| OLD | NEW |