| 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 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 draw_property_utils::ComputeSurfaceDrawProperties(property_trees, | 370 draw_property_utils::ComputeSurfaceDrawProperties(property_trees, |
| 371 surface); | 371 surface); |
| 372 | 372 |
| 373 // Ignore occlusion from outside the surface when surface contents need to | 373 // Ignore occlusion from outside the surface when surface contents need to |
| 374 // be fully drawn. Layers with copy-request need to be complete. We could | 374 // be fully drawn. Layers with copy-request need to be complete. We could |
| 375 // be smarter about layers with replica and exclude regions where both | 375 // be smarter about layers with replica and exclude regions where both |
| 376 // layer and the replica are occluded, but this seems like overkill. The | 376 // layer and the replica are occluded, but this seems like overkill. The |
| 377 // same is true for layers with filters that move pixels. | 377 // same is true for layers with filters that move pixels. |
| 378 // TODO(senorblanco): make this smarter for the SkImageFilter case (check | 378 // TODO(senorblanco): make this smarter for the SkImageFilter case (check |
| 379 // for pixel-moving filters) | 379 // for pixel-moving filters) |
| 380 bool is_occlusion_immune = layer->HasCopyRequest() || | 380 bool is_occlusion_immune = surface->HasCopyRequest() || |
| 381 layer->has_replica() || | 381 layer->has_replica() || |
| 382 layer->filters().HasReferenceFilter() || | 382 layer->filters().HasReferenceFilter() || |
| 383 layer->filters().HasFilterThatMovesPixels(); | 383 layer->filters().HasFilterThatMovesPixels(); |
| 384 if (is_occlusion_immune) { | 384 if (is_occlusion_immune) { |
| 385 surface->SetNearestOcclusionImmuneAncestor(surface); | 385 surface->SetNearestOcclusionImmuneAncestor(surface); |
| 386 } else if (is_root) { | 386 } else if (is_root) { |
| 387 surface->SetNearestOcclusionImmuneAncestor(nullptr); | 387 surface->SetNearestOcclusionImmuneAncestor(nullptr); |
| 388 } else { | 388 } else { |
| 389 surface->SetNearestOcclusionImmuneAncestor( | 389 surface->SetNearestOcclusionImmuneAncestor( |
| 390 surface->render_target()->nearest_occlusion_immune_ancestor()); | 390 surface->render_target()->nearest_occlusion_immune_ancestor()); |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 704 | 704 |
| 705 PropertyTrees* GetPropertyTrees(Layer* layer) { | 705 PropertyTrees* GetPropertyTrees(Layer* layer) { |
| 706 return layer->layer_tree_host()->property_trees(); | 706 return layer->layer_tree_host()->property_trees(); |
| 707 } | 707 } |
| 708 | 708 |
| 709 PropertyTrees* GetPropertyTrees(LayerImpl* layer) { | 709 PropertyTrees* GetPropertyTrees(LayerImpl* layer) { |
| 710 return layer->layer_tree_impl()->property_trees(); | 710 return layer->layer_tree_impl()->property_trees(); |
| 711 } | 711 } |
| 712 | 712 |
| 713 } // namespace cc | 713 } // namespace cc |
| OLD | NEW |