summaryrefslogtreecommitdiffstats
path: root/cc/trees/layer_tree_host.cc
diff options
context:
space:
mode:
Diffstat (limited to 'cc/trees/layer_tree_host.cc')
-rw-r--r--cc/trees/layer_tree_host.cc20
1 files changed, 15 insertions, 5 deletions
diff --git a/cc/trees/layer_tree_host.cc b/cc/trees/layer_tree_host.cc
index 3898156..af7eb5b 100644
--- a/cc/trees/layer_tree_host.cc
+++ b/cc/trees/layer_tree_host.cc
@@ -128,7 +128,9 @@ LayerTreeHost::LayerTreeHost(
id_(s_layer_tree_host_sequence_number.GetNext() + 1),
next_commit_forces_redraw_(false),
shared_bitmap_manager_(shared_bitmap_manager),
- gpu_memory_buffer_manager_(gpu_memory_buffer_manager) {
+ gpu_memory_buffer_manager_(gpu_memory_buffer_manager),
+ surface_id_namespace_(0u),
+ next_surface_sequence_(1u) {
if (settings_.accelerated_animation_enabled)
animation_registrar_ = AnimationRegistrar::Create();
rendering_stats_instrumentation_->set_record_rendering_stats(
@@ -167,15 +169,15 @@ void LayerTreeHost::InitializeProxy(scoped_ptr<Proxy> proxy) {
LayerTreeHost::~LayerTreeHost() {
TRACE_EVENT0("cc", "LayerTreeHost::~LayerTreeHost");
- DCHECK(swap_promise_monitor_.empty());
-
- BreakSwapPromises(SwapPromise::COMMIT_FAILS);
-
overhang_ui_resource_ = nullptr;
if (root_layer_.get())
root_layer_->SetLayerTreeHost(NULL);
+ DCHECK(swap_promise_monitor_.empty());
+
+ BreakSwapPromises(SwapPromise::COMMIT_FAILS);
+
if (proxy_) {
DCHECK(proxy_->IsMainThread());
proxy_->Stop();
@@ -1336,4 +1338,12 @@ void LayerTreeHost::BreakSwapPromises(SwapPromise::DidNotSwapReason reason) {
swap_promise_list_.clear();
}
+void LayerTreeHost::set_surface_id_namespace(uint32_t id_namespace) {
+ surface_id_namespace_ = id_namespace;
+}
+
+SurfaceSequence LayerTreeHost::CreateSurfaceSequence() {
+ return SurfaceSequence(surface_id_namespace_, next_surface_sequence_++);
+}
+
} // namespace cc