OLD | NEW |
---|---|
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 Loading... | |
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 Loading... | |
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 } |
OLD | NEW |