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 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 draw_property_utils::ComputeSurfaceDrawProperties(property_trees, | 376 draw_property_utils::ComputeSurfaceDrawProperties(property_trees, |
377 surface); | 377 surface); |
378 | 378 |
379 // Ignore occlusion from outside the surface when surface contents need to | 379 // Ignore occlusion from outside the surface when surface contents need to |
380 // be fully drawn. Layers with copy-request need to be complete. We could | 380 // be fully drawn. Layers with copy-request need to be complete. We could |
381 // be smarter about layers with replica and exclude regions where both | 381 // be smarter about layers with replica and exclude regions where both |
382 // layer and the replica are occluded, but this seems like overkill. The | 382 // layer and the replica are occluded, but this seems like overkill. The |
383 // same is true for layers with filters that move pixels. | 383 // same is true for layers with filters that move pixels. |
384 // TODO(senorblanco): make this smarter for the SkImageFilter case (check | 384 // TODO(senorblanco): make this smarter for the SkImageFilter case (check |
385 // for pixel-moving filters) | 385 // for pixel-moving filters) |
386 bool is_occlusion_immune = surface->HasCopyRequest() || | 386 const FilterOperations& filters = surface->Filters(); |
387 surface->HasReplica() || | 387 bool is_occlusion_immune = |
388 layer->filters().HasReferenceFilter() || | 388 surface->HasCopyRequest() || surface->HasReplica() || |
389 layer->filters().HasFilterThatMovesPixels(); | 389 filters.HasReferenceFilter() || filters.HasFilterThatMovesPixels(); |
390 if (is_occlusion_immune) { | 390 if (is_occlusion_immune) { |
391 surface->SetNearestOcclusionImmuneAncestor(surface); | 391 surface->SetNearestOcclusionImmuneAncestor(surface); |
392 } else if (is_root) { | 392 } else if (is_root) { |
393 surface->SetNearestOcclusionImmuneAncestor(nullptr); | 393 surface->SetNearestOcclusionImmuneAncestor(nullptr); |
394 } else { | 394 } else { |
395 surface->SetNearestOcclusionImmuneAncestor( | 395 surface->SetNearestOcclusionImmuneAncestor( |
396 surface->render_target()->nearest_occlusion_immune_ancestor()); | 396 surface->render_target()->nearest_occlusion_immune_ancestor()); |
397 } | 397 } |
398 } | 398 } |
399 bool layer_should_be_drawn = draw_property_utils::LayerNeedsUpdate( | 399 bool layer_should_be_drawn = draw_property_utils::LayerNeedsUpdate( |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
692 | 692 |
693 PropertyTrees* GetPropertyTrees(Layer* layer) { | 693 PropertyTrees* GetPropertyTrees(Layer* layer) { |
694 return layer->layer_tree_host()->property_trees(); | 694 return layer->layer_tree_host()->property_trees(); |
695 } | 695 } |
696 | 696 |
697 PropertyTrees* GetPropertyTrees(LayerImpl* layer) { | 697 PropertyTrees* GetPropertyTrees(LayerImpl* layer) { |
698 return layer->layer_tree_impl()->property_trees(); | 698 return layer->layer_tree_impl()->property_trees(); |
699 } | 699 } |
700 | 700 |
701 } // namespace cc | 701 } // namespace cc |
OLD | NEW |