Chromium Code Reviews| 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..bbb39e1cb2fe43525af8bd7dc44f63f9aa200615 100644 |
| --- a/cc/trees/layer_tree_impl.cc |
| +++ b/cc/trees/layer_tree_impl.cc |
| @@ -438,16 +438,16 @@ void LayerTreeImpl::ClearViewportLayers() { |
| outer_viewport_scroll_layer_ = NULL; |
| } |
| -void LayerTreeImpl::UpdateDrawProperties() { |
| - needs_update_draw_properties_ = false; |
| - render_surface_layer_list_.clear(); |
| - |
| +bool LayerTreeImpl::UpdateDrawProperties() { |
| // For max_texture_size. |
| if (!layer_tree_host_impl_->renderer()) |
| - return; |
| + return false; |
|
Ian Vollick
2014/06/12 15:55:03
Why don't we want to clear the RSLL when we bail e
danakj
2014/06/12 16:03:58
The flag is still dirty so the values are still ol
Ian Vollick
2014/06/12 16:22:19
sg
|
| if (!root_layer()) |
| - return; |
| + return false; |
| + |
| + needs_update_draw_properties_ = false; |
| + render_surface_layer_list_.clear(); |
| { |
| TRACE_EVENT2("cc", |
| @@ -510,6 +510,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 +1230,10 @@ struct HitTestVisibleScrollableOrTouchableFunctor { |
| LayerImpl* LayerTreeImpl::FindLayerThatIsHitByPoint( |
| const gfx::PointF& screen_space_point) { |
| + if (!root_layer()) |
| + return NULL; |
| + if (needs_update_draw_properties_ && !UpdateDrawProperties()) |
|
enne (OOO)
2014/06/11 21:28:43
What about having UpdateDrawProperties early out w
danakj
2014/06/11 21:41:19
Ya, I didn't do that only cuz I'm scared it might
danakj
2014/06/12 18:26:50
Done.
|
| + return NULL; |
| FindClosestMatchingLayerDataForRecursion data_for_recursion; |
| FindClosestMatchingLayer(screen_space_point, |
| root_layer(), |
| @@ -1268,6 +1273,10 @@ struct FindTouchEventLayerFunctor { |
| LayerImpl* LayerTreeImpl::FindLayerThatIsHitByPointInTouchHandlerRegion( |
| const gfx::PointF& screen_space_point) { |
| + if (!root_layer()) |
| + return NULL; |
| + if (needs_update_draw_properties_ && !UpdateDrawProperties()) |
| + return NULL; |
| FindTouchEventLayerFunctor func = {screen_space_point}; |
| FindClosestMatchingLayerDataForRecursion data_for_recursion; |
| FindClosestMatchingLayer( |