| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 EffectNodeData::EffectNodeData() | 434 EffectNodeData::EffectNodeData() |
| 435 : opacity(1.f), | 435 : opacity(1.f), |
| 436 screen_space_opacity(1.f), | 436 screen_space_opacity(1.f), |
| 437 has_render_surface(false), | 437 has_render_surface(false), |
| 438 has_copy_request(false), | 438 has_copy_request(false), |
| 439 has_background_filters(false), | 439 has_background_filters(false), |
| 440 is_drawn(true), | 440 is_drawn(true), |
| 441 has_animated_opacity(false), | 441 has_animated_opacity(false), |
| 442 effect_changed(false), | 442 effect_changed(false), |
| 443 num_copy_requests_in_subtree(0), | 443 num_copy_requests_in_subtree(0), |
| 444 has_unclipped_descendants(false), |
| 444 transform_id(0), | 445 transform_id(0), |
| 445 clip_id(0) {} | 446 clip_id(0), |
| 447 target_id(0) {} |
| 446 | 448 |
| 447 EffectNodeData::EffectNodeData(const EffectNodeData& other) = default; | 449 EffectNodeData::EffectNodeData(const EffectNodeData& other) = default; |
| 448 | 450 |
| 449 bool EffectNodeData::operator==(const EffectNodeData& other) const { | 451 bool EffectNodeData::operator==(const EffectNodeData& other) const { |
| 450 return opacity == other.opacity && | 452 return opacity == other.opacity && |
| 451 screen_space_opacity == other.screen_space_opacity && | 453 screen_space_opacity == other.screen_space_opacity && |
| 452 has_render_surface == other.has_render_surface && | 454 has_render_surface == other.has_render_surface && |
| 453 has_copy_request == other.has_copy_request && | 455 has_copy_request == other.has_copy_request && |
| 454 has_background_filters == other.has_background_filters && | 456 has_background_filters == other.has_background_filters && |
| 455 is_drawn == other.is_drawn && | 457 is_drawn == other.is_drawn && |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 if (source_id == dest_id) | 591 if (source_id == dest_id) |
| 590 return true; | 592 return true; |
| 591 | 593 |
| 592 if (source_id > dest_id) { | 594 if (source_id > dest_id) { |
| 593 return CombineTransformsBetween(source_id, dest_id, transform); | 595 return CombineTransformsBetween(source_id, dest_id, transform); |
| 594 } | 596 } |
| 595 | 597 |
| 596 return CombineInversesBetween(source_id, dest_id, transform); | 598 return CombineInversesBetween(source_id, dest_id, transform); |
| 597 } | 599 } |
| 598 | 600 |
| 601 bool TransformTree::ComputeTransformWithDifferenceInSublayerScale( |
| 602 int source_id, |
| 603 int dest_id, |
| 604 gfx::Transform* transform) const { |
| 605 bool success = ComputeTransform(source_id, dest_id, transform); |
| 606 |
| 607 const TransformNode* dest_node = Node(dest_id); |
| 608 if (!dest_node->data.needs_sublayer_scale) |
| 609 return success; |
| 610 |
| 611 transform->matrix().postScale(dest_node->data.sublayer_scale.x(), |
| 612 dest_node->data.sublayer_scale.y(), 1.f); |
| 613 |
| 614 const TransformNode* source_node = Node(source_id); |
| 615 if (source_node->data.sublayer_scale.x() > 0 && |
| 616 source_node->data.sublayer_scale.y() > 0) { |
| 617 transform->Scale(1.f / source_node->data.sublayer_scale.x(), |
| 618 1.f / source_node->data.sublayer_scale.y()); |
| 619 } |
| 620 |
| 621 return success; |
| 622 } |
| 623 |
| 599 bool TransformTree::ComputeTransformWithDestinationSublayerScale( | 624 bool TransformTree::ComputeTransformWithDestinationSublayerScale( |
| 600 int source_id, | 625 int source_id, |
| 601 int dest_id, | 626 int dest_id, |
| 602 gfx::Transform* transform) const { | 627 gfx::Transform* transform) const { |
| 603 bool success = ComputeTransform(source_id, dest_id, transform); | 628 bool success = ComputeTransform(source_id, dest_id, transform); |
| 604 | 629 |
| 605 const TransformNode* dest_node = Node(dest_id); | 630 const TransformNode* dest_node = Node(dest_id); |
| 606 if (!dest_node->data.needs_sublayer_scale) | 631 if (!dest_node->data.needs_sublayer_scale) |
| 607 return success; | 632 return success; |
| 608 | 633 |
| (...skipping 1157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1766 break; | 1791 break; |
| 1767 case ALL_TREES: | 1792 case ALL_TREES: |
| 1768 transform_tree.ResetChangeTracking(); | 1793 transform_tree.ResetChangeTracking(); |
| 1769 effect_tree.ResetChangeTracking(); | 1794 effect_tree.ResetChangeTracking(); |
| 1770 } | 1795 } |
| 1771 changed = false; | 1796 changed = false; |
| 1772 full_tree_damaged = false; | 1797 full_tree_damaged = false; |
| 1773 } | 1798 } |
| 1774 | 1799 |
| 1775 } // namespace cc | 1800 } // namespace cc |
| OLD | NEW |