diff options
author | Jim Van Verth <jvanverth@google.com> | 2018-01-30 20:37:03 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-01-30 20:37:09 +0000 |
commit | 825d4d798aed471ceff48fcb03667b268bc15a83 (patch) | |
tree | 9c5151a9d75b876f9a0d3ac786bac0cd28557c25 /src | |
parent | 51494f6615b8bd637caf0fd6d0d577ea19d50948 (diff) | |
download | skqp-825d4d798aed471ceff48fcb03667b268bc15a83.tar.gz |
Revert "Reduce the amount of padding needed for SDFs, take 2"
This reverts commit 10105308dc86dccd3d4a0c8b9863d7c749440b21.
Reason for revert:
Crashing in dm on Chromecast, looks like on dftext gm.
Seeing shape drop-outs in persp_shaders_bw on IntelBayTrail in gldft mode (second column, third and fourth rows).
Original change's description:
> Reduce the amount of padding needed for SDFs, take 2
>
> 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 2, and outset the original bounds by one texel. This allows us
> to increase the maximum size in the atlas.
>
> Change-Id: I06b229c7a3bc907d75d320461320d0b588f9a77c
> Reviewed-on: https://skia-review.googlesource.com/101843
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Jim Van Verth <jvanverth@google.com>
TBR=jvanverth@google.com,bsalomon@google.com
Change-Id: Iaedb48645027db8a84970571e82edc1f878592ed
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://skia-review.googlesource.com/102040
Reviewed-by: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Jim Van Verth <jvanverth@google.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/core/SkDistanceFieldGen.h | 9 | ||||
-rw-r--r-- | src/gpu/ops/GrSmallPathRenderer.cpp | 2 | ||||
-rw-r--r-- | src/gpu/text/GrAtlasTextContext.cpp | 6 |
3 files changed, 9 insertions, 8 deletions
diff --git a/src/core/SkDistanceFieldGen.h b/src/core/SkDistanceFieldGen.h index 16ed00ab5a..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 2 -// 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, diff --git a/src/gpu/ops/GrSmallPathRenderer.cpp b/src/gpu/ops/GrSmallPathRenderer.cpp index 0aca6f69d9..3e7da52230 100644 --- a/src/gpu/ops/GrSmallPathRenderer.cpp +++ b/src/gpu/ops/GrSmallPathRenderer.cpp @@ -37,7 +37,7 @@ static int g_NumFreedShapes = 0; // mip levels static const SkScalar kIdealMinMIP = 12; -static const SkScalar kMaxMIP = 166; +static const SkScalar kMaxMIP = 162; static const SkScalar kMaxDim = 73; static const SkScalar kMinSize = SK_ScalarHalf; diff --git a/src/gpu/text/GrAtlasTextContext.cpp b/src/gpu/text/GrAtlasTextContext.cpp index 70e032001f..1dce4e0d44 100644 --- a/src/gpu/text/GrAtlasTextContext.cpp +++ b/src/gpu/text/GrAtlasTextContext.cpp @@ -23,9 +23,9 @@ // which we switch over to drawing as paths as controlled by Options. static const int kSmallDFFontSize = 32; static const int kSmallDFFontLimit = 32; -static const int kMediumDFFontSize = 74; -static const int kMediumDFFontLimit = 74; -static const int kLargeDFFontSize = 166; +static const int kMediumDFFontSize = 72; +static const int kMediumDFFontLimit = 72; +static const int kLargeDFFontSize = 162; static const int kDefaultMinDistanceFieldFontSize = 18; #ifdef SK_BUILD_FOR_ANDROID |