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_impl.h" | 5 #include "cc/trees/layer_tree_impl.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <algorithm> | 10 #include <algorithm> |
(...skipping 1012 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1023 } | 1023 } |
1024 | 1024 |
1025 if (it.represents_contributing_render_surface()) { | 1025 if (it.represents_contributing_render_surface()) { |
1026 const RenderSurfaceImpl* occlusion_surface = | 1026 const RenderSurfaceImpl* occlusion_surface = |
1027 occlusion_tracker.OcclusionSurfaceForContributingSurface(); | 1027 occlusion_tracker.OcclusionSurfaceForContributingSurface(); |
1028 gfx::Transform draw_transform; | 1028 gfx::Transform draw_transform; |
1029 if (occlusion_surface) { | 1029 if (occlusion_surface) { |
1030 // We are calculating transform between two render surfaces. So, we | 1030 // We are calculating transform between two render surfaces. So, we |
1031 // need to apply the surface contents scale at target and remove the | 1031 // need to apply the surface contents scale at target and remove the |
1032 // surface contents scale at source. | 1032 // surface contents scale at source. |
1033 property_trees()->ComputeTransformToTarget( | 1033 property_trees()->GetToTarget( |
1034 it->render_surface()->TransformTreeIndex(), | 1034 it->render_surface()->TransformTreeIndex(), |
1035 occlusion_surface->EffectTreeIndex(), &draw_transform); | 1035 occlusion_surface->EffectTreeIndex(), &draw_transform); |
1036 const EffectNode* occlusion_effect_node = | |
1037 property_trees()->effect_tree.Node( | |
1038 occlusion_surface->EffectTreeIndex()); | |
1039 draw_property_utils::PostConcatSurfaceContentsScale( | |
1040 occlusion_effect_node, &draw_transform); | |
1041 const EffectNode* effect_node = property_trees()->effect_tree.Node( | 1036 const EffectNode* effect_node = property_trees()->effect_tree.Node( |
1042 it->render_surface()->EffectTreeIndex()); | 1037 it->render_surface()->EffectTreeIndex()); |
1043 draw_property_utils::ConcatInverseSurfaceContentsScale( | 1038 draw_property_utils::ConcatInverseSurfaceContentsScale( |
1044 effect_node, &draw_transform); | 1039 effect_node, &draw_transform); |
1045 } | 1040 } |
1046 | 1041 |
1047 Occlusion occlusion = | 1042 Occlusion occlusion = |
1048 occlusion_tracker.GetCurrentOcclusionForContributingSurface( | 1043 occlusion_tracker.GetCurrentOcclusionForContributingSurface( |
1049 draw_transform); | 1044 draw_transform); |
1050 it->render_surface()->set_occlusion_in_content_space(occlusion); | 1045 it->render_surface()->set_occlusion_in_content_space(occlusion); |
(...skipping 1021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2072 | 2067 |
2073 void LayerTreeImpl::ResetAllChangeTracking() { | 2068 void LayerTreeImpl::ResetAllChangeTracking() { |
2074 layers_that_should_push_properties_.clear(); | 2069 layers_that_should_push_properties_.clear(); |
2075 // Iterate over all layers, including masks. | 2070 // Iterate over all layers, including masks. |
2076 for (auto& layer : *layers_) | 2071 for (auto& layer : *layers_) |
2077 layer->ResetChangeTracking(); | 2072 layer->ResetChangeTracking(); |
2078 property_trees_.ResetAllChangeTracking(); | 2073 property_trees_.ResetAllChangeTracking(); |
2079 } | 2074 } |
2080 | 2075 |
2081 } // namespace cc | 2076 } // namespace cc |
OLD | NEW |