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

Side by Side Diff: remoting/client/gl_desktop.cc

Issue 2253233004: 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 | « remoting/client/dual_buffer_frame_consumer.cc ('k') | remoting/client/gl_renderer_unittest.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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "remoting/client/gl_desktop.h" 5 #include "remoting/client/gl_desktop.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/ptr_util.h" 8 #include "base/memory/ptr_util.h"
9 #include "remoting/client/gl_canvas.h" 9 #include "remoting/client/gl_canvas.h"
10 #include "remoting/client/gl_math.h" 10 #include "remoting/client/gl_math.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 int texture_id = kGlDesktopFirstTextureId; 107 int texture_id = kGlDesktopFirstTextureId;
108 std::array<float, 8> positions; 108 std::array<float, 8> positions;
109 for (int x = 0; x < textures_per_row; x++) { 109 for (int x = 0; x < textures_per_row; x++) {
110 for (int y = 0; y < textures_per_column; y++) { 110 for (int y = 0; y < textures_per_column; y++) {
111 webrtc::DesktopRect rect = webrtc::DesktopRect::MakeXYWH( 111 webrtc::DesktopRect rect = webrtc::DesktopRect::MakeXYWH(
112 x * max_texture_size_, y * max_texture_size_, max_texture_size_, 112 x * max_texture_size_, y * max_texture_size_, max_texture_size_,
113 max_texture_size_); 113 max_texture_size_);
114 rect.IntersectWith(desktop_rect); 114 rect.IntersectWith(desktop_rect);
115 std::unique_ptr<GlDesktopTextureContainer> container = 115 std::unique_ptr<GlDesktopTextureContainer> container =
116 base::WrapUnique(new GlDesktopTextureContainer{ 116 base::WrapUnique(new GlDesktopTextureContainer{
117 base::WrapUnique(new GlRenderLayer(texture_id, canvas_)), rect}); 117 base::MakeUnique<GlRenderLayer>(texture_id, canvas_), rect});
118 FillRectangleVertexPositions(rect.left(), rect.top(), rect.width(), 118 FillRectangleVertexPositions(rect.left(), rect.top(), rect.width(),
119 rect.height(), &positions); 119 rect.height(), &positions);
120 container->layer->SetVertexPositions(positions); 120 container->layer->SetVertexPositions(positions);
121 textures_.push_back(std::move(container)); 121 textures_.push_back(std::move(container));
122 texture_id++; 122 texture_id++;
123 } 123 }
124 } 124 }
125 } 125 }
126 126
127 } // namespace remoting 127 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/client/dual_buffer_frame_consumer.cc ('k') | remoting/client/gl_renderer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698