Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Side by Side Diff: cc/trees/layer_tree_impl.cc

Issue 2148383005: cc: Use sublayer scale from effect tree (2) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: s/sublayer_scale/surface_contents_scale Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/trees/layer_tree_host_impl_unittest.cc ('k') | cc/trees/property_tree.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 952 matching lines...) Expand 10 before | Expand all | Expand 10 after
963 gfx::Transform draw_transform; 963 gfx::Transform draw_transform;
964 if (occlusion_surface) { 964 if (occlusion_surface) {
965 // We are calculating transform between two render surfaces. So, we 965 // We are calculating transform between two render surfaces. So, we
966 // need to apply the sublayer scale at target and remove the sublayer 966 // need to apply the sublayer scale at target and remove the sublayer
967 // scale at source. 967 // scale at source.
968 property_trees()->transform_tree.ComputeTransform( 968 property_trees()->transform_tree.ComputeTransform(
969 it->render_surface()->TransformTreeIndex(), 969 it->render_surface()->TransformTreeIndex(),
970 occlusion_surface->TransformTreeIndex(), &draw_transform); 970 occlusion_surface->TransformTreeIndex(), &draw_transform);
971 // We don't have to apply sublayer scale when target is root. 971 // We don't have to apply sublayer scale when target is root.
972 if (occlusion_surface->TransformTreeIndex() != 0) { 972 if (occlusion_surface->TransformTreeIndex() != 0) {
973 draw_property_utils::PostConcatSublayerScale( 973 const EffectNode* occlusion_effect_node =
974 occlusion_surface->EffectTreeIndex(), 974 property_trees()->effect_tree.Node(
975 property_trees()->effect_tree, &draw_transform); 975 occlusion_surface->EffectTreeIndex());
976 draw_property_utils::PostConcatSublayerScale(occlusion_effect_node,
Ian Vollick 2016/07/16 01:07:51 If you're going to do a rename, should probably re
jaydasika 2016/07/16 02:23:15 Done.
977 &draw_transform);
976 } 978 }
977 draw_property_utils::ConcatInverseSublayerScale( 979 const EffectNode* effect_node = property_trees()->effect_tree.Node(
978 it->render_surface()->EffectTreeIndex(), 980 it->render_surface()->EffectTreeIndex());
979 property_trees()->effect_tree, &draw_transform); 981 draw_property_utils::ConcatInverseSublayerScale(effect_node,
982 &draw_transform);
980 } 983 }
981 984
982 Occlusion occlusion = 985 Occlusion occlusion =
983 occlusion_tracker.GetCurrentOcclusionForContributingSurface( 986 occlusion_tracker.GetCurrentOcclusionForContributingSurface(
984 draw_transform); 987 draw_transform);
985 it->render_surface()->set_occlusion_in_content_space(occlusion); 988 it->render_surface()->set_occlusion_in_content_space(occlusion);
986 // Masks are used to draw the contributing surface, so should have 989 // Masks are used to draw the contributing surface, so should have
987 // the same occlusion as the surface (nothing inside the surface 990 // the same occlusion as the surface (nothing inside the surface
988 // occludes them). 991 // occludes them).
989 if (LayerImpl* mask = it->render_surface()->MaskLayer()) { 992 if (LayerImpl* mask = it->render_surface()->MaskLayer()) {
(...skipping 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after
2012 2015
2013 void LayerTreeImpl::ResetAllChangeTracking() { 2016 void LayerTreeImpl::ResetAllChangeTracking() {
2014 layers_that_should_push_properties_.clear(); 2017 layers_that_should_push_properties_.clear();
2015 // Iterate over all layers, including masks and replicas. 2018 // Iterate over all layers, including masks and replicas.
2016 for (auto& layer : *layers_) 2019 for (auto& layer : *layers_)
2017 layer->ResetChangeTracking(); 2020 layer->ResetChangeTracking();
2018 property_trees_.ResetAllChangeTracking(); 2021 property_trees_.ResetAllChangeTracking();
2019 } 2022 }
2020 2023
2021 } // namespace cc 2024 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl_unittest.cc ('k') | cc/trees/property_tree.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698