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

Unified Diff: src/core/SkDistanceFieldGen.cpp

Issue 1643143002: Generate Signed Distance Field directly from vector path (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Move implementation to src/gpu Created 4 years, 11 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
Index: src/core/SkDistanceFieldGen.cpp
diff --git a/src/core/SkDistanceFieldGen.cpp b/src/core/SkDistanceFieldGen.cpp
index 147aefad79052428453494e33fb98ea4e21e9d43..49d3b9fd4efe8bc700ad48c97040645f12ad508c 100755
--- a/src/core/SkDistanceFieldGen.cpp
+++ b/src/core/SkDistanceFieldGen.cpp
@@ -317,7 +317,7 @@ static void B2(DFData* curr, int width) {
#if !DUMP_EDGE
static unsigned char pack_distance_field_val(float dist, float distanceMagnitude) {
- if (dist <= -distanceMagnitude) {
+ if (dist <= -(distanceMagnitude*(1.0f-1.0f/128.0f))) {
bsalomon 2016/02/02 18:03:48 Can you add a comment that explains this constant?
Joel.Liang 2016/02/04 12:12:04 Done. And I'd like to give a example here: If dis
jvanverth1 2016/02/04 14:21:22 Thanks, that equation is a lot clearer (and thanks
Joel.Liang 2016/02/22 07:34:00 Actually, the example I gave here is wrong(The inp
return 255;
} else if (dist > distanceMagnitude) {
return 0;

Powered by Google App Engine
This is Rietveld 408576698