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

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

Issue 1307713002: cc: Allow transparent layers with background filters to render (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update test comment Created 5 years, 4 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/draw_property_utils.cc ('k') | 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 <algorithm> 7 #include <algorithm>
8 8
9 #include "base/trace_event/trace_event.h" 9 #include "base/trace_event/trace_event.h"
10 #include "cc/base/math_util.h" 10 #include "cc/base/math_util.h"
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after
462 if (!layer_is_drawn) 462 if (!layer_is_drawn)
463 return true; 463 return true;
464 464
465 // If layer is on the pending tree and opacity is being animated then 465 // If layer is on the pending tree and opacity is being animated then
466 // this subtree can't be skipped as we need to create, prioritize and 466 // this subtree can't be skipped as we need to create, prioritize and
467 // include tiles for this layer when deciding if tree can be activated. 467 // include tiles for this layer when deciding if tree can be activated.
468 if (layer->layer_tree_impl()->IsPendingTree() && 468 if (layer->layer_tree_impl()->IsPendingTree() &&
469 layer->HasPotentiallyRunningOpacityAnimation()) 469 layer->HasPotentiallyRunningOpacityAnimation())
470 return false; 470 return false;
471 471
472 // If layer has a background filter, don't skip the layer, even it the
473 // opacity is 0.
474 if (!layer->background_filters().IsEmpty())
475 return false;
476
472 // The opacity of a layer always applies to its children (either implicitly 477 // The opacity of a layer always applies to its children (either implicitly
473 // via a render surface or explicitly if the parent preserves 3D), so the 478 // via a render surface or explicitly if the parent preserves 3D), so the
474 // entire subtree can be skipped if this layer is fully transparent. 479 // entire subtree can be skipped if this layer is fully transparent.
475 return !layer->opacity(); 480 return !layer->opacity();
476 } 481 }
477 482
478 static inline void SavePaintPropertiesLayer(LayerImpl* layer) {} 483 static inline void SavePaintPropertiesLayer(LayerImpl* layer) {}
479 484
480 static bool SubtreeShouldRenderToSeparateSurface( 485 static bool SubtreeShouldRenderToSeparateSurface(
481 Layer* layer, 486 Layer* layer,
(...skipping 2099 matching lines...) Expand 10 before | Expand all | Expand 10 after
2581 2586
2582 PropertyTrees* GetPropertyTrees(Layer* layer) { 2587 PropertyTrees* GetPropertyTrees(Layer* layer) {
2583 return layer->layer_tree_host()->property_trees(); 2588 return layer->layer_tree_host()->property_trees();
2584 } 2589 }
2585 2590
2586 PropertyTrees* GetPropertyTrees(LayerImpl* layer) { 2591 PropertyTrees* GetPropertyTrees(LayerImpl* layer) {
2587 return layer->layer_tree_impl()->property_trees(); 2592 return layer->layer_tree_impl()->property_trees();
2588 } 2593 }
2589 2594
2590 } // namespace cc 2595 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/draw_property_utils.cc ('k') | cc/trees/layer_tree_host_common_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698