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

Unified Diff: cc/output/gl_renderer.cc

Issue 1158433010: Reland: cc: Fix size_t to int truncations in layers/ output/ playback/ quads/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/output/direct_renderer.cc ('k') | cc/playback/display_item_list.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/gl_renderer.cc
diff --git a/cc/output/gl_renderer.cc b/cc/output/gl_renderer.cc
index faf6bbb0119b0ebbcafb3f9aa5b73b3e44fd3a02..bce832522bf614286134a4e25af2a2444bf0dd49 100644
--- a/cc/output/gl_renderer.cc
+++ b/cc/output/gl_renderer.cc
@@ -2239,8 +2239,11 @@ void GLRenderer::FlushTextureQuadCache(BoundGeometry flush_binding) {
static_cast<int>(draw_cache_.vertex_opacity_data.size()),
static_cast<float*>(&draw_cache_.vertex_opacity_data.front()));
+ DCHECK_LE(draw_cache_.matrix_data.size(),
+ static_cast<size_t>(std::numeric_limits<int>::max()) / 6u);
Nico 2015/07/31 17:57:15 shouldn't this check that size() is lessequal than
vmpstr 2015/07/31 18:29:31 Yeah, I think that's clearly a much tighter bound.
// Draw the quads!
- gl_->DrawElements(GL_TRIANGLES, 6 * draw_cache_.matrix_data.size(),
+ gl_->DrawElements(GL_TRIANGLES,
+ 6 * static_cast<int>(draw_cache_.matrix_data.size()),
GL_UNSIGNED_SHORT, 0);
// Clear the cache.
« no previous file with comments | « cc/output/direct_renderer.cc ('k') | cc/playback/display_item_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698