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

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: update comment and 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 | « no previous file | cc/trees/layer_tree_host_common_unittest.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 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 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 layer->set_contributes_to_drawn_render_surface(false); 371 layer->set_contributes_to_drawn_render_surface(false);
372 372
373 bool is_root = layer_tree_impl->IsRootLayer(layer); 373 bool is_root = layer_tree_impl->IsRootLayer(layer);
374 374
375 bool skip_draw_properties_computation = 375 bool skip_draw_properties_computation =
376 draw_property_utils::LayerShouldBeSkippedForDrawPropertiesComputation( 376 draw_property_utils::LayerShouldBeSkippedForDrawPropertiesComputation(
377 layer, property_trees->transform_tree, property_trees->effect_tree); 377 layer, property_trees->transform_tree, property_trees->effect_tree);
378 378
379 bool skip_for_invertibility = SkipForInvertibility(layer, property_trees); 379 bool skip_for_invertibility = SkipForInvertibility(layer, property_trees);
380 380
381 const EffectNode* effect_node =
382 property_trees->effect_tree.Node(layer->effect_tree_index());
383 bool has_animating_opacity_and_hidden =
384 effect_node->has_potential_opacity_animation &&
385 property_trees->effect_tree.EffectiveOpacity(effect_node) == 0.f &&
386 !effect_node->has_copy_request;
387
381 bool skip_layer = !is_root && (skip_draw_properties_computation || 388 bool skip_layer = !is_root && (skip_draw_properties_computation ||
382 skip_for_invertibility); 389 skip_for_invertibility ||
390 has_animating_opacity_and_hidden);
383 391
384 layer->set_raster_even_if_not_in_rsll(skip_for_invertibility && 392 bool raster_even_if_not_in_rsll =
385 !skip_draw_properties_computation); 393 skip_draw_properties_computation
394 ? false
395 : has_animating_opacity_and_hidden || skip_for_invertibility;
396 layer->set_raster_even_if_not_in_rsll(raster_even_if_not_in_rsll);
386 if (skip_layer) 397 if (skip_layer)
387 continue; 398 continue;
388 399
389 bool layer_is_drawn = 400 bool layer_is_drawn =
390 property_trees->effect_tree.Node(layer->effect_tree_index())->is_drawn; 401 property_trees->effect_tree.Node(layer->effect_tree_index())->is_drawn;
391 bool layer_should_be_drawn = draw_property_utils::LayerNeedsUpdate( 402 bool layer_should_be_drawn = draw_property_utils::LayerNeedsUpdate(
392 layer, layer_is_drawn, property_trees); 403 layer, layer_is_drawn, property_trees);
393 if (!layer_should_be_drawn) 404 if (!layer_should_be_drawn)
394 continue; 405 continue;
395 406
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
683 694
684 PropertyTrees* GetPropertyTrees(Layer* layer) { 695 PropertyTrees* GetPropertyTrees(Layer* layer) {
685 return layer->layer_tree_host()->property_trees(); 696 return layer->layer_tree_host()->property_trees();
686 } 697 }
687 698
688 PropertyTrees* GetPropertyTrees(LayerImpl* layer) { 699 PropertyTrees* GetPropertyTrees(LayerImpl* layer) {
689 return layer->layer_tree_impl()->property_trees(); 700 return layer->layer_tree_impl()->property_trees();
690 } 701 }
691 702
692 } // namespace cc 703 } // namespace cc
OLDNEW
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_common_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698