diff options
author | 2017-03-16 12:15:22 -0400 | |
---|---|---|
committer | 2017-03-16 16:58:06 +0000 | |
commit | 510dd42a63edec18e0eefcc901e1ebf47e719c6f (patch) | |
tree | bf6b80208161150710e01ada0e0074dde54f7903 | |
parent | 0c492cfe1713d6895d1d513e754d938ff0faa5e5 (diff) |
In GrClipStackClip check whether op bounds are inside RT before checking for empty clip stack.
Also fixes the bounds of aa bevel stroked rectangles.
Change-Id: I4c80deb9066ebbf9514ce3d4b270ff566bf12e02
Reviewed-on: https://skia-review.googlesource.com/9786
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Robert Phillips <robertphillips@google.com>
-rw-r--r-- | src/gpu/GrClipStackClip.cpp | 8 | ||||
-rw-r--r-- | src/gpu/ops/GrAAStrokeRectOp.cpp | 10 |
2 files changed, 13 insertions, 5 deletions
diff --git a/src/gpu/GrClipStackClip.cpp b/src/gpu/GrClipStackClip.cpp index 96b4b88748..b0109819d7 100644 --- a/src/gpu/GrClipStackClip.cpp +++ b/src/gpu/GrClipStackClip.cpp @@ -250,15 +250,15 @@ static bool get_analytic_clip_processor(const ElementList& elements, bool GrClipStackClip::apply(GrContext* context, GrRenderTargetContext* renderTargetContext, bool useHWAA, bool hasUserStencilSettings, GrAppliedClip* out, SkRect* bounds) const { - if (!fStack || fStack->isWideOpen()) { - return true; - } - SkRect devBounds = SkRect::MakeIWH(renderTargetContext->width(), renderTargetContext->height()); if (!devBounds.intersect(*bounds)) { return false; } + if (!fStack || fStack->isWideOpen()) { + return true; + } + const GrReducedClip reducedClip(*fStack, devBounds, renderTargetContext->priv().maxWindowRectangles()); diff --git a/src/gpu/ops/GrAAStrokeRectOp.cpp b/src/gpu/ops/GrAAStrokeRectOp.cpp index 3780752062..b684782f23 100644 --- a/src/gpu/ops/GrAAStrokeRectOp.cpp +++ b/src/gpu/ops/GrAAStrokeRectOp.cpp @@ -138,7 +138,15 @@ public: compute_rects(&info.fDevOutside, &info.fDevOutsideAssist, &info.fDevInside, &info.fDegenerate, viewMatrix, rect, stroke.getWidth(), isMiter); info.fColor = color; - op->setBounds(info.fDevOutside, HasAABloat::kYes, IsZeroArea::kNo); + if (isMiter) { + op->setBounds(info.fDevOutside, HasAABloat::kYes, IsZeroArea::kNo); + } else { + // The outer polygon of the bevel stroke is an octagon specified by the points of a + // pair of overlapping rectangles where one is wide and the other is narrow. + SkRect bounds = info.fDevOutside; + bounds.joinPossiblyEmptyRect(info.fDevOutsideAssist); + op->setBounds(bounds, HasAABloat::kYes, IsZeroArea::kNo); + } op->fViewMatrix = viewMatrix; return std::unique_ptr<GrMeshDrawOp>(op); } |