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

Side by Side Diff: cc/trees/property_tree.cc

Issue 2877033002: Fix cc scrollbar layer issues with initialization, and use element ids throughout. (Closed)
Patch Set: none Created 3 years, 7 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/trees/property_tree.h ('k') | cc/trees/property_tree_builder.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 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 1604 matching lines...) Expand 10 before | Expand all | Expand 10 after
1615 bool PropertyTrees::operator==(const PropertyTrees& other) const { 1615 bool PropertyTrees::operator==(const PropertyTrees& other) const {
1616 return transform_tree == other.transform_tree && 1616 return transform_tree == other.transform_tree &&
1617 effect_tree == other.effect_tree && clip_tree == other.clip_tree && 1617 effect_tree == other.effect_tree && clip_tree == other.clip_tree &&
1618 scroll_tree == other.scroll_tree && 1618 scroll_tree == other.scroll_tree &&
1619 element_id_to_effect_node_index == 1619 element_id_to_effect_node_index ==
1620 other.element_id_to_effect_node_index && 1620 other.element_id_to_effect_node_index &&
1621 element_id_to_scroll_node_index == 1621 element_id_to_scroll_node_index ==
1622 other.element_id_to_scroll_node_index && 1622 other.element_id_to_scroll_node_index &&
1623 element_id_to_transform_node_index == 1623 element_id_to_transform_node_index ==
1624 other.element_id_to_transform_node_index && 1624 other.element_id_to_transform_node_index &&
1625 always_use_active_tree_opacity_effect_ids ==
1626 other.always_use_active_tree_opacity_effect_ids &&
1627 needs_rebuild == other.needs_rebuild && changed == other.changed && 1625 needs_rebuild == other.needs_rebuild && changed == other.changed &&
1628 full_tree_damaged == other.full_tree_damaged && 1626 full_tree_damaged == other.full_tree_damaged &&
1629 is_main_thread == other.is_main_thread && 1627 is_main_thread == other.is_main_thread &&
1630 is_active == other.is_active && 1628 is_active == other.is_active &&
1631 can_adjust_raster_scales == other.can_adjust_raster_scales && 1629 can_adjust_raster_scales == other.can_adjust_raster_scales &&
1632 sequence_number == other.sequence_number; 1630 sequence_number == other.sequence_number;
1633 } 1631 }
1634 1632
1635 PropertyTrees& PropertyTrees::operator=(const PropertyTrees& from) { 1633 PropertyTrees& PropertyTrees::operator=(const PropertyTrees& from) {
1636 transform_tree = from.transform_tree; 1634 transform_tree = from.transform_tree;
1637 effect_tree = from.effect_tree; 1635 effect_tree = from.effect_tree;
1638 clip_tree = from.clip_tree; 1636 clip_tree = from.clip_tree;
1639 scroll_tree = from.scroll_tree; 1637 scroll_tree = from.scroll_tree;
1640 always_use_active_tree_opacity_effect_ids =
1641 from.always_use_active_tree_opacity_effect_ids;
1642 element_id_to_effect_node_index = from.element_id_to_effect_node_index; 1638 element_id_to_effect_node_index = from.element_id_to_effect_node_index;
1643 element_id_to_scroll_node_index = from.element_id_to_scroll_node_index; 1639 element_id_to_scroll_node_index = from.element_id_to_scroll_node_index;
1644 element_id_to_transform_node_index = from.element_id_to_transform_node_index; 1640 element_id_to_transform_node_index = from.element_id_to_transform_node_index;
1645 needs_rebuild = from.needs_rebuild; 1641 needs_rebuild = from.needs_rebuild;
1646 changed = from.changed; 1642 changed = from.changed;
1647 full_tree_damaged = from.full_tree_damaged; 1643 full_tree_damaged = from.full_tree_damaged;
1648 can_adjust_raster_scales = from.can_adjust_raster_scales; 1644 can_adjust_raster_scales = from.can_adjust_raster_scales;
1649 sequence_number = from.sequence_number; 1645 sequence_number = from.sequence_number;
1650 is_main_thread = from.is_main_thread; 1646 is_main_thread = from.is_main_thread;
1651 is_active = from.is_active; 1647 is_active = from.is_active;
(...skipping 12 matching lines...) Expand all
1664 } 1660 }
1665 1661
1666 void PropertyTrees::clear() { 1662 void PropertyTrees::clear() {
1667 transform_tree.clear(); 1663 transform_tree.clear();
1668 clip_tree.clear(); 1664 clip_tree.clear();
1669 effect_tree.clear(); 1665 effect_tree.clear();
1670 scroll_tree.clear(); 1666 scroll_tree.clear();
1671 element_id_to_effect_node_index.clear(); 1667 element_id_to_effect_node_index.clear();
1672 element_id_to_scroll_node_index.clear(); 1668 element_id_to_scroll_node_index.clear();
1673 element_id_to_transform_node_index.clear(); 1669 element_id_to_transform_node_index.clear();
1674 always_use_active_tree_opacity_effect_ids.clear();
1675 1670
1676 needs_rebuild = true; 1671 needs_rebuild = true;
1677 full_tree_damaged = false; 1672 full_tree_damaged = false;
1678 changed = false; 1673 changed = false;
1679 can_adjust_raster_scales = true; 1674 can_adjust_raster_scales = true;
1680 sequence_number++; 1675 sequence_number++;
1681 1676
1682 #if DCHECK_IS_ON() 1677 #if DCHECK_IS_ON()
1683 PropertyTrees tree; 1678 PropertyTrees tree;
1684 tree.transform_tree = transform_tree; 1679 tree.transform_tree = transform_tree;
(...skipping 25 matching lines...) Expand all
1710 1705
1711 outer_viewport_container_bounds_delta_ = bounds_delta; 1706 outer_viewport_container_bounds_delta_ = bounds_delta;
1712 transform_tree.UpdateOuterViewportContainerBoundsDelta(); 1707 transform_tree.UpdateOuterViewportContainerBoundsDelta();
1713 } 1708 }
1714 1709
1715 void PropertyTrees::SetInnerViewportScrollBoundsDelta( 1710 void PropertyTrees::SetInnerViewportScrollBoundsDelta(
1716 gfx::Vector2dF bounds_delta) { 1711 gfx::Vector2dF bounds_delta) {
1717 inner_viewport_scroll_bounds_delta_ = bounds_delta; 1712 inner_viewport_scroll_bounds_delta_ = bounds_delta;
1718 } 1713 }
1719 1714
1720 void PropertyTrees::PushOpacityIfNeeded(PropertyTrees* target_tree) {
1721 for (int id : target_tree->always_use_active_tree_opacity_effect_ids) {
1722 if (const EffectNode* source_effect_node =
1723 effect_tree.FindNodeFromOwningLayerId(id)) {
1724 EffectNode* target_effect_node =
1725 target_tree->effect_tree.UpdateNodeFromOwningLayerId(id);
1726 float source_opacity = source_effect_node->opacity;
1727 float target_opacity = target_effect_node->opacity;
1728 if (source_opacity == target_opacity)
1729 continue;
1730 target_effect_node->opacity = source_opacity;
1731 target_tree->effect_tree.set_needs_update(true);
1732 }
1733 }
1734 }
1735
1736 void PropertyTrees::RemoveIdFromIdToIndexMaps(int id) { 1715 void PropertyTrees::RemoveIdFromIdToIndexMaps(int id) {
1737 transform_tree.SetOwningLayerIdForNode(nullptr, id); 1716 transform_tree.SetOwningLayerIdForNode(nullptr, id);
1738 clip_tree.SetOwningLayerIdForNode(nullptr, id); 1717 clip_tree.SetOwningLayerIdForNode(nullptr, id);
1739 scroll_tree.SetOwningLayerIdForNode(nullptr, id); 1718 scroll_tree.SetOwningLayerIdForNode(nullptr, id);
1740 effect_tree.SetOwningLayerIdForNode(nullptr, id); 1719 effect_tree.SetOwningLayerIdForNode(nullptr, id);
1741 } 1720 }
1742 1721
1743 void PropertyTrees::UpdateChangeTracking() { 1722 void PropertyTrees::UpdateChangeTracking() {
1744 for (int id = EffectTree::kContentsRootNodeId; 1723 for (int id = EffectTree::kContentsRootNodeId;
1745 id < static_cast<int>(effect_tree.size()); ++id) { 1724 id < static_cast<int>(effect_tree.size()); ++id) {
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
2120 const EffectNode* effect_node = effect_tree.Node(effect_id); 2099 const EffectNode* effect_node = effect_tree.Node(effect_id);
2121 2100
2122 if (effect_node->surface_contents_scale.x() != 0.0 && 2101 if (effect_node->surface_contents_scale.x() != 0.0 &&
2123 effect_node->surface_contents_scale.y() != 0.0) 2102 effect_node->surface_contents_scale.y() != 0.0)
2124 screen_space_transform.Scale(1.0 / effect_node->surface_contents_scale.x(), 2103 screen_space_transform.Scale(1.0 / effect_node->surface_contents_scale.x(),
2125 1.0 / effect_node->surface_contents_scale.y()); 2104 1.0 / effect_node->surface_contents_scale.y());
2126 return screen_space_transform; 2105 return screen_space_transform;
2127 } 2106 }
2128 2107
2129 } // namespace cc 2108 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/property_tree.h ('k') | cc/trees/property_tree_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698