bool LayerAndroid::visible() { // TODO: avoid climbing tree each access LayerAndroid* current = this; while (current->getParent()) { if (!current->m_visible) return false; current = static_cast<LayerAndroid*>(current->getParent()); } return true; }