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 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 }; | 481 }; |
482 | 482 |
483 void GrBitmapTextContext::drawPackedGlyph(GrGlyph::PackedID packed, | 483 void GrBitmapTextContext::drawPackedGlyph(GrGlyph::PackedID packed, |
484 GrFixed vx, GrFixed vy, | 484 GrFixed vx, GrFixed vy, |
485 GrFontScaler* scaler) { | 485 GrFontScaler* scaler) { |
486 if (NULL == fDrawTarget) { | 486 if (NULL == fDrawTarget) { |
487 return; | 487 return; |
488 } | 488 } |
489 | 489 |
490 if (NULL == fStrike) { | 490 if (NULL == fStrike) { |
491 #if SK_DISTANCEFIELD_FONTS | |
492 fStrike = fContext->getFontCache()->getStrike(scaler, false); | 491 fStrike = fContext->getFontCache()->getStrike(scaler, false); |
493 #else | |
494 fStrike = fContext->getFontCache()->getStrike(scaler); | |
495 #endif | |
496 } | 492 } |
497 | 493 |
498 GrGlyph* glyph = fStrike->getGlyph(packed, scaler); | 494 GrGlyph* glyph = fStrike->getGlyph(packed, scaler); |
499 if (NULL == glyph || glyph->fBounds.isEmpty()) { | 495 if (NULL == glyph || glyph->fBounds.isEmpty()) { |
500 return; | 496 return; |
501 } | 497 } |
502 | 498 |
503 vx += SkIntToFixed(glyph->fBounds.fLeft); | 499 vx += SkIntToFixed(glyph->fBounds.fLeft); |
504 vy += SkIntToFixed(glyph->fBounds.fTop); | 500 vy += SkIntToFixed(glyph->fBounds.fTop); |
505 | 501 |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
628 | 624 |
629 fVertices[2*fCurrVertex].setRectFan(r.fLeft, r.fTop, r.fRight, r.fBottom, | 625 fVertices[2*fCurrVertex].setRectFan(r.fLeft, r.fTop, r.fRight, r.fBottom, |
630 2 * sizeof(SkPoint)); | 626 2 * sizeof(SkPoint)); |
631 fVertices[2*fCurrVertex+1].setRectFan(SkFixedToFloat(texture->normalizeFixed
X(tx)), | 627 fVertices[2*fCurrVertex+1].setRectFan(SkFixedToFloat(texture->normalizeFixed
X(tx)), |
632 SkFixedToFloat(texture->normalizeFixed
Y(ty)), | 628 SkFixedToFloat(texture->normalizeFixed
Y(ty)), |
633 SkFixedToFloat(texture->normalizeFixed
X(tx + width)), | 629 SkFixedToFloat(texture->normalizeFixed
X(tx + width)), |
634 SkFixedToFloat(texture->normalizeFixed
Y(ty + height)), | 630 SkFixedToFloat(texture->normalizeFixed
Y(ty + height)), |
635 2 * sizeof(SkPoint)); | 631 2 * sizeof(SkPoint)); |
636 fCurrVertex += 4; | 632 fCurrVertex += 4; |
637 } | 633 } |
OLD | NEW |