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

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, 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
« no previous file with comments | « cc/trees/layer_tree_host.h ('k') | content/renderer/gpu/render_widget_compositor.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host.cc
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc
index 12d81f385af026ede4c84fe9fe22246fa492af4d..0d90c59378756fff15be77f9672fc71b365bc5f6 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),
@@ -97,11 +100,11 @@ LayerTreeHost::LayerTreeHost(LayerTreeHostClient* client,
has_transparent_background_(false),
partial_texture_update_requests_(0),
in_paint_layer_contents_(false),
- total_frames_used_for_lcd_text_metrics_(0) {
+ total_frames_used_for_lcd_text_metrics_(0),
+ tree_id_(s_next_tree_id++) {
if (settings_.accelerated_animation_enabled)
animation_registrar_ = AnimationRegistrar::Create();
s_num_layer_tree_instances++;
-
rendering_stats_instrumentation_->set_record_rendering_stats(
debug_state_.RecordRenderingStats());
}
@@ -883,6 +886,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();
}
@@ -891,6 +898,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();
}
@@ -934,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();
« no previous file with comments | « cc/trees/layer_tree_host.h ('k') | content/renderer/gpu/render_widget_compositor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698