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

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

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

Powered by Google App Engine
This is Rietveld 408576698