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

Side by Side Diff: src/gpu/gl/GrGpuGL.cpp

Issue 574543002: Always disable the scissor test before BlitFrameBuffer (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 3 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 unified diff | Download patch
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 8
9 #include "GrGpuGL.h" 9 #include "GrGpuGL.h"
10 #include "GrGLStencilBuffer.h" 10 #include "GrGLStencilBuffer.h"
(...skipping 1801 matching lines...) Expand 10 before | Expand all | Expand 10 after
1812 1812
1813 GrAutoTRestore<ScissorState> asr; 1813 GrAutoTRestore<ScissorState> asr;
1814 if (GrGLCaps::kES_Apple_MSFBOType == this->glCaps().msFBOType()) { 1814 if (GrGLCaps::kES_Apple_MSFBOType == this->glCaps().msFBOType()) {
1815 // Apple's extension uses the scissor as the blit bounds. 1815 // Apple's extension uses the scissor as the blit bounds.
1816 asr.reset(&fScissorState); 1816 asr.reset(&fScissorState);
1817 fScissorState.fEnabled = true; 1817 fScissorState.fEnabled = true;
1818 fScissorState.fRect = dirtyRect; 1818 fScissorState.fRect = dirtyRect;
1819 this->flushScissor(rt->getViewport(), rt->origin()); 1819 this->flushScissor(rt->getViewport(), rt->origin());
1820 GL_CALL(ResolveMultisampleFramebuffer()); 1820 GL_CALL(ResolveMultisampleFramebuffer());
1821 } else { 1821 } else {
1822 if (GrGLCaps::kDesktop_EXT_MSFBOType == this->glCaps().msFBOType ()) {
1823 // this respects the scissor during the blit, so disable it.
1824 asr.reset(&fScissorState);
1825 fScissorState.fEnabled = false;
1826 this->flushScissor(rt->getViewport(), rt->origin());
1827 }
1828 int right = r.fLeft + r.fWidth; 1822 int right = r.fLeft + r.fWidth;
1829 int top = r.fBottom + r.fHeight; 1823 int top = r.fBottom + r.fHeight;
1824
1825 // BlitFrameBuffer respects the scissor, so disable it.
1826 asr.reset(&fScissorState);
1827 fScissorState.fEnabled = false;
1828 this->flushScissor(rt->getViewport(), rt->origin());
1830 GL_CALL(BlitFramebuffer(r.fLeft, r.fBottom, right, top, 1829 GL_CALL(BlitFramebuffer(r.fLeft, r.fBottom, right, top,
1831 r.fLeft, r.fBottom, right, top, 1830 r.fLeft, r.fBottom, right, top,
1832 GR_GL_COLOR_BUFFER_BIT, GR_GL_NEAREST)); 1831 GR_GL_COLOR_BUFFER_BIT, GR_GL_NEAREST));
1833 } 1832 }
1834 } 1833 }
1835 rt->flagAsResolved(); 1834 rt->flagAsResolved();
1836 } 1835 }
1837 } 1836 }
1838 1837
1839 namespace { 1838 namespace {
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after
2488 srcRect.height(), 2487 srcRect.height(),
2489 src->origin()); 2488 src->origin());
2490 dstGLRect.setRelativeTo(dstVP, 2489 dstGLRect.setRelativeTo(dstVP,
2491 dstRect.fLeft, 2490 dstRect.fLeft,
2492 dstRect.fTop, 2491 dstRect.fTop,
2493 dstRect.width(), 2492 dstRect.width(),
2494 dstRect.height(), 2493 dstRect.height(),
2495 dst->origin()); 2494 dst->origin());
2496 2495
2497 GrAutoTRestore<ScissorState> asr; 2496 GrAutoTRestore<ScissorState> asr;
2498 if (GrGLCaps::kDesktop_EXT_MSFBOType == this->glCaps().msFBOType()) { 2497 // BlitFrameBuffer respects the scissor, so disable it.
2499 // The EXT version applies the scissor during the blit, so disab le it. 2498 asr.reset(&fScissorState);
2500 asr.reset(&fScissorState); 2499 fScissorState.fEnabled = false;
2501 fScissorState.fEnabled = false; 2500 this->flushScissor(dstGLRect, dst->origin());
2502 this->flushScissor(dstGLRect, dst->origin()); 2501
2503 }
2504 GrGLint srcY0; 2502 GrGLint srcY0;
2505 GrGLint srcY1; 2503 GrGLint srcY1;
2506 // Does the blit need to y-mirror or not? 2504 // Does the blit need to y-mirror or not?
2507 if (src->origin() == dst->origin()) { 2505 if (src->origin() == dst->origin()) {
2508 srcY0 = srcGLRect.fBottom; 2506 srcY0 = srcGLRect.fBottom;
2509 srcY1 = srcGLRect.fBottom + srcGLRect.fHeight; 2507 srcY1 = srcGLRect.fBottom + srcGLRect.fHeight;
2510 } else { 2508 } else {
2511 srcY0 = srcGLRect.fBottom + srcGLRect.fHeight; 2509 srcY0 = srcGLRect.fBottom + srcGLRect.fHeight;
2512 srcY1 = srcGLRect.fBottom; 2510 srcY1 = srcGLRect.fBottom;
2513 } 2511 }
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
2597 this->setVertexArrayID(gpu, 0); 2595 this->setVertexArrayID(gpu, 0);
2598 } 2596 }
2599 int attrCount = gpu->glCaps().maxVertexAttributes(); 2597 int attrCount = gpu->glCaps().maxVertexAttributes();
2600 if (fDefaultVertexArrayAttribState.count() != attrCount) { 2598 if (fDefaultVertexArrayAttribState.count() != attrCount) {
2601 fDefaultVertexArrayAttribState.resize(attrCount); 2599 fDefaultVertexArrayAttribState.resize(attrCount);
2602 } 2600 }
2603 attribState = &fDefaultVertexArrayAttribState; 2601 attribState = &fDefaultVertexArrayAttribState;
2604 } 2602 }
2605 return attribState; 2603 return attribState;
2606 } 2604 }
OLDNEW
« no previous file with comments | « AUTHORS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698