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

Side by Side Diff: remoting/host/chromeos/skia_bitmap_desktop_frame.cc

Issue 1549493004: Use std::move() instead of .Pass() in remoting/host (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_not_pass
Patch Set: include <utility> Created 5 years 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/host/chromeos/mouse_cursor_monitor_aura.cc ('k') | remoting/host/chromoting_host.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/host/chromeos/skia_bitmap_desktop_frame.h"
6
5 #include <stddef.h> 7 #include <stddef.h>
6 8
9 #include <utility>
10
7 #include "base/logging.h" 11 #include "base/logging.h"
8 #include "remoting/host/chromeos/skia_bitmap_desktop_frame.h"
9 12
10 namespace remoting { 13 namespace remoting {
11 14
12 // static 15 // static
13 SkiaBitmapDesktopFrame* SkiaBitmapDesktopFrame::Create( 16 SkiaBitmapDesktopFrame* SkiaBitmapDesktopFrame::Create(
14 scoped_ptr<SkBitmap> bitmap) { 17 scoped_ptr<SkBitmap> bitmap) {
15 18
16 webrtc::DesktopSize size(bitmap->width(), bitmap->height()); 19 webrtc::DesktopSize size(bitmap->width(), bitmap->height());
17 DCHECK_EQ(kBGRA_8888_SkColorType, bitmap->info().colorType()) 20 DCHECK_EQ(kBGRA_8888_SkColorType, bitmap->info().colorType())
18 << "DesktopFrame objects always hold RGBA data."; 21 << "DesktopFrame objects always hold RGBA data.";
19 22
20 bitmap->lockPixels(); 23 bitmap->lockPixels();
21 uint8_t* bitmap_data = reinterpret_cast<uint8_t*>(bitmap->getPixels()); 24 uint8_t* bitmap_data = reinterpret_cast<uint8_t*>(bitmap->getPixels());
22 bitmap->unlockPixels(); 25 bitmap->unlockPixels();
23 26
24 const size_t row_bytes = bitmap->rowBytes(); 27 const size_t row_bytes = bitmap->rowBytes();
25 SkiaBitmapDesktopFrame* result = new SkiaBitmapDesktopFrame( 28 SkiaBitmapDesktopFrame* result = new SkiaBitmapDesktopFrame(
26 size, row_bytes, bitmap_data, bitmap.Pass()); 29 size, row_bytes, bitmap_data, std::move(bitmap));
27 30
28 return result; 31 return result;
29 } 32 }
30 33
31 SkiaBitmapDesktopFrame::SkiaBitmapDesktopFrame(webrtc::DesktopSize size, 34 SkiaBitmapDesktopFrame::SkiaBitmapDesktopFrame(webrtc::DesktopSize size,
32 int stride, 35 int stride,
33 uint8_t* data, 36 uint8_t* data,
34 scoped_ptr<SkBitmap> bitmap) 37 scoped_ptr<SkBitmap> bitmap)
35 : DesktopFrame(size, stride, data, nullptr), bitmap_(bitmap.Pass()) { 38 : DesktopFrame(size, stride, data, nullptr), bitmap_(std::move(bitmap)) {}
36 }
37 39
38 SkiaBitmapDesktopFrame::~SkiaBitmapDesktopFrame() { 40 SkiaBitmapDesktopFrame::~SkiaBitmapDesktopFrame() {}
39 }
40 41
41 } // namespace remoting 42 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/host/chromeos/mouse_cursor_monitor_aura.cc ('k') | remoting/host/chromoting_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698