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" |
11 #include "GrFontScaler.h" | 11 #include "GrFontScaler.h" |
12 #include "GrIndexBuffer.h" | 12 #include "GrIndexBuffer.h" |
| 13 #include "GrStrokeInfo.h" |
13 #include "GrTextStrike.h" | 14 #include "GrTextStrike.h" |
14 #include "GrTextStrike_impl.h" | 15 #include "GrTextStrike_impl.h" |
15 #include "SkColorPriv.h" | 16 #include "SkColorPriv.h" |
16 #include "SkPath.h" | 17 #include "SkPath.h" |
17 #include "SkRTConf.h" | 18 #include "SkRTConf.h" |
18 #include "SkStrokeRec.h" | 19 #include "SkStrokeRec.h" |
19 #include "effects/GrCustomCoordsTextureEffect.h" | 20 #include "effects/GrCustomCoordsTextureEffect.h" |
20 | 21 |
21 #include "SkAutoKern.h" | 22 #include "SkAutoKern.h" |
22 #include "SkDraw.h" | 23 #include "SkDraw.h" |
(...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
551 } | 552 } |
552 glyph->fPath = path; | 553 glyph->fPath = path; |
553 } | 554 } |
554 | 555 |
555 GrContext::AutoMatrix am; | 556 GrContext::AutoMatrix am; |
556 SkMatrix translate; | 557 SkMatrix translate; |
557 translate.setTranslate(SkFixedToScalar(vx - SkIntToFixed(glyph->fBounds.
fLeft)), | 558 translate.setTranslate(SkFixedToScalar(vx - SkIntToFixed(glyph->fBounds.
fLeft)), |
558 SkFixedToScalar(vy - SkIntToFixed(glyph->fBounds.
fTop))); | 559 SkFixedToScalar(vy - SkIntToFixed(glyph->fBounds.
fTop))); |
559 GrPaint tmpPaint(fPaint); | 560 GrPaint tmpPaint(fPaint); |
560 am.setPreConcat(fContext, translate, &tmpPaint); | 561 am.setPreConcat(fContext, translate, &tmpPaint); |
561 SkStrokeRec stroke(SkStrokeRec::kFill_InitStyle); | 562 GrStrokeInfo strokeInfo(SkStrokeRec::kFill_InitStyle); |
562 fContext->drawPath(tmpPaint, *glyph->fPath, stroke); | 563 fContext->drawPath(tmpPaint, *glyph->fPath, strokeInfo); |
563 return; | 564 return; |
564 } | 565 } |
565 | 566 |
566 HAS_ATLAS: | 567 HAS_ATLAS: |
567 SkASSERT(glyph->fPlot); | 568 SkASSERT(glyph->fPlot); |
568 GrDrawTarget::DrawToken drawToken = fDrawTarget->getCurrentDrawToken(); | 569 GrDrawTarget::DrawToken drawToken = fDrawTarget->getCurrentDrawToken(); |
569 glyph->fPlot->setDrawToken(drawToken); | 570 glyph->fPlot->setDrawToken(drawToken); |
570 | 571 |
571 // now promote them to fixed (TODO: Rethink using fixed pt). | 572 // now promote them to fixed (TODO: Rethink using fixed pt). |
572 width = SkIntToFixed(width); | 573 width = SkIntToFixed(width); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
626 | 627 |
627 fVertices[2*fCurrVertex].setRectFan(r.fLeft, r.fTop, r.fRight, r.fBottom, | 628 fVertices[2*fCurrVertex].setRectFan(r.fLeft, r.fTop, r.fRight, r.fBottom, |
628 2 * sizeof(SkPoint)); | 629 2 * sizeof(SkPoint)); |
629 fVertices[2*fCurrVertex+1].setRectFan(SkFixedToFloat(texture->normalizeFixed
X(tx)), | 630 fVertices[2*fCurrVertex+1].setRectFan(SkFixedToFloat(texture->normalizeFixed
X(tx)), |
630 SkFixedToFloat(texture->normalizeFixed
Y(ty)), | 631 SkFixedToFloat(texture->normalizeFixed
Y(ty)), |
631 SkFixedToFloat(texture->normalizeFixed
X(tx + width)), | 632 SkFixedToFloat(texture->normalizeFixed
X(tx + width)), |
632 SkFixedToFloat(texture->normalizeFixed
Y(ty + height)), | 633 SkFixedToFloat(texture->normalizeFixed
Y(ty + height)), |
633 2 * sizeof(SkPoint)); | 634 2 * sizeof(SkPoint)); |
634 fCurrVertex += 4; | 635 fCurrVertex += 4; |
635 } | 636 } |
OLD | NEW |