void LayerChromium::removeAllChildren() { while (m_children.size()) { LayerChromium* layer = m_children[0].get(); ASSERT(layer->parent()); layer->removeFromParent(); } }
bool LayerChromium::hasAncestor(LayerChromium* ancestor) const { for (LayerChromium* layer = parent(); layer; layer = layer->parent()) { if (layer == ancestor) return true; } return false; }
const LayerChromium* LayerChromium::rootLayer() const { const LayerChromium* layer = this; for (LayerChromium* parent = layer->parent(); parent; layer = parent, parent = parent->parent()) { } return layer; }