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

Unified Diff: bench/nanobench.cpp

Issue 1418093006: Refactor SkBitmapRegionDecoderInterface for Android (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Better comments Created 5 years, 2 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 | « bench/BitmapRegionDecoderBench.cpp ('k') | dm/DMSrcSink.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bench/nanobench.cpp
diff --git a/bench/nanobench.cpp b/bench/nanobench.cpp
index 054fbb27b1a795b3f22d2c03afc8a9d6e9d14cf1..de4545f2fa529e43b70a2490531c02554500b51d 100644
--- a/bench/nanobench.cpp
+++ b/bench/nanobench.cpp
@@ -603,9 +603,12 @@ static bool valid_brd_bench(SkData* encoded, SkBitmapRegionDecoderInterface::Str
return false;
}
- SkAutoTDelete<SkBitmap> bitmap(brd->decodeRegion(0, 0, brd->width(), brd->height(), 1,
- colorType));
- if (nullptr == bitmap.get() || colorType != bitmap->colorType()) {
+ SkBitmap bitmap;
+ if (!brd->decodeRegion(&bitmap, nullptr, SkIRect::MakeXYWH(0, 0, brd->width(), brd->height()),
+ 1, colorType, false)) {
+ return false;
+ }
+ if (colorType != bitmap.colorType()) {
// This indicates that conversion to the requested color type is not supported for the
// particular image.
return false;
« no previous file with comments | « bench/BitmapRegionDecoderBench.cpp ('k') | dm/DMSrcSink.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698