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

Unified Diff: cc/tile_priority.cc

Issue 12096112: [cc] Trace detailed tile info when --trace-all-rendered-frames (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 10 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/tile_priority.cc
diff --git a/cc/tile_priority.cc b/cc/tile_priority.cc
index cb5e9563e10d45be66ac2c94e1a427f734ad876a..6934624b46847f430430e53a073407f1886fd26a 100644
--- a/cc/tile_priority.cc
+++ b/cc/tile_priority.cc
@@ -5,6 +5,7 @@
#include "cc/tile_priority.h"
#include "base/values.h"
+#include "cc/math_util.h"
namespace {
@@ -70,6 +71,31 @@ scoped_ptr<base::Value> WhichTreeAsValue(WhichTree tree) {
}
}
+scoped_ptr<base::Value> TileResolutionAsValue(
+ TileResolution resolution) {
+ switch (resolution) {
+ case LOW_RESOLUTION:
+ return scoped_ptr<base::Value>(base::Value::CreateStringValue(
+ "LOW_RESOLUTION"));
+ case HIGH_RESOLUTION:
+ return scoped_ptr<base::Value>(base::Value::CreateStringValue(
+ "HIGH_RESOLUTION"));
+ default:
+ DCHECK(false) << "Unrecognized TileResolution value";
+ return scoped_ptr<base::Value>(base::Value::CreateStringValue(
+ "<unknown TileResolution value>"));
+ }
+}
+
+scoped_ptr<base::Value> TilePriority::AsValue() const {
+ scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue());
+ state->SetBoolean("is_live", is_live);
+ state->Set("resolution", TileResolutionAsValue(resolution).release());
+ state->SetDouble("time_to_visible_in_seconds", time_to_visible_in_seconds);
+ state->SetDouble("distance_to_visible_in_pixels", distance_to_visible_in_pixels);
+ state->Set("current_screen_quad", MathUtil::asValue(current_screen_quad).release());
+ return state.PassAs<base::Value>();
+}
float TilePriority::TimeForBoundsToIntersect(const gfx::RectF& previous_bounds,
const gfx::RectF& current_bounds,

Powered by Google App Engine
This is Rietveld 408576698