Index: src/gpu/gl/GrGpuGL.cpp |
diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp |
index d1a716793f7e1bcde510f1898a5b724b4f10258c..50d2a1f51778ae9742f80c91c5e3a3f9a8fbcfab 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, |