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 11 matching lines...) Expand all Loading... | |
| 22 #include "cc/layers/layer_impl.h" | 22 #include "cc/layers/layer_impl.h" |
| 23 #include "cc/layers/scrollbar_layer_interface.h" | 23 #include "cc/layers/scrollbar_layer_interface.h" |
| 24 #include "cc/output/copy_output_request.h" | 24 #include "cc/output/copy_output_request.h" |
| 25 #include "cc/output/copy_output_result.h" | 25 #include "cc/output/copy_output_result.h" |
| 26 #include "cc/trees/draw_property_utils.h" | 26 #include "cc/trees/draw_property_utils.h" |
| 27 #include "cc/trees/effect_node.h" | 27 #include "cc/trees/effect_node.h" |
| 28 #include "cc/trees/layer_tree_host.h" | 28 #include "cc/trees/layer_tree_host.h" |
| 29 #include "cc/trees/layer_tree_impl.h" | 29 #include "cc/trees/layer_tree_impl.h" |
| 30 #include "cc/trees/mutable_properties.h" | 30 #include "cc/trees/mutable_properties.h" |
| 31 #include "cc/trees/mutator_host.h" | 31 #include "cc/trees/mutator_host.h" |
| 32 #include "cc/trees/scroll_node.h" | |
|
flackr
2017/03/17 15:01:55
Obsolete?
smcgruer
2017/03/17 17:36:51
Done.
| |
| 32 #include "cc/trees/transform_node.h" | 33 #include "cc/trees/transform_node.h" |
| 33 #include "third_party/skia/include/core/SkImageFilter.h" | 34 #include "third_party/skia/include/core/SkImageFilter.h" |
| 34 #include "ui/gfx/geometry/rect_conversions.h" | 35 #include "ui/gfx/geometry/rect_conversions.h" |
| 35 #include "ui/gfx/geometry/vector2d_conversions.h" | 36 #include "ui/gfx/geometry/vector2d_conversions.h" |
| 36 | 37 |
| 37 namespace cc { | 38 namespace cc { |
| 38 | 39 |
| 39 base::StaticAtomicSequenceNumber g_next_layer_id; | 40 base::StaticAtomicSequenceNumber g_next_layer_id; |
| 40 | 41 |
| 41 Layer::Inputs::Inputs(int layer_id) | 42 Layer::Inputs::Inputs(int layer_id) |
| (...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 582 id())) { | 583 id())) { |
| 583 DCHECK_EQ(transform_tree_index(), | 584 DCHECK_EQ(transform_tree_index(), |
| 584 property_trees->layer_id_to_transform_node_index[id()]); | 585 property_trees->layer_id_to_transform_node_index[id()]); |
| 585 TransformNode* transform_node = | 586 TransformNode* transform_node = |
| 586 property_trees->transform_tree.Node(transform_tree_index()); | 587 property_trees->transform_tree.Node(transform_tree_index()); |
| 587 transform_node->update_post_local_transform(position, transform_origin()); | 588 transform_node->update_post_local_transform(position, transform_origin()); |
| 588 if (transform_node->sticky_position_constraint_id >= 0) { | 589 if (transform_node->sticky_position_constraint_id >= 0) { |
| 589 StickyPositionNodeData* sticky_data = | 590 StickyPositionNodeData* sticky_data = |
| 590 property_trees->transform_tree.StickyPositionData( | 591 property_trees->transform_tree.StickyPositionData( |
| 591 transform_tree_index()); | 592 transform_tree_index()); |
| 593 // This calculation will be incorrect if we have an ancestor sticky | |
| 594 // element that is not composited: http://crbug.com/702229 | |
|
flackr
2017/03/17 15:01:55
Can you change this to a TODO to either pass the m
smcgruer
2017/03/17 17:36:51
Done.
| |
| 592 sticky_data->main_thread_offset = | 595 sticky_data->main_thread_offset = |
| 593 position.OffsetFromOrigin() - | 596 position.OffsetFromOrigin() - |
| 594 sticky_data->constraints.parent_relative_sticky_box_offset | 597 sticky_data->constraints.parent_relative_sticky_box_offset |
| 595 .OffsetFromOrigin(); | 598 .OffsetFromOrigin(); |
| 596 } | 599 } |
| 597 transform_node->needs_local_transform_update = true; | 600 transform_node->needs_local_transform_update = true; |
| 598 transform_node->transform_changed = true; | 601 transform_node->transform_changed = true; |
| 599 layer_tree_host_->property_trees()->transform_tree.set_needs_update(true); | 602 layer_tree_host_->property_trees()->transform_tree.set_needs_update(true); |
| 600 SetNeedsCommitNoRebuild(); | 603 SetNeedsCommitNoRebuild(); |
| 601 return; | 604 return; |
| (...skipping 905 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1507 ->num_copy_requests_in_subtree; | 1510 ->num_copy_requests_in_subtree; |
| 1508 } | 1511 } |
| 1509 | 1512 |
| 1510 gfx::Transform Layer::screen_space_transform() const { | 1513 gfx::Transform Layer::screen_space_transform() const { |
| 1511 DCHECK_NE(transform_tree_index_, TransformTree::kInvalidNodeId); | 1514 DCHECK_NE(transform_tree_index_, TransformTree::kInvalidNodeId); |
| 1512 return draw_property_utils::ScreenSpaceTransform( | 1515 return draw_property_utils::ScreenSpaceTransform( |
| 1513 this, layer_tree_host_->property_trees()->transform_tree); | 1516 this, layer_tree_host_->property_trees()->transform_tree); |
| 1514 } | 1517 } |
| 1515 | 1518 |
| 1516 } // namespace cc | 1519 } // namespace cc |
| OLD | NEW |