aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkDistanceFieldGen.h
diff options
context:
space:
mode:
authorGravatar Jim Van Verth <jvanverth@google.com>2018-01-30 17:06:10 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-30 17:06:15 +0000
commit598f9edae6cdb7924df47716fe2551483adbfe9e (patch)
treef148180b98e6f519b29ccc38094413f8840e9971 /src/core/SkDistanceFieldGen.h
parent1c6e7831e517c9a2026233fc76f6196da4b9053b (diff)
Revert "Reduce the amount of padding needed for SDFs."
This reverts commit b42610aa9b0e431c5658f7f9ada8553e4f90869c. Reason for revert: Seeing some corrupt text in certain GMs. Original change's description: > Reduce the amount of padding needed for SDFs. > > SDF glyphs and paths were padded by 4 pixels, and had an inset of 2 > pixels within that for rendering the shape. We should be able to > use a pad of 1, and the original bounds for the shape. This allows us > to increase the maximum size in the atlas. > > Bug: skia: > Change-Id: I844d6afc4e0a52fc49fe1f6df94b635779290307 > Reviewed-on: https://skia-review.googlesource.com/101440 > Reviewed-by: Brian Salomon <bsalomon@google.com> > Commit-Queue: Jim Van Verth <jvanverth@google.com> TBR=jvanverth@google.com,bsalomon@google.com Change-Id: Ia34487a3961242c2a6baca601ecf9613b21d6963 No-Presubmit: true No-Tree-Checks: true No-Try: true Bug: skia: Reviewed-on: https://skia-review.googlesource.com/101860 Reviewed-by: Jim Van Verth <jvanverth@google.com> Commit-Queue: Jim Van Verth <jvanverth@google.com>
Diffstat (limited to 'src/core/SkDistanceFieldGen.h')
-rw-r--r--src/core/SkDistanceFieldGen.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/core/SkDistanceFieldGen.h b/src/core/SkDistanceFieldGen.h
index 5bc68b9d68..5e7af52a54 100644
--- a/src/core/SkDistanceFieldGen.h
+++ b/src/core/SkDistanceFieldGen.h
@@ -12,10 +12,11 @@
// the max magnitude for the distance field
// 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 for bilerp sampling
-#define SK_DistanceFieldPad 1
-// the rect we render with is inset from the SDF size
-#define SK_DistanceFieldInset 1
+// we need to pad around the original glyph to allow our maximum distance of
+// SK_DistanceFieldMagnitude texels away from any edge
+#define SK_DistanceFieldPad 4
+// 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,