| 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 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 | 303 |
| 304 // Ignore occlusion from outside the surface when surface contents need to be | 304 // Ignore occlusion from outside the surface when surface contents need to be |
| 305 // fully drawn. Layers with copy-request need to be complete. We could be | 305 // fully drawn. Layers with copy-request need to be complete. We could be |
| 306 // smarter about layers with filters that move pixels and exclude regions | 306 // smarter about layers with filters that move pixels and exclude regions |
| 307 // where both layers and the filters are occluded, but this seems like | 307 // where both layers and the filters are occluded, but this seems like |
| 308 // overkill. | 308 // overkill. |
| 309 // TODO(senorblanco): make this smarter for the SkImageFilter case (check for | 309 // TODO(senorblanco): make this smarter for the SkImageFilter case (check for |
| 310 // pixel-moving filters) | 310 // pixel-moving filters) |
| 311 const FilterOperations& filters = render_surface->Filters(); | 311 const FilterOperations& filters = render_surface->Filters(); |
| 312 bool is_occlusion_immune = render_surface->HasCopyRequest() || | 312 bool is_occlusion_immune = render_surface->HasCopyRequest() || |
| 313 render_surface->ForceRenderSurface() || |
| 313 filters.HasReferenceFilter() || | 314 filters.HasReferenceFilter() || |
| 314 filters.HasFilterThatMovesPixels(); | 315 filters.HasFilterThatMovesPixels(); |
| 315 if (is_occlusion_immune) { | 316 if (is_occlusion_immune) { |
| 316 render_surface->SetNearestOcclusionImmuneAncestor(render_surface); | 317 render_surface->SetNearestOcclusionImmuneAncestor(render_surface); |
| 317 } else if (is_root) { | 318 } else if (is_root) { |
| 318 render_surface->SetNearestOcclusionImmuneAncestor(nullptr); | 319 render_surface->SetNearestOcclusionImmuneAncestor(nullptr); |
| 319 } else { | 320 } else { |
| 320 render_surface->SetNearestOcclusionImmuneAncestor( | 321 render_surface->SetNearestOcclusionImmuneAncestor( |
| 321 render_surface->render_target()->nearest_occlusion_immune_ancestor()); | 322 render_surface->render_target()->nearest_occlusion_immune_ancestor()); |
| 322 } | 323 } |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 draw_property_utils::LayerShouldBeSkippedForDrawPropertiesComputation( | 377 draw_property_utils::LayerShouldBeSkippedForDrawPropertiesComputation( |
| 377 layer, property_trees->transform_tree, property_trees->effect_tree); | 378 layer, property_trees->transform_tree, property_trees->effect_tree); |
| 378 | 379 |
| 379 bool skip_for_invertibility = SkipForInvertibility(layer, property_trees); | 380 bool skip_for_invertibility = SkipForInvertibility(layer, property_trees); |
| 380 | 381 |
| 381 const EffectNode* effect_node = | 382 const EffectNode* effect_node = |
| 382 property_trees->effect_tree.Node(layer->effect_tree_index()); | 383 property_trees->effect_tree.Node(layer->effect_tree_index()); |
| 383 bool has_animating_opacity_and_hidden = | 384 bool has_animating_opacity_and_hidden = |
| 384 effect_node->has_potential_opacity_animation && | 385 effect_node->has_potential_opacity_animation && |
| 385 property_trees->effect_tree.EffectiveOpacity(effect_node) == 0.f && | 386 property_trees->effect_tree.EffectiveOpacity(effect_node) == 0.f && |
| 386 !effect_node->has_copy_request; | 387 !effect_node->has_copy_request && !effect_node->force_render_surface; |
| 387 | 388 |
| 388 bool skip_layer = !is_root && (skip_draw_properties_computation || | 389 bool skip_layer = !is_root && (skip_draw_properties_computation || |
| 389 skip_for_invertibility || | 390 skip_for_invertibility || |
| 390 has_animating_opacity_and_hidden); | 391 has_animating_opacity_and_hidden); |
| 391 | 392 |
| 392 bool raster_even_if_not_in_rsll = | 393 bool raster_even_if_not_in_rsll = |
| 393 skip_draw_properties_computation | 394 skip_draw_properties_computation |
| 394 ? false | 395 ? false |
| 395 : has_animating_opacity_and_hidden || skip_for_invertibility; | 396 : has_animating_opacity_and_hidden || skip_for_invertibility; |
| 396 layer->set_raster_even_if_not_in_rsll(raster_even_if_not_in_rsll); | 397 layer->set_raster_even_if_not_in_rsll(raster_even_if_not_in_rsll); |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 694 | 695 |
| 695 PropertyTrees* GetPropertyTrees(Layer* layer) { | 696 PropertyTrees* GetPropertyTrees(Layer* layer) { |
| 696 return layer->layer_tree_host()->property_trees(); | 697 return layer->layer_tree_host()->property_trees(); |
| 697 } | 698 } |
| 698 | 699 |
| 699 PropertyTrees* GetPropertyTrees(LayerImpl* layer) { | 700 PropertyTrees* GetPropertyTrees(LayerImpl* layer) { |
| 700 return layer->layer_tree_impl()->property_trees(); | 701 return layer->layer_tree_impl()->property_trees(); |
| 701 } | 702 } |
| 702 | 703 |
| 703 } // namespace cc | 704 } // namespace cc |
| OLD | NEW |