Chromium Code Reviews| 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; |