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

Side by Side Diff: cc/trees/layer_tree_host_common.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 | « no previous file | cc/trees/layer_tree_host_common_unittest.cc » ('j') | cc/trees/property_tree.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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 "cc/trees/layer_tree_host_common.h" 5 #include "cc/trees/layer_tree_host_common.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 bool is_root = layer_tree_impl->IsRootLayer(layer); 351 bool is_root = layer_tree_impl->IsRootLayer(layer);
352 352
353 bool skip_draw_properties_computation = 353 bool skip_draw_properties_computation =
354 draw_property_utils::LayerShouldBeSkippedForDrawPropertiesComputation( 354 draw_property_utils::LayerShouldBeSkippedForDrawPropertiesComputation(
355 layer, property_trees->transform_tree, property_trees->effect_tree); 355 layer, property_trees->transform_tree, property_trees->effect_tree);
356 356
357 const TransformNode* transform_node = 357 const TransformNode* transform_node =
358 property_trees->transform_tree.Node(layer->transform_tree_index()); 358 property_trees->transform_tree.Node(layer->transform_tree_index());
359 bool skip_for_invertibility = !transform_node->ancestors_are_invertible; 359 bool skip_for_invertibility = !transform_node->ancestors_are_invertible;
360 360
361 const EffectNode* effect_node =
362 property_trees->effect_tree.Node(layer->effect_tree_index());
363 bool has_animating_opacity_and_hidden =
364 effect_node->has_potential_opacity_animation &&
365 property_trees->effect_tree.EffectiveOpacity(effect_node) == 0.f &&
366 !effect_node->has_copy_request;
367
361 bool skip_layer = !is_root && (skip_draw_properties_computation || 368 bool skip_layer = !is_root && (skip_draw_properties_computation ||
362 skip_for_invertibility); 369 skip_for_invertibility ||
370 has_animating_opacity_and_hidden);
363 371
364 layer->set_raster_even_if_not_in_rsll(skip_for_invertibility && 372 bool raster_even_if_not_in_rsll =
365 !skip_draw_properties_computation); 373 skip_draw_properties_computation
374 ? false
375 : has_animating_opacity_and_hidden || skip_for_invertibility;
376 layer->set_raster_even_if_not_in_rsll(raster_even_if_not_in_rsll);
366 if (skip_layer) 377 if (skip_layer)
367 continue; 378 continue;
368 379
369 bool layer_is_drawn = 380 bool layer_is_drawn =
370 property_trees->effect_tree.Node(layer->effect_tree_index())->is_drawn; 381 property_trees->effect_tree.Node(layer->effect_tree_index())->is_drawn;
371 bool layer_should_be_drawn = draw_property_utils::LayerNeedsUpdate( 382 bool layer_should_be_drawn = draw_property_utils::LayerNeedsUpdate(
372 layer, layer_is_drawn, property_trees); 383 layer, layer_is_drawn, property_trees);
373 if (!layer_should_be_drawn) 384 if (!layer_should_be_drawn)
374 continue; 385 continue;
375 386
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 673
663 PropertyTrees* GetPropertyTrees(Layer* layer) { 674 PropertyTrees* GetPropertyTrees(Layer* layer) {
664 return layer->layer_tree_host()->property_trees(); 675 return layer->layer_tree_host()->property_trees();
665 } 676 }
666 677
667 PropertyTrees* GetPropertyTrees(LayerImpl* layer) { 678 PropertyTrees* GetPropertyTrees(LayerImpl* layer) {
668 return layer->layer_tree_impl()->property_trees(); 679 return layer->layer_tree_impl()->property_trees();
669 } 680 }
670 681
671 } // namespace cc 682 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_common_unittest.cc » ('j') | cc/trees/property_tree.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698