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 "GrDrawTarget.h" | 10 #include "GrDrawTarget.h" |
11 #include "GrDrawTargetCaps.h" | 11 #include "GrDrawTargetCaps.h" |
12 #include "GrFontScaler.h" | 12 #include "GrFontScaler.h" |
13 #include "SkGlyphCache.h" | 13 #include "SkGlyphCache.h" |
14 #include "GrIndexBuffer.h" | 14 #include "GrIndexBuffer.h" |
| 15 #include "GrStrokeInfo.h" |
15 #include "GrTextStrike.h" | 16 #include "GrTextStrike.h" |
16 #include "GrTextStrike_impl.h" | 17 #include "GrTextStrike_impl.h" |
17 #include "SkDistanceFieldGen.h" | 18 #include "SkDistanceFieldGen.h" |
18 #include "SkDraw.h" | 19 #include "SkDraw.h" |
19 #include "SkGpuDevice.h" | 20 #include "SkGpuDevice.h" |
20 #include "SkPath.h" | 21 #include "SkPath.h" |
21 #include "SkRTConf.h" | 22 #include "SkRTConf.h" |
22 #include "SkStrokeRec.h" | 23 #include "SkStrokeRec.h" |
23 #include "effects/GrDistanceFieldTextureEffect.h" | 24 #include "effects/GrDistanceFieldTextureEffect.h" |
24 | 25 |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 } | 241 } |
241 glyph->fPath = path; | 242 glyph->fPath = path; |
242 } | 243 } |
243 | 244 |
244 GrContext::AutoMatrix am; | 245 GrContext::AutoMatrix am; |
245 SkMatrix ctm; | 246 SkMatrix ctm; |
246 ctm.setScale(fTextRatio, fTextRatio); | 247 ctm.setScale(fTextRatio, fTextRatio); |
247 ctm.postTranslate(sx, sy); | 248 ctm.postTranslate(sx, sy); |
248 GrPaint tmpPaint(fPaint); | 249 GrPaint tmpPaint(fPaint); |
249 am.setPreConcat(fContext, ctm, &tmpPaint); | 250 am.setPreConcat(fContext, ctm, &tmpPaint); |
250 SkStrokeRec stroke(SkStrokeRec::kFill_InitStyle); | 251 GrStrokeInfo strokeInfo(SkStrokeRec::kFill_InitStyle); |
251 fContext->drawPath(tmpPaint, *glyph->fPath, stroke); | 252 fContext->drawPath(tmpPaint, *glyph->fPath, strokeInfo); |
252 return; | 253 return; |
253 } | 254 } |
254 | 255 |
255 HAS_ATLAS: | 256 HAS_ATLAS: |
256 SkASSERT(glyph->fPlot); | 257 SkASSERT(glyph->fPlot); |
257 GrDrawTarget::DrawToken drawToken = fDrawTarget->getCurrentDrawToken(); | 258 GrDrawTarget::DrawToken drawToken = fDrawTarget->getCurrentDrawToken(); |
258 glyph->fPlot->setDrawToken(drawToken); | 259 glyph->fPlot->setDrawToken(drawToken); |
259 | 260 |
260 GrTexture* texture = glyph->fPlot->texture(); | 261 GrTexture* texture = glyph->fPlot->texture(); |
261 SkASSERT(texture); | 262 SkASSERT(texture); |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
495 SkScalarToFixed(x) - (glyph.fAdvanceX >> a
lignShift), | 496 SkScalarToFixed(x) - (glyph.fAdvanceX >> a
lignShift), |
496 SkScalarToFixed(y) - (glyph.fAdvanceY >> a
lignShift), | 497 SkScalarToFixed(y) - (glyph.fAdvanceY >> a
lignShift), |
497 fontScaler); | 498 fontScaler); |
498 } | 499 } |
499 pos += scalarsPerPosition; | 500 pos += scalarsPerPosition; |
500 } | 501 } |
501 } | 502 } |
502 | 503 |
503 this->finish(); | 504 this->finish(); |
504 } | 505 } |
OLD | NEW |