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

Unified Diff: tools/bench_pictures_main.cpp

Issue 17113004: Replace SkPicture(SkStream) constructors with a factory. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Remove a change in behavior Created 7 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/PictureTest.cpp ('k') | tools/filtermain.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/bench_pictures_main.cpp
diff --git a/tools/bench_pictures_main.cpp b/tools/bench_pictures_main.cpp
index 46d97de742b2845affaa932974298edca3c20539..720621ec9a05ff870b466e152173267b1543d089 100644
--- a/tools/bench_pictures_main.cpp
+++ b/tools/bench_pictures_main.cpp
@@ -173,16 +173,15 @@ static bool run_single_benchmark(const SkString& inputPath,
gLruImageCache.setImageCacheLimit(0);
}
- bool success = false;
- SkPicture* picture;
+ SkPicture::InstallPixelRefProc proc;
if (FLAGS_deferImageDecoding) {
- picture = SkNEW_ARGS(SkPicture, (&inputStream, &success, &lazy_decode_bitmap));
+ proc = &lazy_decode_bitmap;
} else {
- picture = SkNEW_ARGS(SkPicture, (&inputStream, &success, &SkImageDecoder::DecodeMemory));
+ proc = &SkImageDecoder::DecodeMemory;
}
- SkAutoTDelete<SkPicture> ad(picture);
+ SkAutoTUnref<SkPicture> picture(SkPicture::CreateFromStream(&inputStream, proc));
- if (!success) {
+ if (NULL == picture.get()) {
SkString err;
err.printf("Could not read an SkPicture from %s\n", inputPath.c_str());
gLogger.logError(err);
« no previous file with comments | « tests/PictureTest.cpp ('k') | tools/filtermain.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698