diff options
author | Brian Salomon <bsalomon@google.com> | 2017-12-15 11:31:05 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-12-19 21:10:36 +0000 |
commit | 0a241ce808511ceb1c72d6f2473b01b455ac5101 (patch) | |
tree | c137018f24c515dde2d85d4eb6d3f0b7ed0081a7 /src/gpu | |
parent | ab10c8258d7588bb9c353a8ecc1944747a4fac62 (diff) |
Don't canonicalize empty SkRRects. They stroke differently.
Make insetting greater than width or height collapse to a point/line.
SkPath::addRRect() doesn't ignore an empty SkRRect.
Change-Id: I933a3419a6d75be534f1d8328faa715772045f67
Reviewed-on: https://skia-review.googlesource.com/85680
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu')
-rw-r--r-- | src/gpu/GrShape.cpp | 1 | ||||
-rw-r--r-- | src/gpu/effects/GrRRectEffect.cpp | 8 |
2 files changed, 3 insertions, 6 deletions
diff --git a/src/gpu/GrShape.cpp b/src/gpu/GrShape.cpp index 91cd3c8eb1..8c56054135 100644 --- a/src/gpu/GrShape.cpp +++ b/src/gpu/GrShape.cpp @@ -539,6 +539,7 @@ void GrShape::attemptToSimplifyPath() { void GrShape::attemptToSimplifyRRect() { SkASSERT(Type::kRRect == fType); SkASSERT(!fInheritedKey.count()); + // TODO: This isn't valid for strokes. if (fRRectData.fRRect.isEmpty()) { // Dashing ignores the inverseness currently. skbug.com/5421 fType = fRRectData.fInverted && !fStyle.isDashed() ? Type::kInvertedEmpty : Type::kEmpty; diff --git a/src/gpu/effects/GrRRectEffect.cpp b/src/gpu/effects/GrRRectEffect.cpp index 871578f924..c6430abd15 100644 --- a/src/gpu/effects/GrRRectEffect.cpp +++ b/src/gpu/effects/GrRRectEffect.cpp @@ -132,9 +132,7 @@ std::unique_ptr<GrFragmentProcessor> CircularRRectEffect::TestCreate(GrProcessor class GLCircularRRectEffect : public GrGLSLFragmentProcessor { public: - GLCircularRRectEffect() { - fPrevRRect.setEmpty(); - } + GLCircularRRectEffect() = default; virtual void emitCode(EmitArgs&) override; @@ -483,9 +481,7 @@ std::unique_ptr<GrFragmentProcessor> EllipticalRRectEffect::TestCreate(GrProcess class GLEllipticalRRectEffect : public GrGLSLFragmentProcessor { public: - GLEllipticalRRectEffect() { - fPrevRRect.setEmpty(); - } + GLEllipticalRRectEffect() = default; void emitCode(EmitArgs&) override; |