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

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 c695429968234a6efa435bdca50d53067d913b47..b3161bbba57ac37ad25a59624f863f3ce50265ab 100644
--- a/cc/output/gl_renderer.cc
+++ b/cc/output/gl_renderer.cc
@@ -12,6 +12,7 @@
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
+#include "base/numerics/safe_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
@@ -2232,7 +2233,8 @@ void GLRenderer::FlushTextureQuadCache(BoundGeometry flush_binding) {
static_cast<float*>(&draw_cache_.vertex_opacity_data.front()));
// Draw the quads!
- gl_->DrawElements(GL_TRIANGLES, 6 * draw_cache_.matrix_data.size(),
+ gl_->DrawElements(GL_TRIANGLES,
+ 6 * base::checked_cast<int>(draw_cache_.matrix_data.size()),
vmpstr 2015/06/05 01:03:00 This is the only checked_cast that I'm using, most
jschuh 2015/06/05 14:08:24 Yeah, it looks like the other locations should be
danakj 2015/06/05 18:22:29 matrix_data.size() is at most 8 (line 2299). Havin
vmpstr 2015/06/05 19:27:33 Ok, I changed this to a DCHECK. I think if this is
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