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

Unified Diff: cc/tiles/tile.cc

Issue 1168903003: cc: Fix size_t to int truncations in tiles/ and trees/ (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
Index: cc/tiles/tile.cc
diff --git a/cc/tiles/tile.cc b/cc/tiles/tile.cc
index a596194dfdfa138e1a4cf10d77542d6a138fb2ae..6052e5e0457e0f41cca41eab900166237f0bd6ee 100644
--- a/cc/tiles/tile.cc
+++ b/cc/tiles/tile.cc
@@ -6,6 +6,7 @@
#include <algorithm>
+#include "base/numerics/safe_conversions.h"
#include "base/trace_event/trace_event_argument.h"
#include "cc/base/math_util.h"
#include "cc/debug/traced_value.h"
@@ -62,7 +63,8 @@ void Tile::AsValueInto(base::trace_event::TracedValue* value) const {
draw_info().has_resource() || HasRasterTask());
value->SetInteger("scheduled_priority", scheduled_priority_);
value->SetBoolean("use_picture_analysis", use_picture_analysis());
- value->SetInteger("gpu_memory_usage", GPUMemoryUsageInBytes());
+ value->SetInteger("gpu_memory_usage",
+ base::saturated_cast<int>(GPUMemoryUsageInBytes()));
}
size_t Tile::GPUMemoryUsageInBytes() const {

Powered by Google App Engine
This is Rietveld 408576698