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

Side by Side Diff: src/gpu/GrBitmapTextContext.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 | « no previous file | src/gpu/GrDistanceFieldTextContext.cpp » ('j') | 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 "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
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
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
OLDNEW
« no previous file with comments | « no previous file | src/gpu/GrDistanceFieldTextContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698