OLD | NEW |
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 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 | 300 |
301 // Ignore occlusion from outside the surface when surface contents need to be | 301 // Ignore occlusion from outside the surface when surface contents need to be |
302 // fully drawn. Layers with copy-request need to be complete. We could be | 302 // fully drawn. Layers with copy-request need to be complete. We could be |
303 // smarter about layers with filters that move pixels and exclude regions | 303 // smarter about layers with filters that move pixels and exclude regions |
304 // where both layers and the filters are occluded, but this seems like | 304 // where both layers and the filters are occluded, but this seems like |
305 // overkill. | 305 // overkill. |
306 // TODO(senorblanco): make this smarter for the SkImageFilter case (check for | 306 // TODO(senorblanco): make this smarter for the SkImageFilter case (check for |
307 // pixel-moving filters) | 307 // pixel-moving filters) |
308 const FilterOperations& filters = render_surface->Filters(); | 308 const FilterOperations& filters = render_surface->Filters(); |
309 bool is_occlusion_immune = render_surface->HasCopyRequest() || | 309 bool is_occlusion_immune = render_surface->HasCopyRequest() || |
| 310 render_surface->ForceRenderSurface() || |
310 filters.HasReferenceFilter() || | 311 filters.HasReferenceFilter() || |
311 filters.HasFilterThatMovesPixels(); | 312 filters.HasFilterThatMovesPixels(); |
312 if (is_occlusion_immune) { | 313 if (is_occlusion_immune) { |
313 render_surface->SetNearestOcclusionImmuneAncestor(render_surface); | 314 render_surface->SetNearestOcclusionImmuneAncestor(render_surface); |
314 } else if (is_root) { | 315 } else if (is_root) { |
315 render_surface->SetNearestOcclusionImmuneAncestor(nullptr); | 316 render_surface->SetNearestOcclusionImmuneAncestor(nullptr); |
316 } else { | 317 } else { |
317 render_surface->SetNearestOcclusionImmuneAncestor( | 318 render_surface->SetNearestOcclusionImmuneAncestor( |
318 render_surface->render_target()->nearest_occlusion_immune_ancestor()); | 319 render_surface->render_target()->nearest_occlusion_immune_ancestor()); |
319 } | 320 } |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 draw_property_utils::LayerShouldBeSkippedForDrawPropertiesComputation( | 373 draw_property_utils::LayerShouldBeSkippedForDrawPropertiesComputation( |
373 layer, property_trees->transform_tree, property_trees->effect_tree); | 374 layer, property_trees->transform_tree, property_trees->effect_tree); |
374 | 375 |
375 bool skip_for_invertibility = SkipForInvertibility(layer, property_trees); | 376 bool skip_for_invertibility = SkipForInvertibility(layer, property_trees); |
376 | 377 |
377 const EffectNode* effect_node = | 378 const EffectNode* effect_node = |
378 property_trees->effect_tree.Node(layer->effect_tree_index()); | 379 property_trees->effect_tree.Node(layer->effect_tree_index()); |
379 bool has_animating_opacity_and_hidden = | 380 bool has_animating_opacity_and_hidden = |
380 effect_node->has_potential_opacity_animation && | 381 effect_node->has_potential_opacity_animation && |
381 property_trees->effect_tree.EffectiveOpacity(effect_node) == 0.f && | 382 property_trees->effect_tree.EffectiveOpacity(effect_node) == 0.f && |
382 !effect_node->has_copy_request; | 383 !effect_node->has_copy_request && !effect_node->force_render_surface; |
383 | 384 |
384 bool skip_layer = !is_root && (skip_draw_properties_computation || | 385 bool skip_layer = !is_root && (skip_draw_properties_computation || |
385 skip_for_invertibility || | 386 skip_for_invertibility || |
386 has_animating_opacity_and_hidden); | 387 has_animating_opacity_and_hidden); |
387 | 388 |
388 bool raster_even_if_not_in_rsll = | 389 bool raster_even_if_not_in_rsll = |
389 skip_draw_properties_computation | 390 skip_draw_properties_computation |
390 ? false | 391 ? false |
391 : has_animating_opacity_and_hidden || skip_for_invertibility; | 392 : has_animating_opacity_and_hidden || skip_for_invertibility; |
392 layer->set_raster_even_if_not_in_rsll(raster_even_if_not_in_rsll); | 393 layer->set_raster_even_if_not_in_rsll(raster_even_if_not_in_rsll); |
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
681 | 682 |
682 PropertyTrees* GetPropertyTrees(Layer* layer) { | 683 PropertyTrees* GetPropertyTrees(Layer* layer) { |
683 return layer->layer_tree_host()->property_trees(); | 684 return layer->layer_tree_host()->property_trees(); |
684 } | 685 } |
685 | 686 |
686 PropertyTrees* GetPropertyTrees(LayerImpl* layer) { | 687 PropertyTrees* GetPropertyTrees(LayerImpl* layer) { |
687 return layer->layer_tree_impl()->property_trees(); | 688 return layer->layer_tree_impl()->property_trees(); |
688 } | 689 } |
689 | 690 |
690 } // namespace cc | 691 } // namespace cc |
OLD | NEW |