| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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/layers/layer_impl.h" | 5 #include "cc/layers/layer_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 849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 860 | 860 |
| 861 size_t LayerImpl::GPUMemoryUsageInBytes() const { return 0; } | 861 size_t LayerImpl::GPUMemoryUsageInBytes() const { return 0; } |
| 862 | 862 |
| 863 void LayerImpl::RunMicroBenchmark(MicroBenchmarkImpl* benchmark) { | 863 void LayerImpl::RunMicroBenchmark(MicroBenchmarkImpl* benchmark) { |
| 864 benchmark->RunOnLayer(this); | 864 benchmark->RunOnLayer(this); |
| 865 } | 865 } |
| 866 | 866 |
| 867 gfx::Transform LayerImpl::DrawTransform() const { | 867 gfx::Transform LayerImpl::DrawTransform() const { |
| 868 // Only drawn layers have up-to-date draw properties. | 868 // Only drawn layers have up-to-date draw properties. |
| 869 if (!contributes_to_drawn_render_surface()) { | 869 if (!contributes_to_drawn_render_surface()) { |
| 870 if (GetPropertyTrees()->non_root_surfaces_enabled) { | |
| 871 return draw_property_utils::DrawTransform(this, GetTransformTree(), | 870 return draw_property_utils::DrawTransform(this, GetTransformTree(), |
| 872 GetEffectTree()); | 871 GetEffectTree()); |
| 873 } else { | |
| 874 return draw_property_utils::ScreenSpaceTransform(this, | |
| 875 GetTransformTree()); | |
| 876 } | |
| 877 } | 872 } |
| 878 | 873 |
| 879 return draw_properties().target_space_transform; | 874 return draw_properties().target_space_transform; |
| 880 } | 875 } |
| 881 | 876 |
| 882 gfx::Transform LayerImpl::ScreenSpaceTransform() const { | 877 gfx::Transform LayerImpl::ScreenSpaceTransform() const { |
| 883 // Only drawn layers have up-to-date draw properties. | 878 // Only drawn layers have up-to-date draw properties. |
| 884 if (!contributes_to_drawn_render_surface()) { | 879 if (!contributes_to_drawn_render_surface()) { |
| 885 return draw_property_utils::ScreenSpaceTransform(this, GetTransformTree()); | 880 return draw_property_utils::ScreenSpaceTransform(this, GetTransformTree()); |
| 886 } | 881 } |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 972 | 967 |
| 973 ScrollTree& LayerImpl::GetScrollTree() const { | 968 ScrollTree& LayerImpl::GetScrollTree() const { |
| 974 return GetPropertyTrees()->scroll_tree; | 969 return GetPropertyTrees()->scroll_tree; |
| 975 } | 970 } |
| 976 | 971 |
| 977 TransformTree& LayerImpl::GetTransformTree() const { | 972 TransformTree& LayerImpl::GetTransformTree() const { |
| 978 return GetPropertyTrees()->transform_tree; | 973 return GetPropertyTrees()->transform_tree; |
| 979 } | 974 } |
| 980 | 975 |
| 981 } // namespace cc | 976 } // namespace cc |
| OLD | NEW |