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

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

Issue 1715973002: cc: Move tracking of layer_property_changed to main thread (3) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: transform and invertibility Created 4 years, 10 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 | « cc/layers/layer.cc ('k') | cc/layers/layer_proto_converter_unittest.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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_impl.h" 5 #include "cc/layers/layer_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <utility> 10 #include <utility>
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after
681 list = new base::ListValue; 681 list = new base::ListValue;
682 for (size_t i = 0; i < children_.size(); ++i) 682 for (size_t i = 0; i < children_.size(); ++i)
683 list->Append(children_[i]->LayerTreeAsJson()); 683 list->Append(children_[i]->LayerTreeAsJson());
684 result->Set("Children", list); 684 result->Set("Children", list);
685 685
686 return result; 686 return result;
687 } 687 }
688 688
689 void LayerImpl::SetStackingOrderChanged(bool stacking_order_changed) { 689 void LayerImpl::SetStackingOrderChanged(bool stacking_order_changed) {
690 if (stacking_order_changed) { 690 if (stacking_order_changed) {
691 stacking_order_changed_ = true; 691 stacking_order_changed_ = true;
ajuma 2016/02/22 15:54:40 I believe stacking_order_changed_ exists purely fo
jaydasika 2016/02/22 18:46:52 Done.
692 NoteLayerPropertyChangedForSubtree();
693 } 692 }
694 } 693 }
695 694
696 bool LayerImpl::LayerPropertyChanged() const { 695 bool LayerImpl::LayerPropertyChanged() const {
697 if (layer_property_changed_) 696 if (layer_property_changed_)
698 return true; 697 return true;
699 TransformNode* node = 698 TransformNode* node =
700 layer_tree_impl()->property_trees()->transform_tree.Node( 699 layer_tree_impl()->property_trees()->transform_tree.Node(
701 transform_tree_index()); 700 transform_tree_index());
702 if (node && node->data.transform_changed) 701 if (node && node->data.transform_changed)
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after
1262 1261
1263 void LayerImpl::SetTransformAndInvertibility(const gfx::Transform& transform, 1262 void LayerImpl::SetTransformAndInvertibility(const gfx::Transform& transform,
1264 bool transform_is_invertible) { 1263 bool transform_is_invertible) {
1265 if (transform_ == transform) { 1264 if (transform_ == transform) {
1266 DCHECK(transform_is_invertible_ == transform_is_invertible) 1265 DCHECK(transform_is_invertible_ == transform_is_invertible)
1267 << "Can't change invertibility if transform is unchanged"; 1266 << "Can't change invertibility if transform is unchanged";
1268 return; 1267 return;
1269 } 1268 }
1270 transform_ = transform; 1269 transform_ = transform;
1271 transform_is_invertible_ = transform_is_invertible; 1270 transform_is_invertible_ = transform_is_invertible;
1272 NoteLayerPropertyChangedForSubtree();
1273 } 1271 }
1274 1272
1275 bool LayerImpl::TransformIsAnimating() const { 1273 bool LayerImpl::TransformIsAnimating() const {
1276 LayerAnimationController::ObserverType observer_type = 1274 LayerAnimationController::ObserverType observer_type =
1277 IsActive() ? LayerAnimationController::ObserverType::ACTIVE 1275 IsActive() ? LayerAnimationController::ObserverType::ACTIVE
1278 : LayerAnimationController::ObserverType::PENDING; 1276 : LayerAnimationController::ObserverType::PENDING;
1279 return layer_animation_controller_ 1277 return layer_animation_controller_
1280 ? layer_animation_controller_->IsCurrentlyAnimatingProperty( 1278 ? layer_animation_controller_->IsCurrentlyAnimatingProperty(
1281 Animation::TRANSFORM, observer_type) 1279 Animation::TRANSFORM, observer_type)
1282 : layer_tree_impl_->IsAnimatingTransformProperty(this); 1280 : layer_tree_impl_->IsAnimatingTransformProperty(this);
(...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after
1798 .layer_transforms_should_scale_layer_contents) { 1796 .layer_transforms_should_scale_layer_contents) {
1799 return default_scale; 1797 return default_scale;
1800 } 1798 }
1801 1799
1802 gfx::Vector2dF transform_scales = MathUtil::ComputeTransform2dScaleComponents( 1800 gfx::Vector2dF transform_scales = MathUtil::ComputeTransform2dScaleComponents(
1803 DrawTransform(), default_scale); 1801 DrawTransform(), default_scale);
1804 return std::max(transform_scales.x(), transform_scales.y()); 1802 return std::max(transform_scales.x(), transform_scales.y());
1805 } 1803 }
1806 1804
1807 } // namespace cc 1805 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer.cc ('k') | cc/layers/layer_proto_converter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698