| 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 552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 } | 576 } |
| 576 glyph->fPath = path; | 577 glyph->fPath = path; |
| 577 } | 578 } |
| 578 | 579 |
| 579 GrContext::AutoMatrix am; | 580 GrContext::AutoMatrix am; |
| 580 SkMatrix translate; | 581 SkMatrix translate; |
| 581 translate.setTranslate(SkFixedToScalar(vx - SkIntToFixed(glyph->fBounds.
fLeft)), | 582 translate.setTranslate(SkFixedToScalar(vx - SkIntToFixed(glyph->fBounds.
fLeft)), |
| 582 SkFixedToScalar(vy - SkIntToFixed(glyph->fBounds.
fTop))); | 583 SkFixedToScalar(vy - SkIntToFixed(glyph->fBounds.
fTop))); |
| 583 GrPaint tmpPaint(fPaint); | 584 GrPaint tmpPaint(fPaint); |
| 584 am.setPreConcat(fContext, translate, &tmpPaint); | 585 am.setPreConcat(fContext, translate, &tmpPaint); |
| 585 SkStrokeRec stroke(SkStrokeRec::kFill_InitStyle); | 586 GrStrokeInfo strokeInfo(SkStrokeRec::kFill_InitStyle); |
| 586 fContext->drawPath(tmpPaint, *glyph->fPath, stroke); | 587 fContext->drawPath(tmpPaint, *glyph->fPath, strokeInfo); |
| 587 return; | 588 return; |
| 588 } | 589 } |
| 589 | 590 |
| 590 HAS_ATLAS: | 591 HAS_ATLAS: |
| 591 SkASSERT(glyph->fPlot); | 592 SkASSERT(glyph->fPlot); |
| 592 GrDrawTarget::DrawToken drawToken = fDrawTarget->getCurrentDrawToken(); | 593 GrDrawTarget::DrawToken drawToken = fDrawTarget->getCurrentDrawToken(); |
| 593 glyph->fPlot->setDrawToken(drawToken); | 594 glyph->fPlot->setDrawToken(drawToken); |
| 594 | 595 |
| 595 // now promote them to fixed (TODO: Rethink using fixed pt). | 596 // now promote them to fixed (TODO: Rethink using fixed pt). |
| 596 width = SkIntToFixed(width); | 597 width = SkIntToFixed(width); |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 679 if (useColorVerts) { | 680 if (useColorVerts) { |
| 680 // color comes after position. | 681 // color comes after position. |
| 681 GrColor* colors = reinterpret_cast<GrColor*>(positions + 1); | 682 GrColor* colors = reinterpret_cast<GrColor*>(positions + 1); |
| 682 for (int i = 0; i < 4; ++i) { | 683 for (int i = 0; i < 4; ++i) { |
| 683 *colors = fPaint.getColor(); | 684 *colors = fPaint.getColor(); |
| 684 colors = reinterpret_cast<GrColor*>(reinterpret_cast<intptr_t>(colors
) + vertSize); | 685 colors = reinterpret_cast<GrColor*>(reinterpret_cast<intptr_t>(colors
) + vertSize); |
| 685 } | 686 } |
| 686 } | 687 } |
| 687 fCurrVertex += 4; | 688 fCurrVertex += 4; |
| 688 } | 689 } |
| OLD | NEW |