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

Side by Side Diff: cc/layers/layer.cc

Issue 2816063003: Replace layer id with Element id for tracking scrollbar animation controllers (Closed)
Patch Set: Address reviewer comments & fix ScrollbarVisibilityChangeCausesRedrawAndCommit Created 3 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2010 The Chromium Authors. All rights reserved. 1 // Copyright 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/layers/layer.h" 5 #include "cc/layers/layer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 1111 matching lines...) Expand 10 before | Expand all | Expand 10 after
1122 1122
1123 void Layer::PushPropertiesTo(LayerImpl* layer) { 1123 void Layer::PushPropertiesTo(LayerImpl* layer) {
1124 TRACE_EVENT0("cc", "Layer::PushPropertiesTo"); 1124 TRACE_EVENT0("cc", "Layer::PushPropertiesTo");
1125 DCHECK(layer_tree_host_); 1125 DCHECK(layer_tree_host_);
1126 1126
1127 // If we did not SavePaintProperties() for the layer this frame, then push the 1127 // If we did not SavePaintProperties() for the layer this frame, then push the
1128 // real property values, not the paint property values. 1128 // real property values, not the paint property values.
1129 bool use_paint_properties = paint_properties_.source_frame_number == 1129 bool use_paint_properties = paint_properties_.source_frame_number ==
1130 layer_tree_host_->SourceFrameNumber(); 1130 layer_tree_host_->SourceFrameNumber();
1131 1131
1132 layer->SetElementId(inputs_.element_id);
pdr. 2017/04/15 06:02:00 LayerTreeHostImplTest.ScrollbarVisibilityChangeCau
enne (OOO) 2017/04/18 00:47:57 Good catch! That sounds like a terrible thing to h
pdr. 2017/04/18 04:34:11 We do have a big comment in element_id.h that is..
1132 layer->SetBackgroundColor(inputs_.background_color); 1133 layer->SetBackgroundColor(inputs_.background_color);
1133 layer->SetSafeOpaqueBackgroundColor(safe_opaque_background_color_); 1134 layer->SetSafeOpaqueBackgroundColor(safe_opaque_background_color_);
1134 layer->SetBounds(use_paint_properties ? paint_properties_.bounds 1135 layer->SetBounds(use_paint_properties ? paint_properties_.bounds
1135 : inputs_.bounds); 1136 : inputs_.bounds);
1136 1137
1137 #if defined(NDEBUG) 1138 #if defined(NDEBUG)
1138 if (frame_viewer_instrumentation::IsTracingLayerTreeSnapshots()) 1139 if (frame_viewer_instrumentation::IsTracingLayerTreeSnapshots())
1139 layer->SetDebugInfo(TakeDebugInfo()); 1140 layer->SetDebugInfo(TakeDebugInfo());
1140 #else 1141 #else
1141 layer->SetDebugInfo(TakeDebugInfo()); 1142 layer->SetDebugInfo(TakeDebugInfo());
(...skipping 20 matching lines...) Expand all
1162 layer->set_should_flatten_transform_from_property_tree( 1163 layer->set_should_flatten_transform_from_property_tree(
1163 should_flatten_transform_from_property_tree_); 1164 should_flatten_transform_from_property_tree_);
1164 layer->SetUseParentBackfaceVisibility(inputs_.use_parent_backface_visibility); 1165 layer->SetUseParentBackfaceVisibility(inputs_.use_parent_backface_visibility);
1165 layer->SetUseLocalTransformForBackfaceVisibility( 1166 layer->SetUseLocalTransformForBackfaceVisibility(
1166 use_local_transform_for_backface_visibility_); 1167 use_local_transform_for_backface_visibility_);
1167 layer->SetShouldCheckBackfaceVisibility(should_check_backface_visibility_); 1168 layer->SetShouldCheckBackfaceVisibility(should_check_backface_visibility_);
1168 1169
1169 layer->SetScrollClipLayer(inputs_.scroll_clip_layer_id); 1170 layer->SetScrollClipLayer(inputs_.scroll_clip_layer_id);
1170 layer->set_user_scrollable_horizontal(inputs_.user_scrollable_horizontal); 1171 layer->set_user_scrollable_horizontal(inputs_.user_scrollable_horizontal);
1171 layer->set_user_scrollable_vertical(inputs_.user_scrollable_vertical); 1172 layer->set_user_scrollable_vertical(inputs_.user_scrollable_vertical);
1172 layer->SetElementId(inputs_.element_id);
1173 layer->SetMutableProperties(inputs_.mutable_properties); 1173 layer->SetMutableProperties(inputs_.mutable_properties);
1174 1174
1175 // When a scroll offset animation is interrupted the new scroll position on 1175 // When a scroll offset animation is interrupted the new scroll position on
1176 // the pending tree will clobber any impl-side scrolling occuring on the 1176 // the pending tree will clobber any impl-side scrolling occuring on the
1177 // active tree. To do so, avoid scrolling the pending tree along with it 1177 // active tree. To do so, avoid scrolling the pending tree along with it
1178 // instead of trying to undo that scrolling later. 1178 // instead of trying to undo that scrolling later.
1179 if (ScrollOffsetAnimationWasInterrupted()) 1179 if (ScrollOffsetAnimationWasInterrupted())
1180 layer->layer_tree_impl() 1180 layer->layer_tree_impl()
1181 ->property_trees() 1181 ->property_trees()
1182 ->scroll_tree.SetScrollOffsetClobberActiveValue(layer->id()); 1182 ->scroll_tree.SetScrollOffsetClobberActiveValue(layer->id());
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
1442 ->num_copy_requests_in_subtree; 1442 ->num_copy_requests_in_subtree;
1443 } 1443 }
1444 1444
1445 gfx::Transform Layer::ScreenSpaceTransform() const { 1445 gfx::Transform Layer::ScreenSpaceTransform() const {
1446 DCHECK_NE(transform_tree_index_, TransformTree::kInvalidNodeId); 1446 DCHECK_NE(transform_tree_index_, TransformTree::kInvalidNodeId);
1447 return draw_property_utils::ScreenSpaceTransform( 1447 return draw_property_utils::ScreenSpaceTransform(
1448 this, layer_tree_host_->property_trees()->transform_tree); 1448 this, layer_tree_host_->property_trees()->transform_tree);
1449 } 1449 }
1450 1450
1451 } // namespace cc 1451 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698