| 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 "GrPaintStyle.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); |
| 562 GrPaintStyle style; |
| 561 SkStrokeRec stroke(SkStrokeRec::kFill_InitStyle); | 563 SkStrokeRec stroke(SkStrokeRec::kFill_InitStyle); |
| 562 fContext->drawPath(tmpPaint, *glyph->fPath, stroke); | 564 style.setStrokeRec(&stroke); |
| 565 fContext->drawPath(tmpPaint, *glyph->fPath, style); |
| 563 return; | 566 return; |
| 564 } | 567 } |
| 565 | 568 |
| 566 HAS_ATLAS: | 569 HAS_ATLAS: |
| 567 SkASSERT(glyph->fPlot); | 570 SkASSERT(glyph->fPlot); |
| 568 GrDrawTarget::DrawToken drawToken = fDrawTarget->getCurrentDrawToken(); | 571 GrDrawTarget::DrawToken drawToken = fDrawTarget->getCurrentDrawToken(); |
| 569 glyph->fPlot->setDrawToken(drawToken); | 572 glyph->fPlot->setDrawToken(drawToken); |
| 570 | 573 |
| 571 // now promote them to fixed (TODO: Rethink using fixed pt). | 574 // now promote them to fixed (TODO: Rethink using fixed pt). |
| 572 width = SkIntToFixed(width); | 575 width = SkIntToFixed(width); |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 626 | 629 |
| 627 fVertices[2*fCurrVertex].setRectFan(r.fLeft, r.fTop, r.fRight, r.fBottom, | 630 fVertices[2*fCurrVertex].setRectFan(r.fLeft, r.fTop, r.fRight, r.fBottom, |
| 628 2 * sizeof(SkPoint)); | 631 2 * sizeof(SkPoint)); |
| 629 fVertices[2*fCurrVertex+1].setRectFan(SkFixedToFloat(texture->normalizeFixed
X(tx)), | 632 fVertices[2*fCurrVertex+1].setRectFan(SkFixedToFloat(texture->normalizeFixed
X(tx)), |
| 630 SkFixedToFloat(texture->normalizeFixed
Y(ty)), | 633 SkFixedToFloat(texture->normalizeFixed
Y(ty)), |
| 631 SkFixedToFloat(texture->normalizeFixed
X(tx + width)), | 634 SkFixedToFloat(texture->normalizeFixed
X(tx + width)), |
| 632 SkFixedToFloat(texture->normalizeFixed
Y(ty + height)), | 635 SkFixedToFloat(texture->normalizeFixed
Y(ty + height)), |
| 633 2 * sizeof(SkPoint)); | 636 2 * sizeof(SkPoint)); |
| 634 fCurrVertex += 4; | 637 fCurrVertex += 4; |
| 635 } | 638 } |
| OLD | NEW |