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

Unified Diff: src/gpu/GrDistanceFieldTextContext.cpp

Issue 772633003: Fix overoptimization in distance field code on N7 and N10. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrDistanceFieldTextContext.cpp
diff --git a/src/gpu/GrDistanceFieldTextContext.cpp b/src/gpu/GrDistanceFieldTextContext.cpp
index e5374f2a45abcb0742c0a2c8942ee643a21bce34..5b679d1c80cad90fb80f7ba6d41a83137bbb51d8 100755
--- a/src/gpu/GrDistanceFieldTextContext.cpp
+++ b/src/gpu/GrDistanceFieldTextContext.cpp
@@ -519,32 +519,36 @@ bool GrDistanceFieldTextContext::appendGlyph(GrGlyph::PackedID packed,
return true;
}
- if (NULL == glyph->fPlot && !uploadGlyph(glyph, scaler)) {
- if (NULL == glyph->fPath) {
- SkPath* path = SkNEW(SkPath);
- if (!scaler->getGlyphPath(glyph->glyphID(), path)) {
- // flag the glyph as being dead?
- delete path;
- return true;
+ if (NULL == glyph->fPlot) {
+ // needs to be a separate conditional to avoid over-optimization
+ // on Nexus 7 and Nexus 10
+ if (!uploadGlyph(glyph, scaler)) {
+ if (NULL == glyph->fPath) {
+ SkPath* path = SkNEW(SkPath);
+ if (!scaler->getGlyphPath(glyph->glyphID(), path)) {
+ // flag the glyph as being dead?
+ delete path;
+ return true;
+ }
+ glyph->fPath = path;
}
- glyph->fPath = path;
- }
- // flush any accumulated draws before drawing this glyph as a path.
- this->flush();
+ // flush any accumulated draws before drawing this glyph as a path.
+ this->flush();
- GrContext::AutoMatrix am;
- SkMatrix ctm;
- ctm.setScale(fTextRatio, fTextRatio);
- ctm.postTranslate(sx - dx, sy - dy);
- GrPaint tmpPaint(fPaint);
- am.setPreConcat(fContext, ctm, &tmpPaint);
- GrStrokeInfo strokeInfo(SkStrokeRec::kFill_InitStyle);
- fContext->drawPath(tmpPaint, *glyph->fPath, strokeInfo);
-
- // remove this glyph from the vertices we need to allocate
- fTotalVertexCount -= kVerticesPerGlyph;
- return true;
+ GrContext::AutoMatrix am;
+ SkMatrix ctm;
+ ctm.setScale(fTextRatio, fTextRatio);
+ ctm.postTranslate(sx - dx, sy - dy);
+ GrPaint tmpPaint(fPaint);
+ am.setPreConcat(fContext, ctm, &tmpPaint);
+ GrStrokeInfo strokeInfo(SkStrokeRec::kFill_InitStyle);
+ fContext->drawPath(tmpPaint, *glyph->fPath, strokeInfo);
+
+ // remove this glyph from the vertices we need to allocate
+ fTotalVertexCount -= kVerticesPerGlyph;
+ return true;
+ }
}
SkASSERT(glyph->fPlot);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698