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

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

Issue 2693703010: cc: Remove support for disabling non-root render surfaces. (Closed)
Patch Set: softwaredraw-remove-no-surfaces: rebase 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') | no next file » | 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 986 matching lines...) Expand 10 before | Expand all | Expand 10 after
997 id_1 = Node(id_1)->target_id; 997 id_1 = Node(id_1)->target_id;
998 } 998 }
999 999
1000 return id_1; 1000 return id_1;
1001 } 1001 }
1002 1002
1003 void EffectTree::AddMaskLayerId(int id) { 1003 void EffectTree::AddMaskLayerId(int id) {
1004 mask_layer_ids_.push_back(id); 1004 mask_layer_ids_.push_back(id);
1005 } 1005 }
1006 1006
1007 void EffectTree::UpdateRenderSurfaces(LayerTreeImpl* layer_tree_impl, 1007 void EffectTree::UpdateRenderSurfaces(LayerTreeImpl* layer_tree_impl) {
1008 bool non_root_surfaces_enabled) {
1009 for (int id = kContentsRootNodeId; id < static_cast<int>(size()); ++id) { 1008 for (int id = kContentsRootNodeId; id < static_cast<int>(size()); ++id) {
1010 EffectNode* effect_node = Node(id); 1009 EffectNode* effect_node = Node(id);
1011 bool needs_render_surface = 1010 bool needs_render_surface =
1012 id == kContentsRootNodeId || 1011 id == kContentsRootNodeId || effect_node->has_render_surface;
1013 (non_root_surfaces_enabled && effect_node->has_render_surface);
1014 if (needs_render_surface == !!render_surfaces_[id]) 1012 if (needs_render_surface == !!render_surfaces_[id])
1015 continue; 1013 continue;
1016 1014
1017 if (needs_render_surface) { 1015 if (needs_render_surface) {
1018 render_surfaces_[id] = base::MakeUnique<RenderSurfaceImpl>( 1016 render_surfaces_[id] = base::MakeUnique<RenderSurfaceImpl>(
1019 layer_tree_impl, effect_node->owning_layer_id); 1017 layer_tree_impl, effect_node->owning_layer_id);
1020 render_surfaces_[id]->set_effect_tree_index(id); 1018 render_surfaces_[id]->set_effect_tree_index(id);
1021 } else { 1019 } else {
1022 render_surfaces_[id].reset(); 1020 render_surfaces_[id].reset();
1023 } 1021 }
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after
1593 1591
1594 PropertyTreesCachedData::PropertyTreesCachedData() 1592 PropertyTreesCachedData::PropertyTreesCachedData()
1595 : transform_tree_update_number(0) { 1593 : transform_tree_update_number(0) {
1596 animation_scales.clear(); 1594 animation_scales.clear();
1597 } 1595 }
1598 1596
1599 PropertyTreesCachedData::~PropertyTreesCachedData() {} 1597 PropertyTreesCachedData::~PropertyTreesCachedData() {}
1600 1598
1601 PropertyTrees::PropertyTrees() 1599 PropertyTrees::PropertyTrees()
1602 : needs_rebuild(true), 1600 : needs_rebuild(true),
1603 non_root_surfaces_enabled(true),
1604 can_adjust_raster_scales(true), 1601 can_adjust_raster_scales(true),
1605 changed(false), 1602 changed(false),
1606 full_tree_damaged(false), 1603 full_tree_damaged(false),
1607 sequence_number(0), 1604 sequence_number(0),
1608 is_main_thread(true), 1605 is_main_thread(true),
1609 is_active(false) { 1606 is_active(false) {
1610 transform_tree.SetPropertyTrees(this); 1607 transform_tree.SetPropertyTrees(this);
1611 effect_tree.SetPropertyTrees(this); 1608 effect_tree.SetPropertyTrees(this);
1612 clip_tree.SetPropertyTrees(this); 1609 clip_tree.SetPropertyTrees(this);
1613 scroll_tree.SetPropertyTrees(this); 1610 scroll_tree.SetPropertyTrees(this);
(...skipping 10 matching lines...) Expand all
1624 element_id_to_scroll_node_index == 1621 element_id_to_scroll_node_index ==
1625 other.element_id_to_scroll_node_index && 1622 other.element_id_to_scroll_node_index &&
1626 element_id_to_transform_node_index == 1623 element_id_to_transform_node_index ==
1627 other.element_id_to_transform_node_index && 1624 other.element_id_to_transform_node_index &&
1628 always_use_active_tree_opacity_effect_ids == 1625 always_use_active_tree_opacity_effect_ids ==
1629 other.always_use_active_tree_opacity_effect_ids && 1626 other.always_use_active_tree_opacity_effect_ids &&
1630 needs_rebuild == other.needs_rebuild && changed == other.changed && 1627 needs_rebuild == other.needs_rebuild && changed == other.changed &&
1631 full_tree_damaged == other.full_tree_damaged && 1628 full_tree_damaged == other.full_tree_damaged &&
1632 is_main_thread == other.is_main_thread && 1629 is_main_thread == other.is_main_thread &&
1633 is_active == other.is_active && 1630 is_active == other.is_active &&
1634 non_root_surfaces_enabled == other.non_root_surfaces_enabled &&
1635 can_adjust_raster_scales == other.can_adjust_raster_scales && 1631 can_adjust_raster_scales == other.can_adjust_raster_scales &&
1636 sequence_number == other.sequence_number; 1632 sequence_number == other.sequence_number;
1637 } 1633 }
1638 1634
1639 PropertyTrees& PropertyTrees::operator=(const PropertyTrees& from) { 1635 PropertyTrees& PropertyTrees::operator=(const PropertyTrees& from) {
1640 transform_tree = from.transform_tree; 1636 transform_tree = from.transform_tree;
1641 effect_tree = from.effect_tree; 1637 effect_tree = from.effect_tree;
1642 clip_tree = from.clip_tree; 1638 clip_tree = from.clip_tree;
1643 scroll_tree = from.scroll_tree; 1639 scroll_tree = from.scroll_tree;
1644 always_use_active_tree_opacity_effect_ids = 1640 always_use_active_tree_opacity_effect_ids =
1645 from.always_use_active_tree_opacity_effect_ids; 1641 from.always_use_active_tree_opacity_effect_ids;
1646 element_id_to_effect_node_index = from.element_id_to_effect_node_index; 1642 element_id_to_effect_node_index = from.element_id_to_effect_node_index;
1647 element_id_to_scroll_node_index = from.element_id_to_scroll_node_index; 1643 element_id_to_scroll_node_index = from.element_id_to_scroll_node_index;
1648 element_id_to_transform_node_index = from.element_id_to_transform_node_index; 1644 element_id_to_transform_node_index = from.element_id_to_transform_node_index;
1649 needs_rebuild = from.needs_rebuild; 1645 needs_rebuild = from.needs_rebuild;
1650 changed = from.changed; 1646 changed = from.changed;
1651 full_tree_damaged = from.full_tree_damaged; 1647 full_tree_damaged = from.full_tree_damaged;
1652 non_root_surfaces_enabled = from.non_root_surfaces_enabled;
1653 can_adjust_raster_scales = from.can_adjust_raster_scales; 1648 can_adjust_raster_scales = from.can_adjust_raster_scales;
1654 sequence_number = from.sequence_number; 1649 sequence_number = from.sequence_number;
1655 is_main_thread = from.is_main_thread; 1650 is_main_thread = from.is_main_thread;
1656 is_active = from.is_active; 1651 is_active = from.is_active;
1657 inner_viewport_container_bounds_delta_ = 1652 inner_viewport_container_bounds_delta_ =
1658 from.inner_viewport_container_bounds_delta(); 1653 from.inner_viewport_container_bounds_delta();
1659 outer_viewport_container_bounds_delta_ = 1654 outer_viewport_container_bounds_delta_ =
1660 from.outer_viewport_container_bounds_delta(); 1655 from.outer_viewport_container_bounds_delta();
1661 inner_viewport_scroll_bounds_delta_ = 1656 inner_viewport_scroll_bounds_delta_ =
1662 from.inner_viewport_scroll_bounds_delta(); 1657 from.inner_viewport_scroll_bounds_delta();
(...skipping 11 matching lines...) Expand all
1674 effect_tree.clear(); 1669 effect_tree.clear();
1675 scroll_tree.clear(); 1670 scroll_tree.clear();
1676 element_id_to_effect_node_index.clear(); 1671 element_id_to_effect_node_index.clear();
1677 element_id_to_scroll_node_index.clear(); 1672 element_id_to_scroll_node_index.clear();
1678 element_id_to_transform_node_index.clear(); 1673 element_id_to_transform_node_index.clear();
1679 always_use_active_tree_opacity_effect_ids.clear(); 1674 always_use_active_tree_opacity_effect_ids.clear();
1680 1675
1681 needs_rebuild = true; 1676 needs_rebuild = true;
1682 full_tree_damaged = false; 1677 full_tree_damaged = false;
1683 changed = false; 1678 changed = false;
1684 non_root_surfaces_enabled = true;
1685 can_adjust_raster_scales = true; 1679 can_adjust_raster_scales = true;
1686 sequence_number++; 1680 sequence_number++;
1687 1681
1688 #if DCHECK_IS_ON() 1682 #if DCHECK_IS_ON()
1689 PropertyTrees tree; 1683 PropertyTrees tree;
1690 tree.transform_tree = transform_tree; 1684 tree.transform_tree = transform_tree;
1691 tree.effect_tree = effect_tree; 1685 tree.effect_tree = effect_tree;
1692 tree.clip_tree = clip_tree; 1686 tree.clip_tree = clip_tree;
1693 tree.scroll_tree = scroll_tree; 1687 tree.scroll_tree = scroll_tree;
1694 tree.scroll_tree.CopyCompleteTreeState(scroll_tree); 1688 tree.scroll_tree.CopyCompleteTreeState(scroll_tree);
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after
2126 const EffectNode* effect_node = effect_tree.Node(effect_id); 2120 const EffectNode* effect_node = effect_tree.Node(effect_id);
2127 2121
2128 if (effect_node->surface_contents_scale.x() != 0.0 && 2122 if (effect_node->surface_contents_scale.x() != 0.0 &&
2129 effect_node->surface_contents_scale.y() != 0.0) 2123 effect_node->surface_contents_scale.y() != 0.0)
2130 screen_space_transform.Scale(1.0 / effect_node->surface_contents_scale.x(), 2124 screen_space_transform.Scale(1.0 / effect_node->surface_contents_scale.x(),
2131 1.0 / effect_node->surface_contents_scale.y()); 2125 1.0 / effect_node->surface_contents_scale.y());
2132 return screen_space_transform; 2126 return screen_space_transform;
2133 } 2127 }
2134 2128
2135 } // namespace cc 2129 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/property_tree.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698