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>
diff --git a/src/gpu/GrClipStackClip.cpp b/src/gpu/GrClipStackClip.cpp
index 96b4b88..b010981 100644
--- a/src/gpu/GrClipStackClip.cpp
+++ b/src/gpu/GrClipStackClip.cpp
@@ -250,15 +250,15 @@
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());