diff options
author | 2013-10-04 15:28:18 +0000 | |
---|---|---|
committer | 2013-10-04 15:28:18 +0000 | |
commit | 5c363644eb90b699e8ea8742849860f8358720f8 (patch) | |
tree | 0b73522f862f77c1444ec38486a3daf38ae07b17 /src | |
parent | ac8f3a4f133d059c74ea20c106b963235ee6e48e (diff) |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/gpu/gl/GrGpuGL.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp index d1a716793f..50d2a1f517 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<const GrGLRenderTarget*>(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<const GrGLRenderTarget*>(drawState.getRenderTarget()); + + SkASSERT(NULL != rt); + const GrGLIRect& vp = rt->getViewport(); GrGLIRect scissor; scissor.setRelativeTo(vp, fScissorState.fRect.fLeft, |