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 "GrDrawTarget.h" | 10 #include "GrDrawTarget.h" |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
301 fCurrVertex = 0; | 301 fCurrVertex = 0; |
302 | 302 |
303 fVertices = NULL; | 303 fVertices = NULL; |
304 fMaxVertices = 0; | 304 fMaxVertices = 0; |
305 | 305 |
306 fTextRatio = fSkPaint.getTextSize()/kBaseDFFontSize; | 306 fTextRatio = fSkPaint.getTextSize()/kBaseDFFontSize; |
307 | 307 |
308 fSkPaint.setTextSize(SkIntToScalar(kBaseDFFontSize)); | 308 fSkPaint.setTextSize(SkIntToScalar(kBaseDFFontSize)); |
309 fSkPaint.setLCDRenderText(false); | 309 fSkPaint.setLCDRenderText(false); |
310 fSkPaint.setAutohinted(false); | 310 fSkPaint.setAutohinted(false); |
311 fSkPaint.setSubpixelText(false); | 311 fSkPaint.setSubpixelText(true); |
312 } | 312 } |
313 | 313 |
314 inline void GrDistanceFieldTextContext::finish() { | 314 inline void GrDistanceFieldTextContext::finish() { |
315 flushGlyphs(); | 315 flushGlyphs(); |
316 | 316 |
317 GrTextContext::finish(); | 317 GrTextContext::finish(); |
318 } | 318 } |
319 | 319 |
320 void GrDistanceFieldTextContext::drawText(const GrPaint& paint, const SkPaint& s
kPaint, | 320 void GrDistanceFieldTextContext::drawText(const GrPaint& paint, const SkPaint& s
kPaint, |
321 const char text[], size_t byteLength, | 321 const char text[], size_t byteLength, |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 SkScalarToFixed(y) - (glyph.fAdvanceY >> a
lignShift) | 449 SkScalarToFixed(y) - (glyph.fAdvanceY >> a
lignShift) |
450 + SK_FixedHalf, //d1g.fHalfSampleY, | 450 + SK_FixedHalf, //d1g.fHalfSampleY, |
451 fontScaler); | 451 fontScaler); |
452 } | 452 } |
453 pos += scalarsPerPosition; | 453 pos += scalarsPerPosition; |
454 } | 454 } |
455 } | 455 } |
456 | 456 |
457 this->finish(); | 457 this->finish(); |
458 } | 458 } |
OLD | NEW |