Index: cc/trees/layer_tree_impl.cc |
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc |
index 9932a33be03d59d47c6ea65ad437c8a46b4e76a6..1b8be4636d861d0b4fa7d2b84379ac31b78b547c 100644 |
--- a/cc/trees/layer_tree_impl.cc |
+++ b/cc/trees/layer_tree_impl.cc |
@@ -438,16 +438,19 @@ void LayerTreeImpl::ClearViewportLayers() { |
outer_viewport_scroll_layer_ = NULL; |
} |
-void LayerTreeImpl::UpdateDrawProperties() { |
- needs_update_draw_properties_ = false; |
- render_surface_layer_list_.clear(); |
+bool LayerTreeImpl::UpdateDrawProperties() { |
+ if (!needs_update_draw_properties_) |
+ return true; |
// For max_texture_size. |
if (!layer_tree_host_impl_->renderer()) |
- return; |
+ return false; |
if (!root_layer()) |
- return; |
+ return false; |
+ |
+ needs_update_draw_properties_ = false; |
+ render_surface_layer_list_.clear(); |
{ |
TRACE_EVENT2("cc", |
@@ -510,6 +513,7 @@ void LayerTreeImpl::UpdateDrawProperties() { |
DCHECK(!needs_update_draw_properties_) << |
"CalcDrawProperties should not set_needs_update_draw_properties()"; |
+ return true; |
} |
const LayerImplList& LayerTreeImpl::RenderSurfaceLayerList() const { |
@@ -1229,6 +1233,10 @@ struct HitTestVisibleScrollableOrTouchableFunctor { |
LayerImpl* LayerTreeImpl::FindLayerThatIsHitByPoint( |
const gfx::PointF& screen_space_point) { |
+ if (!root_layer()) |
+ return NULL; |
+ if (!UpdateDrawProperties()) |
+ return NULL; |
FindClosestMatchingLayerDataForRecursion data_for_recursion; |
FindClosestMatchingLayer(screen_space_point, |
root_layer(), |
@@ -1268,6 +1276,10 @@ struct FindTouchEventLayerFunctor { |
LayerImpl* LayerTreeImpl::FindLayerThatIsHitByPointInTouchHandlerRegion( |
const gfx::PointF& screen_space_point) { |
+ if (!root_layer()) |
+ return NULL; |
+ if (!UpdateDrawProperties()) |
+ return NULL; |
FindTouchEventLayerFunctor func = {screen_space_point}; |
FindClosestMatchingLayerDataForRecursion data_for_recursion; |
FindClosestMatchingLayer( |