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

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, 11 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
« cc/tile_priority.h ('K') | « cc/tile_priority.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/tile_priority.cc
diff --git a/cc/tile_priority.cc b/cc/tile_priority.cc
index ec77029abe66df355704cda51269899dac93f7f5..5ca4298f9b58610562c26b04d4b8d6ff1fc7b677 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 {
@@ -71,6 +72,34 @@ 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());
whunt 2013/02/01 21:09:33 Is this going to cause a double-release as the val
+ state->SetDouble("time_to_visible_in_seconds", time_to_visible_in_seconds);
+ state->SetDouble("distance_to_visible_in_pixels", distance_to_visible_in_pixels);
+#if TRACK_TILE_SCREEN_SPACE_QUADS
+ state->Set("current_screen_quad", MathUtil::asValue(current_screen_quad).release());
+#endif
+ return state.PassAs<base::Value>();
+}
+
int TilePriority::manhattanDistance(const gfx::RectF& a, const gfx::RectF& b) {
gfx::RectF c = gfx::UnionRects(a, b);
// Rects touching the edge of the screen should not be considered visible.
« cc/tile_priority.h ('K') | « cc/tile_priority.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698