1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "ui/compositor/layer_tree_owner.h"
7 #include "ui/compositor/layer.h"
13 // Deletes |layer| and all its descendants.
14 void DeepDeleteLayers(Layer
* layer
) {
15 std::vector
<Layer
*> children
= layer
->children();
16 for (std::vector
<Layer
*>::const_iterator it
= children
.begin();
20 DeepDeleteLayers(child
);
27 LayerTreeOwner::LayerTreeOwner(Layer
* root
) : root_(root
) {}
29 LayerTreeOwner::~LayerTreeOwner() {
31 DeepDeleteLayers(root_
);