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

Side by Side Diff: content/browser/compositor/software_output_device_mus.cc

Issue 1874893002: Convert //content/browser from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "content/browser/compositor/software_output_device_mus.h" 5 #include "content/browser/compositor/software_output_device_mus.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "components/bitmap_uploader/bitmap_uploader.h" 10 #include "components/bitmap_uploader/bitmap_uploader.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 if (!addr) { 49 if (!addr) {
50 LOG(WARNING) << "SoftwareOutputDeviceMus: skia surface did not provide us " 50 LOG(WARNING) << "SoftwareOutputDeviceMus: skia surface did not provide us "
51 "with pixels"; 51 "with pixels";
52 return; 52 return;
53 } 53 }
54 54
55 const unsigned char* pixels = static_cast<const unsigned char*>(addr); 55 const unsigned char* pixels = static_cast<const unsigned char*>(addr);
56 56
57 // TODO(rjkroege): This makes an additional copy. Improve the 57 // TODO(rjkroege): This makes an additional copy. Improve the
58 // bitmap_uploader API to remove. 58 // bitmap_uploader API to remove.
59 scoped_ptr<std::vector<unsigned char>> data(new std::vector<unsigned char>( 59 std::unique_ptr<std::vector<unsigned char>> data(
60 pixels, pixels + rowBytes * viewport_pixel_size_.height())); 60 new std::vector<unsigned char>(
61 pixels, pixels + rowBytes * viewport_pixel_size_.height()));
61 uploader->SetBitmap(viewport_pixel_size_.width(), 62 uploader->SetBitmap(viewport_pixel_size_.width(),
62 viewport_pixel_size_.height(), std::move(data), 63 viewport_pixel_size_.height(), std::move(data),
63 bitmap_uploader::BitmapUploader::BGRA); 64 bitmap_uploader::BitmapUploader::BGRA);
64 } 65 }
65 66
66 } // namespace content 67 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698