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

Unified Diff: tools/SkBitmapRegionDecoderInterface.cpp

Issue 1332053002: Fill incomplete images in SkCodec parent class (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Use aligned memory in swizzler test 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 | « tools/SkBitmapRegionCanvas.cpp ('k') | tools/dm_flags.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/SkBitmapRegionDecoderInterface.cpp
diff --git a/tools/SkBitmapRegionDecoderInterface.cpp b/tools/SkBitmapRegionDecoderInterface.cpp
index 5c769d676e4377da9ee1f34e1aeb06d76c48c9f0..47de31f4ec01c045ab8dad11059b0f292de037e7 100644
--- a/tools/SkBitmapRegionDecoderInterface.cpp
+++ b/tools/SkBitmapRegionDecoderInterface.cpp
@@ -29,12 +29,12 @@ SkBitmapRegionDecoderInterface* SkBitmapRegionDecoderInterface::CreateBitmapRegi
return new SkBitmapRegionSampler(decoder, width, height);
}
case kCanvas_Strategy: {
- SkCodec* decoder = SkCodec::NewFromStream(stream);
- if (nullptr == decoder) {
+ SkAutoTDelete<SkCodec> codec(SkCodec::NewFromStream(stream));
+ if (nullptr == codec) {
SkDebugf("Error: Failed to create decoder.\n");
return nullptr;
}
- switch (decoder->getScanlineOrder()) {
+ switch (codec->getScanlineOrder()) {
case SkCodec::kTopDown_SkScanlineOrder:
case SkCodec::kNone_SkScanlineOrder:
break;
@@ -42,7 +42,7 @@ SkBitmapRegionDecoderInterface* SkBitmapRegionDecoderInterface::CreateBitmapRegi
SkDebugf("Error: Scanline ordering not supported.\n");
return nullptr;
}
- return new SkBitmapRegionCanvas(decoder);
+ return new SkBitmapRegionCanvas(codec.detach());
}
default:
SkASSERT(false);
« no previous file with comments | « tools/SkBitmapRegionCanvas.cpp ('k') | tools/dm_flags.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698