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