| 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 "GrBitmapTextContext.h" | 10 #include "GrBitmapTextContext.h" |
| (...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 if (NULL == glyph->fPath) { | 480 if (NULL == glyph->fPath) { |
| 481 SkPath* path = SkNEW(SkPath); | 481 SkPath* path = SkNEW(SkPath); |
| 482 if (!scaler->getGlyphPath(glyph->glyphID(), path)) { | 482 if (!scaler->getGlyphPath(glyph->glyphID(), path)) { |
| 483 // flag the glyph as being dead? | 483 // flag the glyph as being dead? |
| 484 delete path; | 484 delete path; |
| 485 return; | 485 return; |
| 486 } | 486 } |
| 487 glyph->fPath = path; | 487 glyph->fPath = path; |
| 488 } | 488 } |
| 489 | 489 |
| 490 // flush any accumulated draws before drawing this glyph as a path. |
| 491 this->flush(); |
| 492 |
| 490 GrContext::AutoMatrix am; | 493 GrContext::AutoMatrix am; |
| 491 SkMatrix ctm; | 494 SkMatrix ctm; |
| 492 ctm.setScale(fTextRatio, fTextRatio); | 495 ctm.setScale(fTextRatio, fTextRatio); |
| 493 ctm.postTranslate(sx, sy); | 496 ctm.postTranslate(sx, sy); |
| 494 GrPaint tmpPaint(fPaint); | 497 GrPaint tmpPaint(fPaint); |
| 495 am.setPreConcat(fContext, ctm, &tmpPaint); | 498 am.setPreConcat(fContext, ctm, &tmpPaint); |
| 496 GrStrokeInfo strokeInfo(SkStrokeRec::kFill_InitStyle); | 499 GrStrokeInfo strokeInfo(SkStrokeRec::kFill_InitStyle); |
| 497 fContext->drawPath(tmpPaint, *glyph->fPath, strokeInfo); | 500 fContext->drawPath(tmpPaint, *glyph->fPath, strokeInfo); |
| 498 return; | 501 return; |
| 499 } | 502 } |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 678 fVertexBounds.setLargestInverted(); | 681 fVertexBounds.setLargestInverted(); |
| 679 } | 682 } |
| 680 } | 683 } |
| 681 | 684 |
| 682 inline void GrDistanceFieldTextContext::finish() { | 685 inline void GrDistanceFieldTextContext::finish() { |
| 683 this->flush(); | 686 this->flush(); |
| 684 | 687 |
| 685 GrTextContext::finish(); | 688 GrTextContext::finish(); |
| 686 } | 689 } |
| 687 | 690 |
| OLD | NEW |