Chromium Code Reviews| 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)); |
|
scroggo
2015/10/08 13:50:30
nit: This change seems unrelated to the rest of th
msarett
2015/10/08 15:33:26
Sorry about that. I think maybe this change used
|
| + 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); |