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

Unified Diff: cc/trees/layer_tree_impl.cc

Issue 2882403002: Remove redundant update of viewport layer types (Closed)
Patch Set: patch Created 3 years, 7 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 8b41a759da3bb227c68148ce4fcc1faa90baaef6..c5045404250057d24812b2896eef697f85b11758 100644
--- a/cc/trees/layer_tree_impl.cc
+++ b/cc/trees/layer_tree_impl.cc
@@ -1015,20 +1015,8 @@ void LayerTreeImpl::SetViewportLayersFromIds(
inner_viewport_scroll_layer_id_ = inner_viewport_scroll_layer_id;
outer_viewport_scroll_layer_id_ = outer_viewport_scroll_layer_id;
- UpdateViewportLayerTypes();
-}
-
-void LayerTreeImpl::ClearViewportLayers() {
- SetViewportLayersFromIds(Layer::INVALID_ID, Layer::INVALID_ID,
- Layer::INVALID_ID, Layer::INVALID_ID);
-}
-
-void LayerTreeImpl::UpdateViewportLayerTypes() {
// The scroll_clip_layer Layer properties should be up-to-date.
- // TODO(pdr): Enable this DCHECK by not calling this function unnecessarily
- // from LayerImpl::SetScrollClipLayer.
- // DCHECK(lifecycle().AllowsLayerPropertyAccess());
-
+ DCHECK(lifecycle().AllowsLayerPropertyAccess());
if (auto* inner_scroll = LayerById(inner_viewport_scroll_layer_id_)) {
inner_scroll->SetViewportLayerType(INNER_VIEWPORT_SCROLL);
if (auto* inner_container = inner_scroll->scroll_clip_layer())
@@ -1041,6 +1029,11 @@ void LayerTreeImpl::UpdateViewportLayerTypes() {
}
}
+void LayerTreeImpl::ClearViewportLayers() {
+ SetViewportLayersFromIds(Layer::INVALID_ID, Layer::INVALID_ID,
+ Layer::INVALID_ID, Layer::INVALID_ID);
+}
+
// For unit tests, we use the layer's id as its element id.
static void SetElementIdForTesting(LayerImpl* layer) {
layer->SetElementId(LayerIdToElementIdForTesting(layer->id()));
« 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