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

Unified Diff: cc/trees/layer_tree_host_common.cc

Issue 957703004: cc: Fix animated filter render surface check (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 | « no previous file | cc/trees/layer_tree_host_common_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_common.cc
diff --git a/cc/trees/layer_tree_host_common.cc b/cc/trees/layer_tree_host_common.cc
index 0109bd48c758401a30b3a845477e35cd427b2d7f..715d78573a0a70707198783e500af15ba5cae5c5 100644
--- a/cc/trees/layer_tree_host_common.cc
+++ b/cc/trees/layer_tree_host_common.cc
@@ -591,6 +591,13 @@ static bool SubtreeShouldRenderToSeparateSurface(
return true;
}
+ // If the layer will use a CSS filter. In this case, the animation
+ // will start and add a filter to this layer, so it needs a surface.
+ if (layer->FilterIsAnimating()) {
+ DCHECK(!is_root);
+ return true;
+ }
+
int num_descendants_that_draw_content =
layer->NumDescendantsThatDrawContent();
@@ -1198,20 +1205,22 @@ struct PreCalculateMetaInformationRecursiveData {
}
};
-static bool ValidateRenderSurface(LayerImpl* layer) {
+static void ValidateRenderSurface(LayerImpl* layer) {
// This test verifies that there are no cases where a LayerImpl needs
// a render surface, but doesn't have one.
if (layer->render_surface())
- return true;
+ return;
- return layer->filters().IsEmpty() && layer->background_filters().IsEmpty() &&
- !layer->mask_layer() && !layer->replica_layer() &&
- !IsRootLayer(layer) && !layer->is_root_for_isolated_group() &&
- !layer->HasCopyRequest();
+ DCHECK(layer->filters().IsEmpty()) << "layer: " << layer->id();
+ DCHECK(layer->background_filters().IsEmpty()) << "layer: " << layer->id();
+ DCHECK(!layer->mask_layer()) << "layer: " << layer->id();
+ DCHECK(!layer->replica_layer()) << "layer: " << layer->id();
+ DCHECK(!IsRootLayer(layer)) << "layer: " << layer->id();
+ DCHECK(!layer->is_root_for_isolated_group()) << "layer: " << layer->id();
+ DCHECK(!layer->HasCopyRequest()) << "layer: " << layer->id();
Ian Vollick 2015/02/25 20:26:38 Ah nice - thanks! This'll give much better errors.
}
-static bool ValidateRenderSurface(Layer* layer) {
- return true;
+static void ValidateRenderSurface(Layer* layer) {
}
// Recursively walks the layer tree to compute any information that is needed
@@ -1220,7 +1229,7 @@ template <typename LayerType>
static void PreCalculateMetaInformation(
LayerType* layer,
PreCalculateMetaInformationRecursiveData* recursive_data) {
- DCHECK(ValidateRenderSurface(layer));
+ ValidateRenderSurface(layer);
layer->draw_properties().sorted_for_recursion = false;
layer->draw_properties().has_child_with_a_scroll_parent = false;
« 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