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

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

Issue 2254013002: Reduce window rectangles cap to 8 (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Reduce window rectangles cap to 8 Created 4 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 | « src/gpu/GrWindowRectangles.h ('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 #include "GrGLGpu.h" 8 #include "GrGLGpu.h"
9 #include "GrGLBuffer.h" 9 #include "GrGLBuffer.h"
10 #include "GrGLGLSL.h" 10 #include "GrGLGLSL.h"
(...skipping 1978 matching lines...) Expand 10 before | Expand all | Expand 10 after
1989 fHWScissorSettings.fEnabled = kYes_TriState; 1989 fHWScissorSettings.fEnabled = kYes_TriState;
1990 } 1990 }
1991 return; 1991 return;
1992 } 1992 }
1993 } 1993 }
1994 1994
1995 // See fall through note above 1995 // See fall through note above
1996 this->disableScissor(); 1996 this->disableScissor();
1997 } 1997 }
1998 1998
1999 // Blah blah blah.
bsalomon 2016/08/22 13:21:57 I like this better.
csmartdalton 2016/08/22 14:10:39 This one doesn't seem to work.. The pragma needs t
2000 // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=5912
2001 #define HAS_GCC_BUG defined(__GNUC__) && (__GNUC__ < 5) && !defined(__clang__)
2002 #if HAS_GCC_BUG
2003 # pragma GCC diagnostic ignored "-Warray-bounds"
2004 #endif
2005
1999 void GrGLGpu::flushWindowRectangles(const GrWindowRectangles& windows, const GrG LRenderTarget* rt) { 2006 void GrGLGpu::flushWindowRectangles(const GrWindowRectangles& windows, const GrG LRenderTarget* rt) {
2000 typedef GrWindowRectangles::Mode Mode; 2007 typedef GrWindowRectangles::Mode Mode;
2001 SkASSERT(windows.count() <= this->caps()->maxWindowRectangles()); 2008 SkASSERT(windows.count() <= this->caps()->maxWindowRectangles());
2002 SkASSERT(windows.disabled() || rt->renderFBOID()); // Window rectangles can' t be used on-screen. 2009 SkASSERT(windows.disabled() || rt->renderFBOID()); // Window rectangles can' t be used on-screen.
2003 2010
2004 if (!this->caps()->maxWindowRectangles() || 2011 if (!this->caps()->maxWindowRectangles() ||
2005 fHWWindowRects.equal(rt->origin(), rt->getViewport(), windows)) { 2012 fHWWindowRects.equal(rt->origin(), rt->getViewport(), windows)) {
2006 return; 2013 return;
2007 2014
2008 } 2015 }
2009 2016
2010 GrGLIRect glwindows[GrWindowRectangles::kMaxWindows]; 2017 GrGLIRect glwindows[GrWindowRectangles::kMaxWindows];
2011 const SkIRect* skwindows = windows.data(); 2018 const SkIRect* skwindows = windows.data();
2012 for (int i = 0; i < windows.count(); ++i) { 2019 for (int i = 0; i < windows.count(); ++i) {
2013 glwindows[i].setRelativeTo(rt->getViewport(), skwindows[i], rt->origin() ); 2020 glwindows[i].setRelativeTo(rt->getViewport(), skwindows[i], rt->origin() );
2014 } 2021 }
2015 2022
2016 GrGLenum glmode = (Mode::kExclusive == windows.mode()) ? GR_GL_EXCLUSIVE : G R_GL_INCLUSIVE; 2023 GrGLenum glmode = (Mode::kExclusive == windows.mode()) ? GR_GL_EXCLUSIVE : G R_GL_INCLUSIVE;
2017 GL_CALL(WindowRectangles(glmode, windows.count(), glwindows->asInts())); 2024 GL_CALL(WindowRectangles(glmode, windows.count(), glwindows->asInts()));
2018 2025
2019 fHWWindowRects.set(rt->origin(), rt->getViewport(), windows); 2026 fHWWindowRects.set(rt->origin(), rt->getViewport(), windows);
2020 } 2027 }
2021 2028
2029 #if HAS_GCC_BUG
2030 # pragma GCC diagnostic error "-Warray-bounds"
2031 #endif
2032
2022 void GrGLGpu::disableWindowRectangles() { 2033 void GrGLGpu::disableWindowRectangles() {
2023 if (!this->caps()->maxWindowRectangles() || fHWWindowRects.disabled()) { 2034 if (!this->caps()->maxWindowRectangles() || fHWWindowRects.disabled()) {
2024 return; 2035 return;
2025 } 2036 }
2026 GL_CALL(WindowRectangles(GR_GL_EXCLUSIVE, 0, nullptr)); 2037 GL_CALL(WindowRectangles(GR_GL_EXCLUSIVE, 0, nullptr));
2027 fHWWindowRects.setDisabled(); 2038 fHWWindowRects.setDisabled();
2028 } 2039 }
2029 2040
2030 void GrGLGpu::flushMinSampleShading(float minSampleShading) { 2041 void GrGLGpu::flushMinSampleShading(float minSampleShading) {
2031 if (fHWMinSampleShading != minSampleShading) { 2042 if (fHWMinSampleShading != minSampleShading) {
(...skipping 2625 matching lines...) Expand 10 before | Expand all | Expand 10 after
4657 if (GR_GL_TEXTURE_EXTERNAL == glTexture->target() || 4668 if (GR_GL_TEXTURE_EXTERNAL == glTexture->target() ||
4658 GR_GL_TEXTURE_RECTANGLE == glTexture->target()) { 4669 GR_GL_TEXTURE_RECTANGLE == glTexture->target()) {
4659 copyParams->fFilter = GrTextureParams::kNone_FilterMode; 4670 copyParams->fFilter = GrTextureParams::kNone_FilterMode;
4660 copyParams->fWidth = texture->width(); 4671 copyParams->fWidth = texture->width();
4661 copyParams->fHeight = texture->height(); 4672 copyParams->fHeight = texture->height();
4662 return true; 4673 return true;
4663 } 4674 }
4664 } 4675 }
4665 return false; 4676 return false;
4666 } 4677 }
OLDNEW
« no previous file with comments | « src/gpu/GrWindowRectangles.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698