| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkBitmapRegionCodec.h" | 8 #include "SkBitmapRegionCodec.h" |
| 9 #include "SkBitmapRegionDecoder.h" | 9 #include "SkBitmapRegionDecoder.h" |
| 10 #include "SkAndroidCodec.h" | 10 #include "SkAndroidCodec.h" |
| 11 #include "SkCodec.h" | 11 #include "SkCodec.h" |
| 12 #include "SkCodecPriv.h" | 12 #include "SkCodecPriv.h" |
| 13 | 13 |
| 14 SkBitmapRegionDecoder* SkBitmapRegionDecoder::Create( | 14 SkBitmapRegionDecoder* SkBitmapRegionDecoder::Create( |
| 15 SkData* data, Strategy strategy) { | 15 sk_sp<SkData> data, Strategy strategy) { |
| 16 return SkBitmapRegionDecoder::Create(new SkMemoryStream(data), | 16 return SkBitmapRegionDecoder::Create(new SkMemoryStream(data), |
| 17 strategy); | 17 strategy); |
| 18 } | 18 } |
| 19 | 19 |
| 20 SkBitmapRegionDecoder* SkBitmapRegionDecoder::Create( | 20 SkBitmapRegionDecoder* SkBitmapRegionDecoder::Create( |
| 21 SkStreamRewindable* stream, Strategy strategy) { | 21 SkStreamRewindable* stream, Strategy strategy) { |
| 22 SkAutoTDelete<SkStreamRewindable> streamDeleter(stream); | 22 SkAutoTDelete<SkStreamRewindable> streamDeleter(stream); |
| 23 switch (strategy) { | 23 switch (strategy) { |
| 24 case kAndroidCodec_Strategy: { | 24 case kAndroidCodec_Strategy: { |
| 25 SkAutoTDelete<SkAndroidCodec> codec = | 25 SkAutoTDelete<SkAndroidCodec> codec = |
| (...skipping 13 matching lines...) Expand all Loading... |
| 39 return nullptr; | 39 return nullptr; |
| 40 } | 40 } |
| 41 | 41 |
| 42 return new SkBitmapRegionCodec(codec.release()); | 42 return new SkBitmapRegionCodec(codec.release()); |
| 43 } | 43 } |
| 44 default: | 44 default: |
| 45 SkASSERT(false); | 45 SkASSERT(false); |
| 46 return nullptr; | 46 return nullptr; |
| 47 } | 47 } |
| 48 } | 48 } |
| OLD | NEW |