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 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
494 | 494 |
495 if (glyph.fWidth) { | 495 if (glyph.fWidth) { |
496 this->drawPackedGlyph(GrGlyph::Pack(glyph.getGlyphID(), | 496 this->drawPackedGlyph(GrGlyph::Pack(glyph.getGlyphID(), |
497 glyph.getSubXFixed(), | 497 glyph.getSubXFixed(), |
498 glyph.getSubYFixed()), | 498 glyph.getSubYFixed()), |
499 fx, | 499 fx, |
500 fy, | 500 fy, |
501 fontScaler); | 501 fontScaler); |
502 } | 502 } |
503 | 503 |
504 fx += SkFixedMul_portable(glyph.fAdvanceX, fixedScale); | 504 fx += SkFixedMul_longlong(glyph.fAdvanceX, fixedScale); |
505 fy += SkFixedMul_portable(glyph.fAdvanceY, fixedScale); | 505 fy += SkFixedMul_longlong(glyph.fAdvanceY, fixedScale); |
506 } | 506 } |
507 | 507 |
508 this->finish(); | 508 this->finish(); |
509 } | 509 } |
510 | 510 |
511 void GrDistanceFieldTextContext::drawPosText(const GrPaint& paint, const SkPaint
& skPaint, | 511 void GrDistanceFieldTextContext::drawPosText(const GrPaint& paint, const SkPaint
& skPaint, |
512 const char text[], size_t byteLengt
h, | 512 const char text[], size_t byteLengt
h, |
513 const SkScalar pos[], SkScalar cons
tY, | 513 const SkScalar pos[], SkScalar cons
tY, |
514 int scalarsPerPosition) { | 514 int scalarsPerPosition) { |
515 | 515 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
567 SkScalarToFixed(x) - (glyph.fAdvanceX >> a
lignShift), | 567 SkScalarToFixed(x) - (glyph.fAdvanceX >> a
lignShift), |
568 SkScalarToFixed(y) - (glyph.fAdvanceY >> a
lignShift), | 568 SkScalarToFixed(y) - (glyph.fAdvanceY >> a
lignShift), |
569 fontScaler); | 569 fontScaler); |
570 } | 570 } |
571 pos += scalarsPerPosition; | 571 pos += scalarsPerPosition; |
572 } | 572 } |
573 } | 573 } |
574 | 574 |
575 this->finish(); | 575 this->finish(); |
576 } | 576 } |
OLD | NEW |