Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(712)

Unified Diff: src/gpu/gl/GrGpuGL.cpp

Issue 25446004: Don't access RT when disabling scissor. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698