Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(211)

Unified Diff: cc/trees/layer_tree_impl.cc

Issue 332433003: cc: Remove EnsureRenderSurfaceLayerList, do UpdateDrawProps when needed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ensurersll: . Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« cc/trees/layer_tree_host_impl_unittest.cc ('K') | « cc/trees/layer_tree_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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(
« cc/trees/layer_tree_host_impl_unittest.cc ('K') | « cc/trees/layer_tree_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698