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

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 1986 matching lines...) Expand 10 before | Expand all | Expand 10 after
1997 } 1997 }
1998 1998
1999 void GrGLGpu::flushWindowRectangles(const GrWindowRectangles& windows, const GrG LRenderTarget* rt) { 1999 void GrGLGpu::flushWindowRectangles(const GrWindowRectangles& windows, const GrG LRenderTarget* rt) {
2000 typedef GrWindowRectangles::Mode Mode; 2000 typedef GrWindowRectangles::Mode Mode;
2001 SkASSERT(windows.count() <= this->caps()->maxWindowRectangles()); 2001 SkASSERT(windows.count() <= this->caps()->maxWindowRectangles());
2002 SkASSERT(windows.disabled() || rt->renderFBOID()); // Window rectangles can' t be used on-screen. 2002 SkASSERT(windows.disabled() || rt->renderFBOID()); // Window rectangles can' t be used on-screen.
2003 2003
2004 if (!this->caps()->maxWindowRectangles() || 2004 if (!this->caps()->maxWindowRectangles() ||
2005 fHWWindowRects.equal(rt->origin(), rt->getViewport(), windows)) { 2005 fHWWindowRects.equal(rt->origin(), rt->getViewport(), windows)) {
2006 return; 2006 return;
2007 }
2007 2008
2008 } 2009 // This is purely a workaround for a spurious warning generated by gcc. Othe rwise the above
2010 // assert would be sufficient. https://gcc.gnu.org/bugzilla/show_bug.cgi?id= 5912
2011 int numWindows = SkTMin(windows.count(), int(GrWindowRectangles::kMaxWindows ));
2012 SkASSERT(windows.count() == numWindows);
2009 2013
2010 GrGLIRect glwindows[GrWindowRectangles::kMaxWindows]; 2014 GrGLIRect glwindows[GrWindowRectangles::kMaxWindows];
2011 const SkIRect* skwindows = windows.data(); 2015 const SkIRect* skwindows = windows.data();
2012 for (int i = 0; i < windows.count(); ++i) { 2016 for (int i = 0; i < numWindows; ++i) {
2013 glwindows[i].setRelativeTo(rt->getViewport(), skwindows[i], rt->origin() ); 2017 glwindows[i].setRelativeTo(rt->getViewport(), skwindows[i], rt->origin() );
2014 } 2018 }
2015 2019
2016 GrGLenum glmode = (Mode::kExclusive == windows.mode()) ? GR_GL_EXCLUSIVE : G R_GL_INCLUSIVE; 2020 GrGLenum glmode = (Mode::kExclusive == windows.mode()) ? GR_GL_EXCLUSIVE : G R_GL_INCLUSIVE;
2017 GL_CALL(WindowRectangles(glmode, windows.count(), glwindows->asInts())); 2021 GL_CALL(WindowRectangles(glmode, numWindows, glwindows->asInts()));
2018 2022
2019 fHWWindowRects.set(rt->origin(), rt->getViewport(), windows); 2023 fHWWindowRects.set(rt->origin(), rt->getViewport(), windows);
2020 } 2024 }
2021 2025
2022 void GrGLGpu::disableWindowRectangles() { 2026 void GrGLGpu::disableWindowRectangles() {
2023 if (!this->caps()->maxWindowRectangles() || fHWWindowRects.disabled()) { 2027 if (!this->caps()->maxWindowRectangles() || fHWWindowRects.disabled()) {
2024 return; 2028 return;
2025 } 2029 }
2026 GL_CALL(WindowRectangles(GR_GL_EXCLUSIVE, 0, nullptr)); 2030 GL_CALL(WindowRectangles(GR_GL_EXCLUSIVE, 0, nullptr));
2027 fHWWindowRects.setDisabled(); 2031 fHWWindowRects.setDisabled();
(...skipping 2629 matching lines...) Expand 10 before | Expand all | Expand 10 after
4657 if (GR_GL_TEXTURE_EXTERNAL == glTexture->target() || 4661 if (GR_GL_TEXTURE_EXTERNAL == glTexture->target() ||
4658 GR_GL_TEXTURE_RECTANGLE == glTexture->target()) { 4662 GR_GL_TEXTURE_RECTANGLE == glTexture->target()) {
4659 copyParams->fFilter = GrTextureParams::kNone_FilterMode; 4663 copyParams->fFilter = GrTextureParams::kNone_FilterMode;
4660 copyParams->fWidth = texture->width(); 4664 copyParams->fWidth = texture->width();
4661 copyParams->fHeight = texture->height(); 4665 copyParams->fHeight = texture->height();
4662 return true; 4666 return true;
4663 } 4667 }
4664 } 4668 }
4665 return false; 4669 return false;
4666 } 4670 }
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