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

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

Issue 2621403003: cc: Don't create SyncedPropety instances on the main thread. (Closed)
Patch Set: win test Created 3 years, 11 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
« no previous file with comments | « no previous file | cc/test/fake_layer_tree_host.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1159 matching lines...) Expand 10 before | Expand all | Expand 10 after
1170 layer->set_user_scrollable_horizontal(inputs_.user_scrollable_horizontal); 1170 layer->set_user_scrollable_horizontal(inputs_.user_scrollable_horizontal);
1171 layer->set_user_scrollable_vertical(inputs_.user_scrollable_vertical); 1171 layer->set_user_scrollable_vertical(inputs_.user_scrollable_vertical);
1172 layer->SetElementId(inputs_.element_id); 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_tree_->property_trees() 1180 layer->layer_tree_impl()
1181 ->property_trees()
1181 ->scroll_tree.SetScrollOffsetClobberActiveValue(layer->id()); 1182 ->scroll_tree.SetScrollOffsetClobberActiveValue(layer->id());
1182 1183
1183 // If the main thread commits multiple times before the impl thread actually 1184 // If the main thread commits multiple times before the impl thread actually
1184 // draws, then damage tracking will become incorrect if we simply clobber the 1185 // draws, then damage tracking will become incorrect if we simply clobber the
1185 // update_rect here. The LayerImpl's update_rect needs to accumulate (i.e. 1186 // update_rect here. The LayerImpl's update_rect needs to accumulate (i.e.
1186 // union) any update changes that have occurred on the main thread. 1187 // union) any update changes that have occurred on the main thread.
1187 inputs_.update_rect.Union(layer->update_rect()); 1188 inputs_.update_rect.Union(layer->update_rect());
1188 layer->SetUpdateRect(inputs_.update_rect); 1189 layer->SetUpdateRect(inputs_.update_rect);
1189 1190
1190 layer->SetHasWillChangeTransformHint(has_will_change_transform_hint()); 1191 layer->SetHasWillChangeTransformHint(has_will_change_transform_hint());
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after
1663 1664
1664 LayerTree* Layer::GetLayerTree() const { 1665 LayerTree* Layer::GetLayerTree() const {
1665 return layer_tree_; 1666 return layer_tree_;
1666 } 1667 }
1667 1668
1668 void Layer::SetLayerIdForTesting(int id) { 1669 void Layer::SetLayerIdForTesting(int id) {
1669 inputs_.layer_id = id; 1670 inputs_.layer_id = id;
1670 } 1671 }
1671 1672
1672 } // namespace cc 1673 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/test/fake_layer_tree_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698