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 940 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
951 Occlusion occlusion = | 951 Occlusion occlusion = |
952 inside_replica ? Occlusion() | 952 inside_replica ? Occlusion() |
953 : occlusion_tracker.GetCurrentOcclusionForLayer( | 953 : occlusion_tracker.GetCurrentOcclusionForLayer( |
954 it->DrawTransform()); | 954 it->DrawTransform()); |
955 it->draw_properties().occlusion_in_content_space = occlusion; | 955 it->draw_properties().occlusion_in_content_space = occlusion; |
956 } | 956 } |
957 | 957 |
958 if (it.represents_contributing_render_surface()) { | 958 if (it.represents_contributing_render_surface()) { |
959 // Surfaces aren't used by the tile raster code, so they can have | 959 // Surfaces aren't used by the tile raster code, so they can have |
960 // occlusion regardless of replicas. | 960 // occlusion regardless of replicas. |
961 const RenderSurfaceImpl* occlusion_surface = | |
962 occlusion_tracker.OcclusionSurfaceForContributingSurface(); | |
963 gfx::Transform draw_transform; | |
964 if (occlusion_surface) { | |
965 // We are calculating transform between two render surfaces. So, we | |
enne (OOO)
2016/07/14 19:51:41
I think Apply and Remove look too similar but do v
jaydasika
2016/07/14 21:00:46
I have renamed them to PostConcatSublayerScale and
| |
966 // need to apply the sublayer scale at target and remove the sublayer | |
967 // scale at source. | |
968 property_trees()->transform_tree.ComputeTransform( | |
969 it->render_surface()->TransformTreeIndex(), | |
970 occlusion_surface->TransformTreeIndex(), &draw_transform); | |
971 // We don't have to apply sublayer scale when target is root. | |
972 if (occlusion_surface->TransformTreeIndex() != 0) | |
973 draw_property_utils::ApplySublayerScale( | |
974 occlusion_surface->EffectTreeIndex(), | |
975 property_trees()->effect_tree, &draw_transform); | |
976 draw_property_utils::RemoveSublayerScale( | |
977 it->render_surface()->EffectTreeIndex(), | |
978 property_trees()->effect_tree, &draw_transform); | |
979 } | |
980 | |
961 Occlusion occlusion = | 981 Occlusion occlusion = |
962 occlusion_tracker.GetCurrentOcclusionForContributingSurface( | 982 occlusion_tracker.GetCurrentOcclusionForContributingSurface( |
963 it->render_surface()->draw_transform()); | 983 draw_transform); |
964 it->render_surface()->set_occlusion_in_content_space(occlusion); | 984 it->render_surface()->set_occlusion_in_content_space(occlusion); |
965 // Masks are used to draw the contributing surface, so should have | 985 // Masks are used to draw the contributing surface, so should have |
966 // the same occlusion as the surface (nothing inside the surface | 986 // the same occlusion as the surface (nothing inside the surface |
967 // occludes them). | 987 // occludes them). |
968 if (LayerImpl* mask = it->render_surface()->MaskLayer()) { | 988 if (LayerImpl* mask = it->render_surface()->MaskLayer()) { |
969 Occlusion mask_occlusion = | 989 Occlusion mask_occlusion = |
970 inside_replica | 990 inside_replica |
971 ? Occlusion() | 991 ? Occlusion() |
972 : occlusion_tracker.GetCurrentOcclusionForContributingSurface( | 992 : occlusion_tracker.GetCurrentOcclusionForContributingSurface( |
973 it->render_surface()->draw_transform() * | 993 it->render_surface()->draw_transform() * |
(...skipping 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1992 | 2012 |
1993 void LayerTreeImpl::ResetAllChangeTracking() { | 2013 void LayerTreeImpl::ResetAllChangeTracking() { |
1994 layers_that_should_push_properties_.clear(); | 2014 layers_that_should_push_properties_.clear(); |
1995 // Iterate over all layers, including masks and replicas. | 2015 // Iterate over all layers, including masks and replicas. |
1996 for (auto& layer : *layers_) | 2016 for (auto& layer : *layers_) |
1997 layer->ResetChangeTracking(); | 2017 layer->ResetChangeTracking(); |
1998 property_trees_.ResetAllChangeTracking(); | 2018 property_trees_.ResetAllChangeTracking(); |
1999 } | 2019 } |
2000 | 2020 |
2001 } // namespace cc | 2021 } // namespace cc |
OLD | NEW |