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

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: review comments addressed Created 7 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/trees/layer_tree_host.cc
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc
index 25366468f7d94cb79e7684661397e9aff288301f..45ed62ec8402035b92fa1fda0bd6463d592a73a5 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -17,6 +17,7 @@
#include "cc/animation/animation_registrar.h"
#include "cc/animation/layer_animation_controller.h"
#include "cc/base/math_util.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"
@@ -72,6 +73,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),
@@ -100,7 +103,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());
}
@@ -946,6 +951,8 @@ bool LayerTreeHost::PaintLayerContents(
it->render_surface()->draw_opacity_is_animating());
need_more_updates |= PaintMasksForRenderSurface(*it, queue, stats_ptr);
nduca 2013/06/26 15:08:01 hmm, should we do a followup bug for figuring out
} else if (it.represents_itself()) {
+ devtools_instrumentation::ScopedLayerTreeTask
+ update_layer(devtools_instrumentation::kUpdateLayer, it->id(), id());
DCHECK(!it->paint_properties().bounds.IsEmpty());
it->Update(queue, &occlusion_tracker, stats_ptr);
need_more_updates |= it->NeedMoreUpdates();

Powered by Google App Engine
This is Rietveld 408576698