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

Unified Diff: src/core/SkDistanceFieldGen.h

Issue 1726763002: Use ARM fixes for SDF encoding. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix another comment Created 4 years, 10 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 | src/core/SkDistanceFieldGen.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkDistanceFieldGen.h
diff --git a/src/core/SkDistanceFieldGen.h b/src/core/SkDistanceFieldGen.h
index 4a09ace107f16c241fdaeddbd084e5a89f952126..5e7af52a540895e05ae521b18cb2f82984311772 100644
--- a/src/core/SkDistanceFieldGen.h
+++ b/src/core/SkDistanceFieldGen.h
@@ -10,7 +10,7 @@
#include "SkTypes.h"
// the max magnitude for the distance field
-// distance values are limited to the range [-SK_DistanceFieldMagnitude, SK_DistanceFieldMagnitude)
+// distance values are limited to the range (-SK_DistanceFieldMagnitude, SK_DistanceFieldMagnitude]
#define SK_DistanceFieldMagnitude 4
// we need to pad around the original glyph to allow our maximum distance of
// SK_DistanceFieldMagnitude texels away from any edge
@@ -18,9 +18,10 @@
// the rect we render with is inset from the distance field glyph size to allow for bilerp
#define SK_DistanceFieldInset 2
-// for the fragment shader
-// The distance field is constructed as unsigned char values, so that the zero value is at 128,
-// and the range is [-4, 4 - 1/255). Hence our multiplier is 8 - 1/32 and zero threshold is 128/255.
+// For the fragment shader:
+// The distance field is constructed as unsigned char values,
+// so that the zero value is at 128, and the supported range of distances is [-4 * 127/128, 4].
+// Hence our multiplier (width of the range) is 4 * 255/128 and zero threshold is 128/255.
#define SK_DistanceFieldMultiplier "7.96875"
#define SK_DistanceFieldThreshold "0.50196078431"
« no previous file with comments | « no previous file | src/core/SkDistanceFieldGen.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698