| 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" |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 if (NULL == glyph->fPath) { | 400 if (NULL == glyph->fPath) { |
| 401 SkPath* path = SkNEW(SkPath); | 401 SkPath* path = SkNEW(SkPath); |
| 402 if (!scaler->getGlyphPath(glyph->glyphID(), path)) { | 402 if (!scaler->getGlyphPath(glyph->glyphID(), path)) { |
| 403 // flag the glyph as being dead? | 403 // flag the glyph as being dead? |
| 404 delete path; | 404 delete path; |
| 405 return; | 405 return; |
| 406 } | 406 } |
| 407 glyph->fPath = path; | 407 glyph->fPath = path; |
| 408 } | 408 } |
| 409 | 409 |
| 410 // flush any accumulated draws before drawing this glyph as a path. |
| 411 this->flush(); |
| 412 |
| 410 GrContext::AutoMatrix am; | 413 GrContext::AutoMatrix am; |
| 411 SkMatrix translate; | 414 SkMatrix translate; |
| 412 translate.setTranslate(SkFixedToScalar(vx - SkIntToFixed(glyph->fBounds.
fLeft)), | 415 translate.setTranslate(SkFixedToScalar(vx - SkIntToFixed(glyph->fBounds.
fLeft)), |
| 413 SkFixedToScalar(vy - SkIntToFixed(glyph->fBounds.
fTop))); | 416 SkFixedToScalar(vy - SkIntToFixed(glyph->fBounds.
fTop))); |
| 414 GrPaint tmpPaint(fPaint); | 417 GrPaint tmpPaint(fPaint); |
| 415 am.setPreConcat(fContext, translate, &tmpPaint); | 418 am.setPreConcat(fContext, translate, &tmpPaint); |
| 416 GrStrokeInfo strokeInfo(SkStrokeRec::kFill_InitStyle); | 419 GrStrokeInfo strokeInfo(SkStrokeRec::kFill_InitStyle); |
| 417 fContext->drawPath(tmpPaint, *glyph->fPath, strokeInfo); | 420 fContext->drawPath(tmpPaint, *glyph->fPath, strokeInfo); |
| 418 return; | 421 return; |
| 419 } | 422 } |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 608 SkSafeSetNull(fCurrTexture); | 611 SkSafeSetNull(fCurrTexture); |
| 609 } | 612 } |
| 610 } | 613 } |
| 611 | 614 |
| 612 inline void GrBitmapTextContext::finish() { | 615 inline void GrBitmapTextContext::finish() { |
| 613 this->flush(); | 616 this->flush(); |
| 614 | 617 |
| 615 GrTextContext::finish(); | 618 GrTextContext::finish(); |
| 616 } | 619 } |
| 617 | 620 |
| OLD | NEW |