diff options
-rwxr-xr-x | src/core/SkDistanceFieldGen.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/SkDistanceFieldGen.cpp b/src/core/SkDistanceFieldGen.cpp index 147aefad79..f1ebfa558a 100755 --- a/src/core/SkDistanceFieldGen.cpp +++ b/src/core/SkDistanceFieldGen.cpp @@ -107,6 +107,9 @@ static void init_glyph_data(DFData* data, unsigned char* edges, const unsigned c // computes the distance to an edge given an edge normal vector and a pixel's alpha value // assumes that direction has been pre-normalized static float edge_distance(const SkPoint& direction, float alpha) { +#if 1 // formula (1) + return 0.5f - alpha; +#else // formula (4) float dx = direction.fX; float dy = direction.fY; float distance; @@ -143,6 +146,7 @@ static float edge_distance(const SkPoint& direction, float alpha) { } return distance; +#endif } static void init_distances(DFData* data, unsigned char* edges, int width, int height) { |