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

Unified Diff: src/gpu/effects/GrDistanceFieldGeoProc.cpp

Issue 1086183002: Fix LCD text and add path fix for Mali. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 8 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 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/effects/GrDistanceFieldGeoProc.cpp
diff --git a/src/gpu/effects/GrDistanceFieldGeoProc.cpp b/src/gpu/effects/GrDistanceFieldGeoProc.cpp
index 05e42c9240e1fcb3e2af49da544d2145a9fd527b..ed087ddbd411551460ed7ea1849e554723b55625 100755
--- a/src/gpu/effects/GrDistanceFieldGeoProc.cpp
+++ b/src/gpu/effects/GrDistanceFieldGeoProc.cpp
@@ -365,7 +365,7 @@ public:
// to ensure we're mapping 1:1 from texel space to pixel space.
// this gives us a smooth step across approximately one fragment
- fsBuilder->codeAppend("afwidth = abs(" SK_DistanceFieldAAFactor "*dFdx(st.x));");
+ fsBuilder->codeAppend("afwidth = abs(" SK_DistanceFieldAAFactor "*dFdy(st.y));");
} else {
// For general transforms, to determine the amount of correction we multiply a unit
// vector pointing along the SDF gradient direction by the Jacobian of the st coords
@@ -605,7 +605,7 @@ public:
fsBuilder->codeAppend("float delta = " GR_FONT_ATLAS_LCD_DELTA ";\n");
}
if (isUniformScale) {
- fsBuilder->codeAppendf("float dy = dFdy(%s.y);", st.fsIn());
+ fsBuilder->codeAppendf("float dy = abs(dFdy(%s.y));", st.fsIn());
fsBuilder->codeAppend("vec2 offset = vec2(dy*delta, 0.0);");
} else {
fsBuilder->codeAppendf("vec2 st = %s;\n", st.fsIn());
@@ -655,7 +655,7 @@ public:
// to ensure we're mapping 1:1 from texel space to pixel space.
// this gives us a smooth step across approximately one fragment
- fsBuilder->codeAppend("afwidth = abs(" SK_DistanceFieldAAFactor "*dy);");
+ fsBuilder->codeAppend("afwidth = " SK_DistanceFieldAAFactor "*dy;");
} else {
// For general transforms, to determine the amount of correction we multiply a unit
// vector pointing along the SDF gradient direction by the Jacobian of the st coords
« 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