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

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

Issue 2858853002: cc : Don't draw animating layers which are transparent but raster them. (Closed)
Patch Set: 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/layer_tree_impl.cc ('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 779 matching lines...) Expand 10 before | Expand all | Expand 10 after
790 if (parent_node) 790 if (parent_node)
791 node->screen_space_opacity *= parent_node->screen_space_opacity; 791 node->screen_space_opacity *= parent_node->screen_space_opacity;
792 } 792 }
793 793
794 void EffectTree::UpdateIsDrawn(EffectNode* node, EffectNode* parent_node) { 794 void EffectTree::UpdateIsDrawn(EffectNode* node, EffectNode* parent_node) {
795 // Nodes that have screen space opacity 0 are hidden. So they are not drawn. 795 // Nodes that have screen space opacity 0 are hidden. So they are not drawn.
796 // Exceptions: 796 // Exceptions:
797 // 1) Nodes that contribute to copy requests, whether hidden or not, must be 797 // 1) Nodes that contribute to copy requests, whether hidden or not, must be
798 // drawn. 798 // drawn.
799 // 2) Nodes that have a background filter. 799 // 2) Nodes that have a background filter.
800 // 3) Nodes with animating screen space opacity on main thread or pending tree 800 // 3) Nodes with animating screen space opacity on main thread or pending tree
weiliangc 2017/05/03 21:19:50 Update the comment?
801 // are drawn if their parent is drawn irrespective of their opacity. 801 // are drawn if their parent is drawn irrespective of their opacity.
802 if (node->has_copy_request) 802 if (node->has_copy_request)
803 node->is_drawn = true; 803 node->is_drawn = true;
804 else if (EffectiveOpacity(node) == 0.f && 804 else if (EffectiveOpacity(node) == 0.f &&
805 (!node->has_potential_opacity_animation || 805 !node->has_potential_opacity_animation &&
806 property_trees()->is_active) &&
807 node->background_filters.IsEmpty()) 806 node->background_filters.IsEmpty())
808 node->is_drawn = false; 807 node->is_drawn = false;
809 else if (parent_node) 808 else if (parent_node)
810 node->is_drawn = parent_node->is_drawn; 809 node->is_drawn = parent_node->is_drawn;
811 else 810 else
812 node->is_drawn = true; 811 node->is_drawn = true;
813 } 812 }
814 813
815 void EffectTree::UpdateEffectChanged(EffectNode* node, 814 void EffectTree::UpdateEffectChanged(EffectNode* node,
816 EffectNode* parent_node) { 815 EffectNode* parent_node) {
(...skipping 1325 matching lines...) Expand 10 before | Expand all | Expand 10 after
2142 const EffectNode* effect_node = effect_tree.Node(effect_id); 2141 const EffectNode* effect_node = effect_tree.Node(effect_id);
2143 2142
2144 if (effect_node->surface_contents_scale.x() != 0.0 && 2143 if (effect_node->surface_contents_scale.x() != 0.0 &&
2145 effect_node->surface_contents_scale.y() != 0.0) 2144 effect_node->surface_contents_scale.y() != 0.0)
2146 screen_space_transform.Scale(1.0 / effect_node->surface_contents_scale.x(), 2145 screen_space_transform.Scale(1.0 / effect_node->surface_contents_scale.x(),
2147 1.0 / effect_node->surface_contents_scale.y()); 2146 1.0 / effect_node->surface_contents_scale.y());
2148 return screen_space_transform; 2147 return screen_space_transform;
2149 } 2148 }
2150 2149
2151 } // namespace cc 2150 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698