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

Side by Side Diff: dm/DM.cpp

Issue 849103004: Make SkStream *not* ref counted. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Treat SkFontMgr::createFromStream as taking ownership of the stream (is this correct?) Created 5 years, 11 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 // Main binary for DM. 1 // Main binary for DM.
2 // For a high-level overview, please see dm/README. 2 // For a high-level overview, please see dm/README.
3 3
4 #include "CrashHandler.h" 4 #include "CrashHandler.h"
5 #include "LazyDecodeBitmap.h" 5 #include "LazyDecodeBitmap.h"
6 #include "SkCommonFlags.h" 6 #include "SkCommonFlags.h"
7 #include "SkForceLinking.h" 7 #include "SkForceLinking.h"
8 #include "SkGraphics.h" 8 #include "SkGraphics.h"
9 #include "SkOSFile.h" 9 #include "SkOSFile.h"
10 #include "SkPicture.h" 10 #include "SkPicture.h"
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 files->push_back(SkOSPath::Join(dir, filename.c_str())); 144 files->push_back(SkOSPath::Join(dir, filename.c_str()));
145 } 145 }
146 } 146 }
147 } 147 }
148 } 148 }
149 149
150 static void kick_off_skps(const SkTArray<SkString>& skps, 150 static void kick_off_skps(const SkTArray<SkString>& skps,
151 DM::Reporter* reporter, 151 DM::Reporter* reporter,
152 DM::TaskRunner* tasks) { 152 DM::TaskRunner* tasks) {
153 for (int i = 0; i < skps.count(); ++i) { 153 for (int i = 0; i < skps.count(); ++i) {
154 SkAutoTUnref<SkStream> stream(SkStream::NewFromFile(skps[i].c_str())); 154 SkAutoTDelete<SkStream> stream(SkStream::NewFromFile(skps[i].c_str()));
155 if (stream.get() == NULL) { 155 if (stream.get() == NULL) {
156 SkDebugf("Could not read %s.\n", skps[i].c_str()); 156 SkDebugf("Could not read %s.\n", skps[i].c_str());
157 exit(1); 157 exit(1);
158 } 158 }
159 SkAutoTUnref<SkPicture> pic( 159 SkAutoTUnref<SkPicture> pic(
160 SkPicture::CreateFromStream(stream.get(), &sk_tools::LazyDecodeB itmap)); 160 SkPicture::CreateFromStream(stream.get(), &sk_tools::LazyDecodeB itmap));
161 if (pic.get() == NULL) { 161 if (pic.get() == NULL) {
162 SkDebugf("Could not read %s as an SkPicture.\n", skps[i].c_str()); 162 SkDebugf("Could not read %s as an SkPicture.\n", skps[i].c_str());
163 exit(1); 163 exit(1);
164 } 164 }
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
289 report_failures(failures); 289 report_failures(failures);
290 return failures.count() > 0; 290 return failures.count() > 0;
291 } 291 }
292 292
293 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) 293 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL)
294 int main(int argc, char** argv) { 294 int main(int argc, char** argv) {
295 SkCommandLineFlags::Parse(argc, argv); 295 SkCommandLineFlags::Parse(argc, argv);
296 return dm_main(); 296 return dm_main();
297 } 297 }
298 #endif 298 #endif
OLDNEW
« no previous file with comments | « bench/nanobench.cpp ('k') | dm/DMImageTask.cpp » ('j') | gm/gmmain.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698