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 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
364 | 364 |
365 if (!layer_tree_host_) | 365 if (!layer_tree_host_) |
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 } |
ajuma
2016/02/09 16:27:12
The block above should be removed too (no need to
| |
375 | 375 |
376 SetNeedsCommitNoRebuild(); | 376 SetNeedsCommit(); |
377 } | 377 } |
378 | 378 |
379 Layer* Layer::RootLayer() { | 379 Layer* Layer::RootLayer() { |
380 Layer* layer = this; | 380 Layer* layer = this; |
381 while (layer->parent()) | 381 while (layer->parent()) |
382 layer = layer->parent(); | 382 layer = layer->parent(); |
383 return layer; | 383 return layer; |
384 } | 384 } |
385 | 385 |
386 void Layer::RemoveAllChildren() { | 386 void Layer::RemoveAllChildren() { |
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
935 } | 935 } |
936 | 936 |
937 void Layer::SetScrollClipLayerId(int clip_layer_id) { | 937 void Layer::SetScrollClipLayerId(int clip_layer_id) { |
938 DCHECK(IsPropertyChangeAllowed()); | 938 DCHECK(IsPropertyChangeAllowed()); |
939 if (scroll_clip_layer_id_ == clip_layer_id) | 939 if (scroll_clip_layer_id_ == clip_layer_id) |
940 return; | 940 return; |
941 scroll_clip_layer_id_ = clip_layer_id; | 941 scroll_clip_layer_id_ = clip_layer_id; |
942 SetNeedsCommit(); | 942 SetNeedsCommit(); |
943 } | 943 } |
944 | 944 |
945 Layer* Layer::scroll_clip_layer() const { | |
946 return layer_tree_host()->LayerById(scroll_clip_layer_id_); | |
947 } | |
948 | |
945 void Layer::SetUserScrollable(bool horizontal, bool vertical) { | 949 void Layer::SetUserScrollable(bool horizontal, bool vertical) { |
946 DCHECK(IsPropertyChangeAllowed()); | 950 DCHECK(IsPropertyChangeAllowed()); |
947 if (user_scrollable_horizontal_ == horizontal && | 951 if (user_scrollable_horizontal_ == horizontal && |
948 user_scrollable_vertical_ == vertical) | 952 user_scrollable_vertical_ == vertical) |
949 return; | 953 return; |
950 user_scrollable_horizontal_ = horizontal; | 954 user_scrollable_horizontal_ = horizontal; |
951 user_scrollable_vertical_ = vertical; | 955 user_scrollable_vertical_ = vertical; |
952 SetNeedsCommit(); | 956 SetNeedsCommit(); |
953 } | 957 } |
954 | 958 |
(...skipping 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2039 this, layer_tree_host_->property_trees()->transform_tree); | 2043 this, layer_tree_host_->property_trees()->transform_tree); |
2040 } | 2044 } |
2041 | 2045 |
2042 gfx::Transform Layer::screen_space_transform() const { | 2046 gfx::Transform Layer::screen_space_transform() const { |
2043 DCHECK_NE(transform_tree_index_, -1); | 2047 DCHECK_NE(transform_tree_index_, -1); |
2044 return ScreenSpaceTransformFromPropertyTrees( | 2048 return ScreenSpaceTransformFromPropertyTrees( |
2045 this, layer_tree_host_->property_trees()->transform_tree); | 2049 this, layer_tree_host_->property_trees()->transform_tree); |
2046 } | 2050 } |
2047 | 2051 |
2048 } // namespace cc | 2052 } // namespace cc |
OLD | NEW |