Chromium Code Reviews| 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; |