| 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 "SkAndroidCodec.h" | 8 #include "SkAndroidCodec.h" |
| 9 #include "SkCodec.h" | 9 #include "SkCodec.h" |
| 10 #include "SkCodecPriv.h" | 10 #include "SkCodecPriv.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 } | 27 } |
| 28 | 28 |
| 29 switch (codec->getEncodedFormat()) { | 29 switch (codec->getEncodedFormat()) { |
| 30 case kWEBP_SkEncodedFormat: | 30 case kWEBP_SkEncodedFormat: |
| 31 return new SkWebpAdapterCodec((SkWebpCodec*) codec.detach()); | 31 return new SkWebpAdapterCodec((SkWebpCodec*) codec.detach()); |
| 32 case kPNG_SkEncodedFormat: | 32 case kPNG_SkEncodedFormat: |
| 33 case kJPEG_SkEncodedFormat: | 33 case kJPEG_SkEncodedFormat: |
| 34 case kWBMP_SkEncodedFormat: | 34 case kWBMP_SkEncodedFormat: |
| 35 case kBMP_SkEncodedFormat: | 35 case kBMP_SkEncodedFormat: |
| 36 case kGIF_SkEncodedFormat: | 36 case kGIF_SkEncodedFormat: |
| 37 case kICO_SkEncodedFormat: |
| 37 return new SkSampledCodec(codec.detach()); | 38 return new SkSampledCodec(codec.detach()); |
| 38 default: | 39 default: |
| 39 // FIXME: SkSampledCodec is temporarily disabled for other formats | |
| 40 // while focusing on the formats that are supported by | |
| 41 // BitmapRegionDecoder. | |
| 42 return nullptr; | 40 return nullptr; |
| 43 } | 41 } |
| 44 } | 42 } |
| 45 | 43 |
| 46 SkAndroidCodec* SkAndroidCodec::NewFromData(SkData* data) { | 44 SkAndroidCodec* SkAndroidCodec::NewFromData(SkData* data) { |
| 47 if (!data) { | 45 if (!data) { |
| 48 return nullptr; | 46 return nullptr; |
| 49 } | 47 } |
| 50 | 48 |
| 51 return NewFromStream(new SkMemoryStream(data)); | 49 return NewFromStream(new SkMemoryStream(data)); |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 } | 121 } |
| 124 } | 122 } |
| 125 | 123 |
| 126 return this->onGetAndroidPixels(info, pixels, rowBytes, *options); | 124 return this->onGetAndroidPixels(info, pixels, rowBytes, *options); |
| 127 } | 125 } |
| 128 | 126 |
| 129 SkCodec::Result SkAndroidCodec::getAndroidPixels(const SkImageInfo& info, void*
pixels, | 127 SkCodec::Result SkAndroidCodec::getAndroidPixels(const SkImageInfo& info, void*
pixels, |
| 130 size_t rowBytes) { | 128 size_t rowBytes) { |
| 131 return this->getAndroidPixels(info, pixels, rowBytes, nullptr); | 129 return this->getAndroidPixels(info, pixels, rowBytes, nullptr); |
| 132 } | 130 } |
| OLD | NEW |