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 1015 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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()->ComputeTransformToTarget( |
1034 it->render_surface()->TransformTreeIndex(), | 1034 it->render_surface()->TransformTreeIndex(), |
1035 occlusion_surface->EffectTreeIndex(), &draw_transform); | 1035 occlusion_surface->EffectTreeIndex(), &draw_transform); |
1036 // We don't have to apply surface contents scale when target is root. | 1036 const EffectNode* occlusion_effect_node = |
1037 if (occlusion_surface->EffectTreeIndex() != | 1037 property_trees()->effect_tree.Node( |
1038 EffectTree::kContentsRootNodeId) { | 1038 occlusion_surface->EffectTreeIndex()); |
1039 const EffectNode* occlusion_effect_node = | 1039 draw_property_utils::PostConcatSurfaceContentsScale( |
1040 property_trees()->effect_tree.Node( | 1040 occlusion_effect_node, &draw_transform); |
1041 occlusion_surface->EffectTreeIndex()); | |
1042 draw_property_utils::PostConcatSurfaceContentsScale( | |
1043 occlusion_effect_node, &draw_transform); | |
1044 } | |
1045 const EffectNode* effect_node = property_trees()->effect_tree.Node( | 1041 const EffectNode* effect_node = property_trees()->effect_tree.Node( |
1046 it->render_surface()->EffectTreeIndex()); | 1042 it->render_surface()->EffectTreeIndex()); |
1047 draw_property_utils::ConcatInverseSurfaceContentsScale( | 1043 draw_property_utils::ConcatInverseSurfaceContentsScale( |
1048 effect_node, &draw_transform); | 1044 effect_node, &draw_transform); |
1049 } | 1045 } |
1050 | 1046 |
1051 Occlusion occlusion = | 1047 Occlusion occlusion = |
1052 occlusion_tracker.GetCurrentOcclusionForContributingSurface( | 1048 occlusion_tracker.GetCurrentOcclusionForContributingSurface( |
1053 draw_transform); | 1049 draw_transform); |
1054 it->render_surface()->set_occlusion_in_content_space(occlusion); | 1050 it->render_surface()->set_occlusion_in_content_space(occlusion); |
(...skipping 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2077 | 2073 |
2078 void LayerTreeImpl::ResetAllChangeTracking() { | 2074 void LayerTreeImpl::ResetAllChangeTracking() { |
2079 layers_that_should_push_properties_.clear(); | 2075 layers_that_should_push_properties_.clear(); |
2080 // Iterate over all layers, including masks. | 2076 // Iterate over all layers, including masks. |
2081 for (auto& layer : *layers_) | 2077 for (auto& layer : *layers_) |
2082 layer->ResetChangeTracking(); | 2078 layer->ResetChangeTracking(); |
2083 property_trees_.ResetAllChangeTracking(); | 2079 property_trees_.ResetAllChangeTracking(); |
2084 } | 2080 } |
2085 | 2081 |
2086 } // namespace cc | 2082 } // namespace cc |
OLD | NEW |