Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Side by Side Diff: src/gpu/GrDistanceFieldTextContext.cpp

Issue 636233008: Flush text contexts before drawing text as path (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/gpu/GrBitmapTextContext.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « src/gpu/GrBitmapTextContext.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698