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

Unified Diff: src/gpu/GrDistanceFieldTextContext.cpp

Issue 793013003: Remove the low hanging fruit with coord change matrices (Closed) Base URL: https://skia.googlesource.com/skia.git@more-ccm-cleanup
Patch Set: adding tests to ignore 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 | « src/gpu/GrBitmapTextContext.cpp ('k') | 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 a6cb285a707b043609329aadf93f521d87609109..8d993fa2039e116f4cca56ed9fd55e67131af6e4 100755
--- a/src/gpu/GrDistanceFieldTextContext.cpp
+++ b/src/gpu/GrDistanceFieldTextContext.cpp
@@ -535,6 +535,8 @@ bool GrDistanceFieldTextContext::appendGlyph(GrGlyph::PackedID packed,
if (NULL == glyph->fPlot) {
// needs to be a separate conditional to avoid over-optimization
// on Nexus 7 and Nexus 10
+
+ // If the glyph is too large we fall back to paths
if (!uploadGlyph(glyph, scaler)) {
if (NULL == glyph->fPath) {
SkPath* path = SkNEW(SkPath);
@@ -552,13 +554,12 @@ bool GrDistanceFieldTextContext::appendGlyph(GrGlyph::PackedID packed,
SkMatrix ctm;
ctm.setScale(fTextRatio, fTextRatio);
ctm.postTranslate(sx - dx, sy - dy);
- GrPaint tmpPaint(fPaint);
- tmpPaint.localCoordChange(ctm);
- SkMatrix viewM = fViewMatrix;
- viewM.preConcat(ctm);
+ SkPath tmpPath(*glyph->fPath);
+ tmpPath.transform(ctm);
+
GrStrokeInfo strokeInfo(SkStrokeRec::kFill_InitStyle);
- fContext->drawPath(tmpPaint, viewM, *glyph->fPath, strokeInfo);
+ fContext->drawPath(fPaint, fViewMatrix, tmpPath, strokeInfo);
// remove this glyph from the vertices we need to allocate
fTotalVertexCount -= kVerticesPerGlyph;
« 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