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

Unified Diff: cc/trees/layer_tree_host.cc

Issue 16848010: Add LayerTreeHostClient::{will,did}UpdateLayer, report layer updates to DevTools (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased for try run 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
Index: cc/trees/layer_tree_host.cc
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc
index cf9e378418907087d91b8aae57ba87a9fc66105f..dba3d06acb9b17be2d5b7a60f7d43497ec6ae9b4 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -18,6 +18,7 @@
#include "cc/animation/layer_animation_controller.h"
#include "cc/base/math_util.h"
#include "cc/debug/benchmark_instrumentation.h"
+#include "cc/debug/devtools_instrumentation.h"
#include "cc/debug/overdraw_metrics.h"
#include "cc/debug/rendering_stats_instrumentation.h"
#include "cc/input/top_controls_manager.h"
@@ -73,6 +74,8 @@ scoped_ptr<LayerTreeHost> LayerTreeHost::Create(
return layer_tree_host.Pass();
}
+static int s_next_tree_id = 1;
+
LayerTreeHost::LayerTreeHost(LayerTreeHostClient* client,
const LayerTreeSettings& settings)
: animating_(false),
@@ -101,7 +104,9 @@ LayerTreeHost::LayerTreeHost(LayerTreeHostClient* client,
if (settings_.accelerated_animation_enabled)
animation_registrar_ = AnimationRegistrar::Create();
s_num_layer_tree_instances++;
-
+ if (s_next_tree_id <= 0)
+ s_next_tree_id = 1;
+ tree_id_ = s_next_tree_id++;
rendering_stats_instrumentation_->set_record_rendering_stats(
debug_state_.RecordRenderingStats());
}
@@ -879,6 +884,10 @@ void LayerTreeHost::PaintMasksForRenderSurface(Layer* render_surface_layer,
Layer* mask_layer = render_surface_layer->mask_layer();
if (mask_layer) {
+ devtools_instrumentation::ScopedLayerTreeTask
+ update_layer(devtools_instrumentation::kUpdateLayer,
+ mask_layer->id(),
+ id());
*did_paint_content |= mask_layer->Update(queue, NULL);
*need_more_updates |= mask_layer->NeedMoreUpdates();
}
@@ -887,6 +896,10 @@ void LayerTreeHost::PaintMasksForRenderSurface(Layer* render_surface_layer,
render_surface_layer->replica_layer() ?
render_surface_layer->replica_layer()->mask_layer() : NULL;
if (replica_mask_layer) {
+ devtools_instrumentation::ScopedLayerTreeTask
+ update_layer(devtools_instrumentation::kUpdateLayer,
+ replica_mask_layer->id(),
+ id());
*did_paint_content |= replica_mask_layer->Update(queue, NULL);
*need_more_updates |= replica_mask_layer->NeedMoreUpdates();
}
@@ -932,6 +945,8 @@ void LayerTreeHost::PaintLayerContents(
PaintMasksForRenderSurface(
*it, queue, did_paint_content, need_more_updates);
} else if (it.represents_itself()) {
+ devtools_instrumentation::ScopedLayerTreeTask
+ update_layer(devtools_instrumentation::kUpdateLayer, it->id(), id());
DCHECK(!it->paint_properties().bounds.IsEmpty());
*did_paint_content |= it->Update(queue, &occlusion_tracker);
*need_more_updates |= it->NeedMoreUpdates();

Powered by Google App Engine
This is Rietveld 408576698