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 1057 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1068 | 1068 |
1069 void LayerImpl::RunMicroBenchmark(MicroBenchmarkImpl* benchmark) { | 1069 void LayerImpl::RunMicroBenchmark(MicroBenchmarkImpl* benchmark) { |
1070 benchmark->RunOnLayer(this); | 1070 benchmark->RunOnLayer(this); |
1071 } | 1071 } |
1072 | 1072 |
1073 void LayerImpl::SetHasRenderSurface(bool should_have_render_surface) { | 1073 void LayerImpl::SetHasRenderSurface(bool should_have_render_surface) { |
1074 if (!!render_surface() == should_have_render_surface) | 1074 if (!!render_surface() == should_have_render_surface) |
1075 return; | 1075 return; |
1076 | 1076 |
1077 if (should_have_render_surface) { | 1077 if (should_have_render_surface) { |
1078 render_surface_ = base::WrapUnique(new RenderSurfaceImpl(this)); | 1078 render_surface_ = base::MakeUnique<RenderSurfaceImpl>(this); |
1079 return; | 1079 return; |
1080 } | 1080 } |
1081 render_surface_.reset(); | 1081 render_surface_.reset(); |
1082 } | 1082 } |
1083 | 1083 |
1084 gfx::Transform LayerImpl::DrawTransform() const { | 1084 gfx::Transform LayerImpl::DrawTransform() const { |
1085 // Only drawn layers have up-to-date draw properties. | 1085 // Only drawn layers have up-to-date draw properties. |
1086 if (!is_drawn_render_surface_layer_list_member()) { | 1086 if (!is_drawn_render_surface_layer_list_member()) { |
1087 if (layer_tree_impl()->property_trees()->non_root_surfaces_enabled) { | 1087 if (layer_tree_impl()->property_trees()->non_root_surfaces_enabled) { |
1088 return draw_property_utils::DrawTransform( | 1088 return draw_property_utils::DrawTransform( |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1195 .layer_transforms_should_scale_layer_contents) { | 1195 .layer_transforms_should_scale_layer_contents) { |
1196 return default_scale; | 1196 return default_scale; |
1197 } | 1197 } |
1198 | 1198 |
1199 gfx::Vector2dF transform_scales = MathUtil::ComputeTransform2dScaleComponents( | 1199 gfx::Vector2dF transform_scales = MathUtil::ComputeTransform2dScaleComponents( |
1200 ScreenSpaceTransform(), default_scale); | 1200 ScreenSpaceTransform(), default_scale); |
1201 return std::max(transform_scales.x(), transform_scales.y()); | 1201 return std::max(transform_scales.x(), transform_scales.y()); |
1202 } | 1202 } |
1203 | 1203 |
1204 } // namespace cc | 1204 } // namespace cc |
OLD | NEW |