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

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: checkinside 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
« no previous file with comments | « 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..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(
« no previous file with comments | « cc/trees/layer_tree_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698