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

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, 4 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 1991 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 2009
2010 GrGLIRect glwindows[GrWindowRectangles::kMaxWindows]; 2010 GrGLIRect glwindows[GrWindowRectangles::kMaxWindows];
2011 const SkIRect* skwindows = windows.data(); 2011 const SkIRect* skwindows = windows.data();
2012 for (int i = 0; i < windows.count(); ++i) { 2012 int numWindows = SkTMin(windows.count(), int(GrWindowRectangles::kMaxWindows ));
bsalomon 2016/08/20 16:37:31 We can't just assert here? Is that the nature of t
csmartdalton 2016/08/20 16:56:03 This is a release build so an SkASSERT would disap
2013 for (int i = 0; i < numWindows; ++i) {
2013 glwindows[i].setRelativeTo(rt->getViewport(), skwindows[i], rt->origin() ); 2014 glwindows[i].setRelativeTo(rt->getViewport(), skwindows[i], rt->origin() );
2014 } 2015 }
2015 2016
2016 GrGLenum glmode = (Mode::kExclusive == windows.mode()) ? GR_GL_EXCLUSIVE : G R_GL_INCLUSIVE; 2017 GrGLenum glmode = (Mode::kExclusive == windows.mode()) ? GR_GL_EXCLUSIVE : G R_GL_INCLUSIVE;
2017 GL_CALL(WindowRectangles(glmode, windows.count(), glwindows->asInts())); 2018 GL_CALL(WindowRectangles(glmode, numWindows, glwindows->asInts()));
2018 2019
2019 fHWWindowRects.set(rt->origin(), rt->getViewport(), windows); 2020 fHWWindowRects.set(rt->origin(), rt->getViewport(), windows);
2020 } 2021 }
2021 2022
2022 void GrGLGpu::disableWindowRectangles() { 2023 void GrGLGpu::disableWindowRectangles() {
2023 if (!this->caps()->maxWindowRectangles() || fHWWindowRects.disabled()) { 2024 if (!this->caps()->maxWindowRectangles() || fHWWindowRects.disabled()) {
2024 return; 2025 return;
2025 } 2026 }
2026 GL_CALL(WindowRectangles(GR_GL_EXCLUSIVE, 0, nullptr)); 2027 GL_CALL(WindowRectangles(GR_GL_EXCLUSIVE, 0, nullptr));
2027 fHWWindowRects.setDisabled(); 2028 fHWWindowRects.setDisabled();
(...skipping 2629 matching lines...) Expand 10 before | Expand all | Expand 10 after
4657 if (GR_GL_TEXTURE_EXTERNAL == glTexture->target() || 4658 if (GR_GL_TEXTURE_EXTERNAL == glTexture->target() ||
4658 GR_GL_TEXTURE_RECTANGLE == glTexture->target()) { 4659 GR_GL_TEXTURE_RECTANGLE == glTexture->target()) {
4659 copyParams->fFilter = GrTextureParams::kNone_FilterMode; 4660 copyParams->fFilter = GrTextureParams::kNone_FilterMode;
4660 copyParams->fWidth = texture->width(); 4661 copyParams->fWidth = texture->width();
4661 copyParams->fHeight = texture->height(); 4662 copyParams->fHeight = texture->height();
4662 return true; 4663 return true;
4663 } 4664 }
4664 } 4665 }
4665 return false; 4666 return false;
4666 } 4667 }
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