diff options
author | 2017-12-01 16:01:47 -0500 | |
---|---|---|
committer | 2017-12-01 21:25:39 +0000 | |
commit | 6574921253197338f879130ed99fb9ce483976de (patch) | |
tree | 786f7d99ecdd4efeab5c2ea68e02fd24b189d5a0 /src/gpu/effects/GrCircleEffect.h | |
parent | 80654c16bd47ec800cacc9845c9129e203427914 (diff) |
Revert "Revert "Fix rendering of drrects with small circular inner rrects.""
This reverts commit ec727c981dd7ed83e98c7713c2828c6ab144937b.
Change-Id: Id3164619016d58b2bcc0b8af606215653f553fce
Reviewed-on: https://skia-review.googlesource.com/79422
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Salomon <bsalomon@google.com>
Diffstat (limited to 'src/gpu/effects/GrCircleEffect.h')
-rw-r--r-- | src/gpu/effects/GrCircleEffect.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gpu/effects/GrCircleEffect.h b/src/gpu/effects/GrCircleEffect.h index bf6bd0e8e6..d721a78241 100644 --- a/src/gpu/effects/GrCircleEffect.h +++ b/src/gpu/effects/GrCircleEffect.h @@ -19,8 +19,14 @@ public: GrClipEdgeType edgeType() const { return fEdgeType; } SkPoint center() const { return fCenter; } float radius() const { return fRadius; } + static std::unique_ptr<GrFragmentProcessor> Make(GrClipEdgeType edgeType, SkPoint center, float radius) { + // A radius below half causes the implicit insetting done by this processor to become + // inverted. We could handle this case by making the processor code more complicated. + if (radius < .5f) { + return nullptr; + } return std::unique_ptr<GrFragmentProcessor>(new GrCircleEffect(edgeType, center, radius)); } GrCircleEffect(const GrCircleEffect& src); |