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

Side by Side Diff: tools/get_images_from_skps.cpp

Issue 1811703002: return pictures as sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rely on RVO in picturerecorder Created 4 years, 9 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 | « tools/dump_record.cpp ('k') | tools/gpuveto.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 Google Inc. 2 * Copyright 2016 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkCodec.h" 8 #include "SkCodec.h"
9 #include "SkCommandLineFlags.h" 9 #include "SkCommandLineFlags.h"
10 #include "SkData.h" 10 #include "SkData.h"
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 83
84 if (!sk_isdir(inputs) || !sk_isdir(gOutputDir)) { 84 if (!sk_isdir(inputs) || !sk_isdir(gOutputDir)) {
85 SkCommandLineFlags::PrintUsage(); 85 SkCommandLineFlags::PrintUsage();
86 return 1; 86 return 1;
87 } 87 }
88 88
89 SkOSFile::Iter iter(inputs, "skp"); 89 SkOSFile::Iter iter(inputs, "skp");
90 for (SkString file; iter.next(&file); ) { 90 for (SkString file; iter.next(&file); ) {
91 SkAutoTDelete<SkStream> stream = 91 SkAutoTDelete<SkStream> stream =
92 SkStream::NewFromFile(SkOSPath::Join(inputs, file.c_str()).c_str ()); 92 SkStream::NewFromFile(SkOSPath::Join(inputs, file.c_str()).c_str ());
93 SkAutoTUnref<SkPicture> picture(SkPicture::CreateFromStream(stream)); 93 sk_sp<SkPicture> picture(SkPicture::MakeFromStream(stream));
94 94
95 SkDynamicMemoryWStream scratch; 95 SkDynamicMemoryWStream scratch;
96 Sniffer sniff; 96 Sniffer sniff;
97 picture->serialize(&scratch, &sniff); 97 picture->serialize(&scratch, &sniff);
98 } 98 }
99 SkDebugf("%d known, %d unknown\n", gKnown, gUnknown); 99 SkDebugf("%d known, %d unknown\n", gKnown, gUnknown);
100 100
101 return 0; 101 return 0;
102 } 102 }
OLDNEW
« no previous file with comments | « tools/dump_record.cpp ('k') | tools/gpuveto.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698