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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 | 294 |
295 // Ignore occlusion from outside the surface when surface contents need to be | 295 // Ignore occlusion from outside the surface when surface contents need to be |
296 // fully drawn. Layers with copy-request need to be complete. We could be | 296 // fully drawn. Layers with copy-request need to be complete. We could be |
297 // smarter about layers with filters that move pixels and exclude regions | 297 // smarter about layers with filters that move pixels and exclude regions |
298 // where both layers and the filters are occluded, but this seems like | 298 // where both layers and the filters are occluded, but this seems like |
299 // overkill. | 299 // overkill. |
300 // TODO(senorblanco): make this smarter for the SkImageFilter case (check for | 300 // TODO(senorblanco): make this smarter for the SkImageFilter case (check for |
301 // pixel-moving filters) | 301 // pixel-moving filters) |
302 const FilterOperations& filters = render_surface->Filters(); | 302 const FilterOperations& filters = render_surface->Filters(); |
303 bool is_occlusion_immune = render_surface->HasCopyRequest() || | 303 bool is_occlusion_immune = render_surface->HasCopyRequest() || |
| 304 render_surface->ShouldCacheRenderSurface() || |
304 filters.HasReferenceFilter() || | 305 filters.HasReferenceFilter() || |
305 filters.HasFilterThatMovesPixels(); | 306 filters.HasFilterThatMovesPixels(); |
306 if (is_occlusion_immune) { | 307 if (is_occlusion_immune) { |
307 render_surface->SetNearestOcclusionImmuneAncestor(render_surface); | 308 render_surface->SetNearestOcclusionImmuneAncestor(render_surface); |
308 } else if (is_root) { | 309 } else if (is_root) { |
309 render_surface->SetNearestOcclusionImmuneAncestor(nullptr); | 310 render_surface->SetNearestOcclusionImmuneAncestor(nullptr); |
310 } else { | 311 } else { |
311 render_surface->SetNearestOcclusionImmuneAncestor( | 312 render_surface->SetNearestOcclusionImmuneAncestor( |
312 render_surface->render_target()->nearest_occlusion_immune_ancestor()); | 313 render_surface->render_target()->nearest_occlusion_immune_ancestor()); |
313 } | 314 } |
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
670 | 671 |
671 PropertyTrees* GetPropertyTrees(Layer* layer) { | 672 PropertyTrees* GetPropertyTrees(Layer* layer) { |
672 return layer->layer_tree_host()->property_trees(); | 673 return layer->layer_tree_host()->property_trees(); |
673 } | 674 } |
674 | 675 |
675 PropertyTrees* GetPropertyTrees(LayerImpl* layer) { | 676 PropertyTrees* GetPropertyTrees(LayerImpl* layer) { |
676 return layer->layer_tree_impl()->property_trees(); | 677 return layer->layer_tree_impl()->property_trees(); |
677 } | 678 } |
678 | 679 |
679 } // namespace cc | 680 } // namespace cc |
OLD | NEW |