aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrClipStackClip.cpp
diff options
context:
space:
mode:
authorGravatar Robert Phillips <robertphillips@google.com>2016-11-09 08:54:35 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2016-11-09 15:10:37 +0000
commitec2249fc73b36621af9efd4a9fc62e1be84b784d (patch)
tree39ef9c23c3b09397a4ae5725499ebb12d647c6bd /src/gpu/GrClipStackClip.cpp
parent68b7a52a0b9355b357d4bd72bca479916d115d7c (diff)
Move GrRenderTargetPriv::maxWindowRectangles to GrRenderTargetContextPriv & GrRenderTargetProxy
This removes a reason to call accessRenderTarget on the GrRenderTargetContext GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=4583 Change-Id: I6e8a53ffd5c1fea80f542b70e05744e2991f70f8 Reviewed-on: https://skia-review.googlesource.com/4583 Reviewed-by: Brian Salomon <bsalomon@google.com> Commit-Queue: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'src/gpu/GrClipStackClip.cpp')
-rw-r--r--src/gpu/GrClipStackClip.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gpu/GrClipStackClip.cpp b/src/gpu/GrClipStackClip.cpp
index 669a9c23a6..133c4f706f 100644
--- a/src/gpu/GrClipStackClip.cpp
+++ b/src/gpu/GrClipStackClip.cpp
@@ -273,14 +273,12 @@ bool GrClipStackClip::apply(GrContext* context, GrRenderTargetContext* renderTar
return false;
}
- GrRenderTarget* rt = renderTargetContext->accessRenderTarget();
-
const SkScalar clipX = SkIntToScalar(fOrigin.x()),
clipY = SkIntToScalar(fOrigin.y());
SkRect clipSpaceDevBounds = devBounds.makeOffset(clipX, clipY);
const GrReducedClip reducedClip(*fStack, clipSpaceDevBounds,
- rt->renderTargetPriv().maxWindowRectangles());
+ renderTargetContext->priv().maxWindowRectangles());
if (reducedClip.hasIBounds() &&
!GrClip::IsInsideClip(reducedClip.ibounds(), clipSpaceDevBounds)) {
@@ -357,6 +355,8 @@ bool GrClipStackClip::apply(GrContext* context, GrRenderTargetContext* renderTar
// if alpha clip mask creation fails fall through to the non-AA code paths
}
+ GrRenderTarget* rt = renderTargetContext->accessRenderTarget();
+
// use the stencil clip if we can't represent the clip as a rectangle.
if (!context->resourceProvider()->attachStencilAttachment(rt)) {
SkDebugf("WARNING: failed to attach stencil buffer for clip mask. Clip will be ignored.\n");