From 5c363644eb90b699e8ea8742849860f8358720f8 Mon Sep 17 00:00:00 2001 From: "commit-bot@chromium.org" Date: Fri, 4 Oct 2013 15:28:18 +0000 Subject: [PATCH] Don't access RT when disabling scissor. R=robertphillips@google.com Author: bsalomon@google.com Review URL: https://codereview.chromium.org/25446004 git-svn-id: http://skia.googlecode.com/svn/trunk@11608 2bbb7eff-a529-9590-31e7-b0007b416f81 --- src/gpu/gl/GrGpuGL.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp index d1a7167..50d2a1f 100644 --- a/src/gpu/gl/GrGpuGL.cpp +++ b/src/gpu/gl/GrGpuGL.cpp @@ -1271,14 +1271,16 @@ GrPath* GrGpuGL::onCreatePath(const SkPath& inPath) { } void GrGpuGL::flushScissor() { - const GrDrawState& drawState = this->getDrawState(); - const GrGLRenderTarget* rt = - static_cast(drawState.getRenderTarget()); - - SkASSERT(NULL != rt); - const GrGLIRect& vp = rt->getViewport(); - if (fScissorState.fEnabled) { + // Only access the RT if scissoring is being enabled. We can call this before performing + // a glBitframebuffer for a surface->surface copy, which requires no RT to be bound to the + // GrDrawState. + const GrDrawState& drawState = this->getDrawState(); + const GrGLRenderTarget* rt = + static_cast(drawState.getRenderTarget()); + + SkASSERT(NULL != rt); + const GrGLIRect& vp = rt->getViewport(); GrGLIRect scissor; scissor.setRelativeTo(vp, fScissorState.fRect.fLeft, -- 2.7.4