OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2007 The Android Open Source Project | 2 * Copyright 2007 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 "SkImageEncoder.h" | 10 #include "SkImageEncoder.h" |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 fImageIndex = NULL; | 222 fImageIndex = NULL; |
223 fImageWidth = 0; | 223 fImageWidth = 0; |
224 fImageHeight = 0; | 224 fImageHeight = 0; |
225 } | 225 } |
226 | 226 |
227 virtual ~SkJPEGImageDecoder() { | 227 virtual ~SkJPEGImageDecoder() { |
228 SkDELETE(fImageIndex); | 228 SkDELETE(fImageIndex); |
229 } | 229 } |
230 #endif | 230 #endif |
231 | 231 |
232 virtual Format getFormat() const SK_OVERRIDE { | 232 Format getFormat() const SK_OVERRIDE { |
233 return kJPEG_Format; | 233 return kJPEG_Format; |
234 } | 234 } |
235 | 235 |
236 protected: | 236 protected: |
237 #ifdef SK_BUILD_FOR_ANDROID | 237 #ifdef SK_BUILD_FOR_ANDROID |
238 virtual bool onBuildTileIndex(SkStreamRewindable *stream, int *width, int *h
eight) SK_OVERRIDE; | 238 bool onBuildTileIndex(SkStreamRewindable *stream, int *width, int *height) S
K_OVERRIDE; |
239 virtual bool onDecodeSubset(SkBitmap* bitmap, const SkIRect& rect) SK_OVERRI
DE; | 239 bool onDecodeSubset(SkBitmap* bitmap, const SkIRect& rect) SK_OVERRIDE; |
240 #endif | 240 #endif |
241 virtual Result onDecode(SkStream* stream, SkBitmap* bm, Mode) SK_OVERRIDE; | 241 Result onDecode(SkStream* stream, SkBitmap* bm, Mode) SK_OVERRIDE; |
242 virtual bool onDecodeYUV8Planes(SkStream* stream, SkISize componentSizes[3], | 242 virtual bool onDecodeYUV8Planes(SkStream* stream, SkISize componentSizes[3], |
243 void* planes[3], size_t rowBytes[3], | 243 void* planes[3], size_t rowBytes[3], |
244 SkYUVColorSpace* colorSpace) SK_OVERRIDE; | 244 SkYUVColorSpace* colorSpace) SK_OVERRIDE; |
245 | 245 |
246 private: | 246 private: |
247 #ifdef SK_BUILD_FOR_ANDROID | 247 #ifdef SK_BUILD_FOR_ANDROID |
248 SkJPEGImageIndex* fImageIndex; | 248 SkJPEGImageIndex* fImageIndex; |
249 int fImageWidth; | 249 int fImageWidth; |
250 int fImageHeight; | 250 int fImageHeight; |
251 #endif | 251 #endif |
(...skipping 1187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1439 return SkImageDecoder::kUnknown_Format; | 1439 return SkImageDecoder::kUnknown_Format; |
1440 } | 1440 } |
1441 | 1441 |
1442 static SkImageEncoder* sk_libjpeg_efactory(SkImageEncoder::Type t) { | 1442 static SkImageEncoder* sk_libjpeg_efactory(SkImageEncoder::Type t) { |
1443 return (SkImageEncoder::kJPEG_Type == t) ? SkNEW(SkJPEGImageEncoder) : NULL; | 1443 return (SkImageEncoder::kJPEG_Type == t) ? SkNEW(SkJPEGImageEncoder) : NULL; |
1444 } | 1444 } |
1445 | 1445 |
1446 static SkImageDecoder_DecodeReg gDReg(sk_libjpeg_dfactory); | 1446 static SkImageDecoder_DecodeReg gDReg(sk_libjpeg_dfactory); |
1447 static SkImageDecoder_FormatReg gFormatReg(get_format_jpeg); | 1447 static SkImageDecoder_FormatReg gFormatReg(get_format_jpeg); |
1448 static SkImageEncoder_EncodeReg gEReg(sk_libjpeg_efactory); | 1448 static SkImageEncoder_EncodeReg gEReg(sk_libjpeg_efactory); |
OLD | NEW |