| 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" |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 SkPath* path = SkNEW(SkPath); | 232 SkPath* path = SkNEW(SkPath); |
| 233 if (!scaler->getGlyphPath(glyph->glyphID(), path)) { | 233 if (!scaler->getGlyphPath(glyph->glyphID(), path)) { |
| 234 // flag the glyph as being dead? | 234 // flag the glyph as being dead? |
| 235 delete path; | 235 delete path; |
| 236 return; | 236 return; |
| 237 } | 237 } |
| 238 glyph->fPath = path; | 238 glyph->fPath = path; |
| 239 } | 239 } |
| 240 | 240 |
| 241 GrContext::AutoMatrix am; | 241 GrContext::AutoMatrix am; |
| 242 SkMatrix translate; | 242 SkMatrix ctm; |
| 243 translate.setTranslate(sx, sy); | 243 ctm.setScale(fTextRatio, fTextRatio); |
| 244 ctm.postTranslate(sx, sy); |
| 244 GrPaint tmpPaint(fPaint); | 245 GrPaint tmpPaint(fPaint); |
| 245 am.setPreConcat(fContext, translate, &tmpPaint); | 246 am.setPreConcat(fContext, ctm, &tmpPaint); |
| 246 SkStrokeRec stroke(SkStrokeRec::kFill_InitStyle); | 247 SkStrokeRec stroke(SkStrokeRec::kFill_InitStyle); |
| 247 fContext->drawPath(tmpPaint, *glyph->fPath, stroke); | 248 fContext->drawPath(tmpPaint, *glyph->fPath, stroke); |
| 248 return; | 249 return; |
| 249 } | 250 } |
| 250 | 251 |
| 251 HAS_ATLAS: | 252 HAS_ATLAS: |
| 252 SkASSERT(glyph->fPlot); | 253 SkASSERT(glyph->fPlot); |
| 253 GrDrawTarget::DrawToken drawToken = fDrawTarget->getCurrentDrawToken(); | 254 GrDrawTarget::DrawToken drawToken = fDrawTarget->getCurrentDrawToken(); |
| 254 glyph->fPlot->setDrawToken(drawToken); | 255 glyph->fPlot->setDrawToken(drawToken); |
| 255 | 256 |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 493 SkScalarToFixed(y) - (glyph.fAdvanceY >> a
lignShift) | 494 SkScalarToFixed(y) - (glyph.fAdvanceY >> a
lignShift) |
| 494 + SK_FixedHalf, //d1g.fHalfSampleY, | 495 + SK_FixedHalf, //d1g.fHalfSampleY, |
| 495 fontScaler); | 496 fontScaler); |
| 496 } | 497 } |
| 497 pos += scalarsPerPosition; | 498 pos += scalarsPerPosition; |
| 498 } | 499 } |
| 499 } | 500 } |
| 500 | 501 |
| 501 this->finish(); | 502 this->finish(); |
| 502 } | 503 } |
| OLD | NEW |