OLD | NEW |
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 Loading... |
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 |
OLD | NEW |