| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
| 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 | 8 |
| 9 #include "SkImageDecoder.h" | 9 #include "SkImageDecoder.h" |
| 10 #include "SkBitmap.h" | 10 #include "SkBitmap.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 case kWBMP_Format: | 76 case kWBMP_Format: |
| 77 return "WBMP"; | 77 return "WBMP"; |
| 78 case kWEBP_Format: | 78 case kWEBP_Format: |
| 79 return "WEBP"; | 79 return "WEBP"; |
| 80 default: | 80 default: |
| 81 SkDEBUGFAIL("Invalid format type!"); | 81 SkDEBUGFAIL("Invalid format type!"); |
| 82 } | 82 } |
| 83 return "Unknown Format"; | 83 return "Unknown Format"; |
| 84 } | 84 } |
| 85 | 85 |
| 86 SkImageDecoder::Peeker* SkImageDecoder::setPeeker(Peeker* peeker) { | 86 SkPngChunkReader* SkImageDecoder::setPeeker(SkPngChunkReader* peeker) { |
| 87 SkRefCnt_SafeAssign(fPeeker, peeker); | 87 SkRefCnt_SafeAssign(fPeeker, peeker); |
| 88 return peeker; | 88 return peeker; |
| 89 } | 89 } |
| 90 | 90 |
| 91 SkBitmap::Allocator* SkImageDecoder::setAllocator(SkBitmap::Allocator* alloc) { | 91 SkBitmap::Allocator* SkImageDecoder::setAllocator(SkBitmap::Allocator* alloc) { |
| 92 SkRefCnt_SafeAssign(fAllocator, alloc); | 92 SkRefCnt_SafeAssign(fAllocator, alloc); |
| 93 return alloc; | 93 return alloc; |
| 94 } | 94 } |
| 95 | 95 |
| 96 void SkImageDecoder::setSampleSize(int size) { | 96 void SkImageDecoder::setSampleSize(int size) { |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 return success; | 195 return success; |
| 196 } | 196 } |
| 197 | 197 |
| 198 bool SkImageDecoder::decodeYUV8Planes(SkStream* stream, SkISize componentSizes[3
], void* planes[3], | 198 bool SkImageDecoder::decodeYUV8Planes(SkStream* stream, SkISize componentSizes[3
], void* planes[3], |
| 199 size_t rowBytes[3], SkYUVColorSpace* color
Space) { | 199 size_t rowBytes[3], SkYUVColorSpace* color
Space) { |
| 200 // we reset this to false before calling onDecodeYUV8Planes | 200 // we reset this to false before calling onDecodeYUV8Planes |
| 201 fShouldCancelDecode = false; | 201 fShouldCancelDecode = false; |
| 202 | 202 |
| 203 return this->onDecodeYUV8Planes(stream, componentSizes, planes, rowBytes, co
lorSpace); | 203 return this->onDecodeYUV8Planes(stream, componentSizes, planes, rowBytes, co
lorSpace); |
| 204 } | 204 } |
| OLD | NEW |