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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 20667002: cc: Add frame data to LTHI tracing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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/quads/draw_quad.cc ('K') | « cc/trees/layer_tree_host_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 629877fa168222fa38e37d9454f0714f467122b5..52199e91da6c835944ba82ad29072e105c492e4b 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -7,6 +7,7 @@
#include <algorithm>
#include "base/basictypes.h"
+#include "base/containers/hash_tables.h"
#include "base/json/json_writer.h"
#include "base/metrics/histogram.h"
#include "base/stl_util.h"
@@ -424,6 +425,29 @@ void LayerTreeHostImpl::TrackDamageForAllSurfaces(
}
}
+scoped_ptr<base::Value> LayerTreeHostImpl::FrameData::AsValue() const {
+ scoped_ptr<base::DictionaryValue> value(new base::DictionaryValue());
+ scoped_ptr<base::ListValue> occluding_list(new base::ListValue());
+ for (size_t i = 0; i < occluding_screen_space_rects.size(); ++i) {
+ occluding_list->Append(MathUtil::AsValue(
+ occluding_screen_space_rects[i]).release());
+ }
+ value->Set("occluding_screen_space_rects", occluding_list.release());
danakj 2013/07/26 16:53:59 These 3 lists only exist when you are showing them
piman 2013/07/31 00:36:43 Removed those (2) lists.
+ scoped_ptr<base::ListValue> non_occluding_list(new base::ListValue());
+ for (size_t i = 0; i < non_occluding_screen_space_rects.size(); ++i) {
+ non_occluding_list->Append(MathUtil::AsValue(
+ non_occluding_screen_space_rects[i]).release());
+ }
+ value->Set("non_occluding_screen_space_rects", non_occluding_list.release());
+ scoped_ptr<base::ListValue> render_pass_list(new base::ListValue());
+ for (size_t i = 0; i < render_passes.size(); ++i)
+ render_pass_list->Append(render_passes[i]->AsValue().release());
+ value->Set("render_passes", render_pass_list.release());
+ value->SetBoolean("contains_incomplete_tile", contains_incomplete_tile);
+ value->SetBoolean("has_no_damage", has_no_damage);
+ return value.PassAs<base::Value>();
+}
+
void LayerTreeHostImpl::FrameData::AppendRenderPass(
scoped_ptr<RenderPass> render_pass) {
render_passes_by_id[render_pass->id] = render_pass.get();
@@ -1227,7 +1251,7 @@ void LayerTreeHostImpl::DrawLayers(FrameData* frame,
TRACE_EVENT_OBJECT_SNAPSHOT_WITH_ID(
TRACE_DISABLED_BY_DEFAULT("cc.debug"), "cc::LayerTreeHostImpl", this,
- TracedValue::FromValue(AsValue().release()));
+ TracedValue::FromValue(AsValueWithFrame(frame).release()));
danakj 2013/07/26 16:53:59 If frame->has_no_damage, you don't get here. Also
piman 2013/07/31 00:36:43 For 2 reasons we want to leave it here: 1- we want
// Because the contents of the HUD depend on everything else in the frame, the
// contents of its texture are updated as the last thing before the frame is
@@ -2378,7 +2402,8 @@ base::TimeTicks LayerTreeHostImpl::CurrentPhysicalTimeTicks() const {
return base::TimeTicks::Now();
}
-scoped_ptr<base::Value> LayerTreeHostImpl::AsValue() const {
+scoped_ptr<base::Value> LayerTreeHostImpl::AsValueWithFrame(
+ FrameData* frame) const {
scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue());
if (this->pending_tree_)
state->Set("activation_state", ActivationStateAsValue().release());
@@ -2389,6 +2414,8 @@ scoped_ptr<base::Value> LayerTreeHostImpl::AsValue() const {
state->Set("active_tree", active_tree_->AsValue().release());
if (pending_tree_)
state->Set("pending_tree", pending_tree_->AsValue().release());
+ if (frame)
+ state->Set("frame", frame->AsValue().release());
return state.PassAs<base::Value>();
}
« cc/quads/draw_quad.cc ('K') | « cc/trees/layer_tree_host_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698