Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 366 return; | 366 return; |
| 367 | 367 |
| 368 if (ClipNode* clip_node = layer_tree_host_->property_trees()->clip_tree.Node( | 368 if (ClipNode* clip_node = layer_tree_host_->property_trees()->clip_tree.Node( |
| 369 clip_tree_index())) { | 369 clip_tree_index())) { |
| 370 if (clip_node->owner_id == id()) { | 370 if (clip_node->owner_id == id()) { |
| 371 clip_node->data.clip.set_size(gfx::SizeF(size)); | 371 clip_node->data.clip.set_size(gfx::SizeF(size)); |
| 372 layer_tree_host_->property_trees()->clip_tree.set_needs_update(true); | 372 layer_tree_host_->property_trees()->clip_tree.set_needs_update(true); |
| 373 } | 373 } |
| 374 } | 374 } |
| 375 | 375 |
| 376 SetNeedsCommitNoRebuild(); | 376 ScrollNode* scroll_node = |
| 377 layer_tree_host_->property_trees()->scroll_tree.Node(scroll_tree_index()); | |
| 378 if (scroll_node && scroll_node->owner_id == id()) { | |
| 379 scroll_node->data.bounds = size; | |
|
sunxd
2016/02/09 00:11:32
I will delete this part, as we now force a rebuild
| |
| 380 } | |
| 381 | |
| 382 SetNeedsCommit(); | |
| 377 } | 383 } |
| 378 | 384 |
| 379 Layer* Layer::RootLayer() { | 385 Layer* Layer::RootLayer() { |
| 380 Layer* layer = this; | 386 Layer* layer = this; |
| 381 while (layer->parent()) | 387 while (layer->parent()) |
| 382 layer = layer->parent(); | 388 layer = layer->parent(); |
| 383 return layer; | 389 return layer; |
| 384 } | 390 } |
| 385 | 391 |
| 386 void Layer::RemoveAllChildren() { | 392 void Layer::RemoveAllChildren() { |
| (...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 935 } | 941 } |
| 936 | 942 |
| 937 void Layer::SetScrollClipLayerId(int clip_layer_id) { | 943 void Layer::SetScrollClipLayerId(int clip_layer_id) { |
| 938 DCHECK(IsPropertyChangeAllowed()); | 944 DCHECK(IsPropertyChangeAllowed()); |
| 939 if (scroll_clip_layer_id_ == clip_layer_id) | 945 if (scroll_clip_layer_id_ == clip_layer_id) |
| 940 return; | 946 return; |
| 941 scroll_clip_layer_id_ = clip_layer_id; | 947 scroll_clip_layer_id_ = clip_layer_id; |
| 942 SetNeedsCommit(); | 948 SetNeedsCommit(); |
| 943 } | 949 } |
| 944 | 950 |
| 951 Layer* Layer::scroll_clip_layer() const { | |
| 952 return layer_tree_host()->LayerById(scroll_clip_layer_id_); | |
| 953 } | |
| 954 | |
| 945 void Layer::SetUserScrollable(bool horizontal, bool vertical) { | 955 void Layer::SetUserScrollable(bool horizontal, bool vertical) { |
| 946 DCHECK(IsPropertyChangeAllowed()); | 956 DCHECK(IsPropertyChangeAllowed()); |
| 947 if (user_scrollable_horizontal_ == horizontal && | 957 if (user_scrollable_horizontal_ == horizontal && |
| 948 user_scrollable_vertical_ == vertical) | 958 user_scrollable_vertical_ == vertical) |
| 949 return; | 959 return; |
| 950 user_scrollable_horizontal_ = horizontal; | 960 user_scrollable_horizontal_ = horizontal; |
| 951 user_scrollable_vertical_ = vertical; | 961 user_scrollable_vertical_ = vertical; |
| 952 SetNeedsCommit(); | 962 SetNeedsCommit(); |
| 953 } | 963 } |
| 954 | 964 |
| (...skipping 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2039 this, layer_tree_host_->property_trees()->transform_tree); | 2049 this, layer_tree_host_->property_trees()->transform_tree); |
| 2040 } | 2050 } |
| 2041 | 2051 |
| 2042 gfx::Transform Layer::screen_space_transform() const { | 2052 gfx::Transform Layer::screen_space_transform() const { |
| 2043 DCHECK_NE(transform_tree_index_, -1); | 2053 DCHECK_NE(transform_tree_index_, -1); |
| 2044 return ScreenSpaceTransformFromPropertyTrees( | 2054 return ScreenSpaceTransformFromPropertyTrees( |
| 2045 this, layer_tree_host_->property_trees()->transform_tree); | 2055 this, layer_tree_host_->property_trees()->transform_tree); |
| 2046 } | 2056 } |
| 2047 | 2057 |
| 2048 } // namespace cc | 2058 } // namespace cc |
| OLD | NEW |