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

Side by Side Diff: cc/debug/picture_debug_util.cc

Issue 1866203004: Convert //cc from scoped_ptr to std::unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: scopedptrcc: rebase 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 | « cc/debug/micro_benchmark_impl.cc ('k') | cc/debug/rasterize_and_record_benchmark.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 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 "cc/debug/picture_debug_util.h" 5 #include "cc/debug/picture_debug_util.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <limits> 9 #include <limits>
10 #include <memory>
10 #include <vector> 11 #include <vector>
11 12
12 #include "base/base64.h" 13 #include "base/base64.h"
13 #include "base/logging.h" 14 #include "base/logging.h"
14 #include "base/memory/scoped_ptr.h"
15 #include "third_party/skia/include/core/SkBitmap.h" 15 #include "third_party/skia/include/core/SkBitmap.h"
16 #include "third_party/skia/include/core/SkData.h" 16 #include "third_party/skia/include/core/SkData.h"
17 #include "third_party/skia/include/core/SkImageInfo.h" 17 #include "third_party/skia/include/core/SkImageInfo.h"
18 #include "third_party/skia/include/core/SkPicture.h" 18 #include "third_party/skia/include/core/SkPicture.h"
19 #include "third_party/skia/include/core/SkPixelSerializer.h" 19 #include "third_party/skia/include/core/SkPixelSerializer.h"
20 #include "third_party/skia/include/core/SkStream.h" 20 #include "third_party/skia/include/core/SkStream.h"
21 #include "ui/gfx/codec/jpeg_codec.h" 21 #include "ui/gfx/codec/jpeg_codec.h"
22 #include "ui/gfx/codec/png_codec.h" 22 #include "ui/gfx/codec/png_codec.h"
23 23
24 namespace { 24 namespace {
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 64
65 namespace cc { 65 namespace cc {
66 66
67 void PictureDebugUtil::SerializeAsBase64(const SkPicture* picture, 67 void PictureDebugUtil::SerializeAsBase64(const SkPicture* picture,
68 std::string* output) { 68 std::string* output) {
69 SkDynamicMemoryWStream stream; 69 SkDynamicMemoryWStream stream;
70 BitmapSerializer serializer; 70 BitmapSerializer serializer;
71 picture->serialize(&stream, &serializer); 71 picture->serialize(&stream, &serializer);
72 72
73 size_t serialized_size = stream.bytesWritten(); 73 size_t serialized_size = stream.bytesWritten();
74 scoped_ptr<char[]> serialized_picture(new char[serialized_size]); 74 std::unique_ptr<char[]> serialized_picture(new char[serialized_size]);
75 stream.copyTo(serialized_picture.get()); 75 stream.copyTo(serialized_picture.get());
76 base::Base64Encode( 76 base::Base64Encode(
77 base::StringPiece(serialized_picture.get(), serialized_size), output); 77 base::StringPiece(serialized_picture.get(), serialized_size), output);
78 } 78 }
79 79
80 } // namespace cc 80 } // namespace cc
OLDNEW
« no previous file with comments | « cc/debug/micro_benchmark_impl.cc ('k') | cc/debug/rasterize_and_record_benchmark.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698