Index: src/gpu/gl/GrGLGpu.cpp |
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp |
index 3e44138328d884a36bfbad1e1820f3e0d6fa8aa4..cd6c0e6c8314a7ce6c5956846a29a1c448eca582 100644 |
--- a/src/gpu/gl/GrGLGpu.cpp |
+++ b/src/gpu/gl/GrGLGpu.cpp |
@@ -2009,12 +2009,13 @@ void GrGLGpu::flushWindowRectangles(const GrWindowRectangles& windows, const GrG |
GrGLIRect glwindows[GrWindowRectangles::kMaxWindows]; |
const SkIRect* skwindows = windows.data(); |
- for (int i = 0; i < windows.count(); ++i) { |
+ 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
|
+ for (int i = 0; i < numWindows; ++i) { |
glwindows[i].setRelativeTo(rt->getViewport(), skwindows[i], rt->origin()); |
} |
GrGLenum glmode = (Mode::kExclusive == windows.mode()) ? GR_GL_EXCLUSIVE : GR_GL_INCLUSIVE; |
- GL_CALL(WindowRectangles(glmode, windows.count(), glwindows->asInts())); |
+ GL_CALL(WindowRectangles(glmode, numWindows, glwindows->asInts())); |
fHWWindowRects.set(rt->origin(), rt->getViewport(), windows); |
} |