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

Side by Side Diff: cc/layers/layer_impl.cc

Issue 2258833002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 4 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/debug/micro_benchmark_controller_unittest.cc ('k') | cc/layers/texture_layer.cc » ('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 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
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
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
OLDNEW
« no previous file with comments | « cc/debug/micro_benchmark_controller_unittest.cc ('k') | cc/layers/texture_layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698