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

Unified Diff: cc/trees/property_tree.cc

Issue 1621013002: Revert of Compute if a layer is drawn without LayerTree hierarchy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 11 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/property_tree.cc
diff --git a/cc/trees/property_tree.cc b/cc/trees/property_tree.cc
index 00c620b533e4cfd9bf0ee72775be646d9bb97191..64209e936ba1423418c2ce0ea9a5ea4ea9a6b876 100644
--- a/cc/trees/property_tree.cc
+++ b/cc/trees/property_tree.cc
@@ -415,10 +415,6 @@ EffectNodeData::EffectNodeData()
: opacity(1.f),
screen_space_opacity(1.f),
has_render_surface(false),
- has_copy_request(false),
- has_background_filters(false),
- is_drawn(true),
- screen_space_opacity_is_animating(false),
num_copy_requests_in_subtree(0),
transform_id(0),
clip_id(0) {}
@@ -427,11 +423,6 @@ bool EffectNodeData::operator==(const EffectNodeData& other) const {
return opacity == other.opacity &&
screen_space_opacity == other.screen_space_opacity &&
has_render_surface == other.has_render_surface &&
- has_copy_request == other.has_copy_request &&
- has_background_filters == other.has_background_filters &&
- is_drawn == other.is_drawn &&
- screen_space_opacity_is_animating ==
- other.screen_space_opacity_is_animating &&
num_copy_requests_in_subtree == other.num_copy_requests_in_subtree &&
transform_id == other.transform_id && clip_id == other.clip_id;
}
@@ -442,11 +433,6 @@ void EffectNodeData::ToProtobuf(proto::TreeNode* proto) const {
data->set_opacity(opacity);
data->set_screen_space_opacity(screen_space_opacity);
data->set_has_render_surface(has_render_surface);
- data->set_has_copy_request(has_copy_request);
- data->set_has_background_filters(has_background_filters);
- data->set_is_drawn(is_drawn);
- data->set_screen_space_opacity_is_animating(
- screen_space_opacity_is_animating);
data->set_num_copy_requests_in_subtree(num_copy_requests_in_subtree);
data->set_transform_id(transform_id);
data->set_clip_id(clip_id);
@@ -459,10 +445,6 @@ void EffectNodeData::FromProtobuf(const proto::TreeNode& proto) {
opacity = data.opacity();
screen_space_opacity = data.screen_space_opacity();
has_render_surface = data.has_render_surface();
- has_copy_request = data.has_copy_request();
- has_background_filters = data.has_background_filters();
- is_drawn = data.is_drawn();
- screen_space_opacity_is_animating = data.screen_space_opacity_is_animating();
num_copy_requests_in_subtree = data.num_copy_requests_in_subtree();
transform_id = data.transform_id();
clip_id = data.clip_id();
@@ -1093,53 +1075,16 @@ void EffectTree::UpdateOpacities(EffectNode* node, EffectNode* parent_node) {
node->data.screen_space_opacity *= parent_node->data.screen_space_opacity;
}
-void EffectTree::UpdateIsDrawn(EffectNode* node, EffectNode* parent_node) {
- // Nodes that have screen space opacity 0 are hidden. So they are not drawn.
- // Exceptions:
- // 1) Nodes that contribute to copy requests, whether hidden or not, must be
- // drawn.
- // 2) Nodes that have a background filter.
- // 3) Nodes with animating screen space opacity.
- if (node->data.has_copy_request ||
- node->data.screen_space_opacity_is_animating ||
- node->data.has_background_filters)
- node->data.is_drawn = true;
- else if (node->data.opacity == 0.f)
- node->data.is_drawn = false;
- else if (parent_node)
- node->data.is_drawn = parent_node->data.is_drawn;
- else
- node->data.is_drawn = true;
-}
-
void EffectTree::UpdateEffects(int id) {
EffectNode* node = Node(id);
EffectNode* parent_node = parent(node);
UpdateOpacities(node, parent_node);
- UpdateIsDrawn(node, parent_node);
}
void EffectTree::ClearCopyRequests() {
- for (auto& node : nodes()) {
+ for (auto& node : nodes())
node.data.num_copy_requests_in_subtree = 0;
- node.data.has_copy_request = false;
- }
- set_needs_update(true);
-}
-
-bool EffectTree::ContributesToDrawnSurface(int id) {
- // All drawn nodes contribute to drawn surface.
- // Exception : Nodes that are hidden and are drawn only for the sake of
- // copy requests.
- EffectNode* node = Node(id);
- EffectNode* parent_node = parent(node);
- bool contributes_to_drawn_surface =
- node->data.is_drawn &&
- (node->data.opacity != 0.f || node->data.has_background_filters);
- if (parent_node && !parent_node->data.is_drawn)
- contributes_to_drawn_surface = false;
- return contributes_to_drawn_surface;
}
void TransformTree::UpdateNodeAndAncestorsHaveIntegerTranslations(
« 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