summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cc/layers/layer_impl.cc3
-rw-r--r--cc/layers/layer_impl.h1
-rw-r--r--cc/layers/picture_layer_impl.cc10
-rw-r--r--cc/layers/picture_layer_impl.h3
-rw-r--r--cc/resources/picture_layer_tiling.cc7
-rw-r--r--cc/resources/picture_layer_tiling.h2
-rw-r--r--cc/resources/tile_manager.cc8
-rw-r--r--cc/resources/tile_manager.h1
-rw-r--r--cc/trees/layer_tree_host_impl.cc22
-rw-r--r--cc/trees/layer_tree_impl.cc14
-rw-r--r--cc/trees/layer_tree_impl.h2
11 files changed, 60 insertions, 13 deletions
diff --git a/cc/layers/layer_impl.cc b/cc/layers/layer_impl.cc
index 14ffa6f..2d444a1 100644
--- a/cc/layers/layer_impl.cc
+++ b/cc/layers/layer_impl.cc
@@ -1400,6 +1400,9 @@ void LayerImpl::RemoveDependentNeedsPushProperties() {
parent_->RemoveDependentNeedsPushProperties();
}
+void LayerImpl::GetAllTilesForTracing(std::set<const Tile*>* tiles) const {
+}
+
void LayerImpl::AsValueInto(base::debug::TracedValue* state) const {
TracedValue::MakeDictIntoImplicitSnapshotWithCategory(
TRACE_DISABLED_BY_DEFAULT("cc.debug"),
diff --git a/cc/layers/layer_impl.h b/cc/layers/layer_impl.h
index 8af8c3d..c10710c 100644
--- a/cc/layers/layer_impl.h
+++ b/cc/layers/layer_impl.h
@@ -523,6 +523,7 @@ class CC_EXPORT LayerImpl : public LayerAnimationValueObserver,
virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl);
virtual void PushPropertiesTo(LayerImpl* layer);
+ virtual void GetAllTilesForTracing(std::set<const Tile*>* tiles) const;
virtual void AsValueInto(base::debug::TracedValue* dict) const;
virtual size_t GPUMemoryUsageInBytes() const;
diff --git a/cc/layers/picture_layer_impl.cc b/cc/layers/picture_layer_impl.cc
index b3a095f..43348fa 100644
--- a/cc/layers/picture_layer_impl.cc
+++ b/cc/layers/picture_layer_impl.cc
@@ -6,6 +6,7 @@
#include <algorithm>
#include <limits>
+#include <set>
#include "base/debug/trace_event_argument.h"
#include "base/time/time.h"
@@ -1404,6 +1405,15 @@ void PictureLayerImpl::GetDebugBorderProperties(
*width = DebugColors::TiledContentLayerBorderWidth(layer_tree_impl());
}
+void PictureLayerImpl::GetAllTilesForTracing(
+ std::set<const Tile*>* tiles) const {
+ if (!tilings_)
+ return;
+
+ for (size_t i = 0; i < tilings_->num_tilings(); ++i)
+ tilings_->tiling_at(i)->GetAllTilesForTracing(tiles);
+}
+
void PictureLayerImpl::AsValueInto(base::debug::TracedValue* state) const {
const_cast<PictureLayerImpl*>(this)->DoPostCommitInitializationIfNeeded();
LayerImpl::AsValueInto(state);
diff --git a/cc/layers/picture_layer_impl.h b/cc/layers/picture_layer_impl.h
index f9845be..47d881d 100644
--- a/cc/layers/picture_layer_impl.h
+++ b/cc/layers/picture_layer_impl.h
@@ -5,6 +5,7 @@
#ifndef CC_LAYERS_PICTURE_LAYER_IMPL_H_
#define CC_LAYERS_PICTURE_LAYER_IMPL_H_
+#include <set>
#include <string>
#include <vector>
@@ -191,6 +192,8 @@ class CC_EXPORT PictureLayerImpl
virtual void GetDebugBorderProperties(
SkColor* color, float* width) const OVERRIDE;
+ virtual void GetAllTilesForTracing(
+ std::set<const Tile*>* tiles) const OVERRIDE;
virtual void AsValueInto(base::debug::TracedValue* dict) const OVERRIDE;
virtual void UpdateIdealScales();
diff --git a/cc/resources/picture_layer_tiling.cc b/cc/resources/picture_layer_tiling.cc
index b302873..3ae7be4 100644
--- a/cc/resources/picture_layer_tiling.cc
+++ b/cc/resources/picture_layer_tiling.cc
@@ -7,6 +7,7 @@
#include <algorithm>
#include <cmath>
#include <limits>
+#include <set>
#include "base/debug/trace_event.h"
#include "base/debug/trace_event_argument.h"
@@ -684,6 +685,12 @@ void PictureLayerTiling::DidBecomeActive() {
}
}
+void PictureLayerTiling::GetAllTilesForTracing(
+ std::set<const Tile*>* tiles) const {
+ for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it)
+ tiles->insert(it->second.get());
+}
+
void PictureLayerTiling::AsValueInto(base::debug::TracedValue* state) const {
state->SetInteger("num_tiles", tiles_.size());
state->SetDouble("content_scale", contents_scale_);
diff --git a/cc/resources/picture_layer_tiling.h b/cc/resources/picture_layer_tiling.h
index f2e5e73..45edc7d 100644
--- a/cc/resources/picture_layer_tiling.h
+++ b/cc/resources/picture_layer_tiling.h
@@ -5,6 +5,7 @@
#ifndef CC_RESOURCES_PICTURE_LAYER_TILING_H_
#define CC_RESOURCES_PICTURE_LAYER_TILING_H_
+#include <set>
#include <utility>
#include <vector>
@@ -261,6 +262,7 @@ class CC_EXPORT PictureLayerTiling {
return frame_time_in_seconds != last_impl_frame_time_in_seconds_;
}
+ void GetAllTilesForTracing(std::set<const Tile*>* tiles) const;
void AsValueInto(base::debug::TracedValue* array) const;
size_t GPUMemoryUsageInBytes() const;
diff --git a/cc/resources/tile_manager.cc b/cc/resources/tile_manager.cc
index b7f5a9d..f3d302b 100644
--- a/cc/resources/tile_manager.cc
+++ b/cc/resources/tile_manager.cc
@@ -731,14 +731,6 @@ void TileManager::BasicStateAsValueInto(base::debug::TracedValue* state) const {
state->EndDictionary();
}
-void TileManager::AllTilesAsValueInto(base::debug::TracedValue* state) const {
- for (TileMap::const_iterator it = tiles_.begin(); it != tiles_.end(); ++it) {
- state->BeginDictionary();
- it->second->AsValueInto(state);
- state->EndDictionary();
- }
-}
-
void TileManager::AssignGpuMemoryToTiles(
PrioritizedTileSet* tiles,
TileVector* tiles_that_need_to_be_rasterized) {
diff --git a/cc/resources/tile_manager.h b/cc/resources/tile_manager.h
index eec5629..df9325e 100644
--- a/cc/resources/tile_manager.h
+++ b/cc/resources/tile_manager.h
@@ -112,7 +112,6 @@ class CC_EXPORT TileManager : public RasterizerClient,
scoped_refptr<base::debug::ConvertableToTraceFormat> BasicStateAsValue()
const;
void BasicStateAsValueInto(base::debug::TracedValue* dict) const;
- void AllTilesAsValueInto(base::debug::TracedValue* array) const;
const MemoryHistory::Entry& memory_stats_from_last_assign() const {
return memory_stats_from_last_assign_;
}
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index a6d50c6..e293a5a 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -3145,11 +3145,25 @@ void LayerTreeHostImpl::AsValueWithFrameInto(
state->BeginDictionary("device_viewport_size");
MathUtil::AddToTracedValue(device_viewport_size_, state);
state->EndDictionary();
- if (tile_manager_) {
- state->BeginArray("tiles");
- tile_manager_->AllTilesAsValueInto(state);
- state->EndArray();
+ std::set<const Tile*> tiles;
+ active_tree_->GetAllTilesForTracing(&tiles);
+ if (pending_tree_)
+ pending_tree_->GetAllTilesForTracing(&tiles);
+
+ state->BeginArray("active_tiles");
+ for (std::set<const Tile*>::const_iterator it = tiles.begin();
+ it != tiles.end();
+ ++it) {
+ const Tile* tile = *it;
+
+ state->BeginDictionary();
+ tile->AsValueInto(state);
+ state->EndDictionary();
+ }
+ state->EndArray();
+
+ if (tile_manager_) {
state->BeginDictionary("tile_manager_basic_state");
tile_manager_->BasicStateAsValueInto(state);
state->EndDictionary();
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc
index 6d2d88d..c9526f9 100644
--- a/cc/trees/layer_tree_impl.cc
+++ b/cc/trees/layer_tree_impl.cc
@@ -817,6 +817,20 @@ AnimationRegistrar* LayerTreeImpl::animationRegistrar() const {
return layer_tree_host_impl_->animation_registrar();
}
+void LayerTreeImpl::GetAllTilesForTracing(std::set<const Tile*>* tiles) const {
+ typedef LayerIterator<LayerImpl> LayerIteratorType;
+ LayerIteratorType end = LayerIteratorType::End(&render_surface_layer_list_);
+ for (LayerIteratorType it =
+ LayerIteratorType::Begin(&render_surface_layer_list_);
+ it != end;
+ ++it) {
+ if (!it.represents_itself())
+ continue;
+ LayerImpl* layer_impl = *it;
+ layer_impl->GetAllTilesForTracing(tiles);
+ }
+}
+
void LayerTreeImpl::AsValueInto(base::debug::TracedValue* state) const {
TracedValue::MakeDictIntoImplicitSnapshot(state, "cc::LayerTreeImpl", this);
state->SetInteger("source_frame_number", source_frame_number_);
diff --git a/cc/trees/layer_tree_impl.h b/cc/trees/layer_tree_impl.h
index e21b1c8..eb05ee5 100644
--- a/cc/trees/layer_tree_impl.h
+++ b/cc/trees/layer_tree_impl.h
@@ -6,6 +6,7 @@
#define CC_TREES_LAYER_TREE_IMPL_H_
#include <list>
+#include <set>
#include <string>
#include <vector>
@@ -112,6 +113,7 @@ class CC_EXPORT LayerTreeImpl {
const LayerTreeDebugState& debug_state() const;
float device_scale_factor() const;
DebugRectHistory* debug_rect_history() const;
+ void GetAllTilesForTracing(std::set<const Tile*>* tiles) const;
void AsValueInto(base::debug::TracedValue* dict) const;
// Other public methods