Index: ui/compositor/layer.cc |
diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc |
index 8c8a29195c529640c22758434febfdc5e3b7ba7f..691469de7f95de744a6710c4067356ae1f1af389 100644 |
--- a/ui/compositor/layer.cc |
+++ b/ui/compositor/layer.cc |
@@ -38,6 +38,8 @@ |
namespace { |
+static cc::ElementId g_next_element_id = 1; |
+ |
const ui::Layer* GetRoot(const ui::Layer* layer) { |
while (layer->parent()) |
layer = layer->parent(); |
@@ -147,6 +149,10 @@ void Layer::ResetCompositor() { |
} |
} |
+cc::ElementId Layer::NextElementId() { |
+ return g_next_element_id++; |
+} |
+ |
void Layer::Add(Layer* child) { |
DCHECK(!child->compositor_); |
if (child->parent_) |
@@ -963,6 +969,7 @@ void Layer::CreateCcLayer() { |
content_layer_ = cc::PictureLayer::Create(this); |
cc_layer_ = content_layer_.get(); |
} |
+ cc_layer_->SetElementId(NextElementId()); |
cc_layer_->SetTransformOrigin(gfx::Point3F()); |
cc_layer_->SetContentsOpaque(true); |
cc_layer_->SetIsDrawable(type_ != LAYER_NOT_DRAWN); |