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 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 fImageIndex = NULL; | 225 fImageIndex = NULL; |
226 fImageWidth = 0; | 226 fImageWidth = 0; |
227 fImageHeight = 0; | 227 fImageHeight = 0; |
228 } | 228 } |
229 | 229 |
230 virtual ~SkJPEGImageDecoder() { | 230 virtual ~SkJPEGImageDecoder() { |
231 SkDELETE(fImageIndex); | 231 SkDELETE(fImageIndex); |
232 } | 232 } |
233 #endif | 233 #endif |
234 | 234 |
235 Format getFormat() const SK_OVERRIDE { | 235 Format getFormat() const override { |
236 return kJPEG_Format; | 236 return kJPEG_Format; |
237 } | 237 } |
238 | 238 |
239 protected: | 239 protected: |
240 #ifdef SK_BUILD_FOR_ANDROID | 240 #ifdef SK_BUILD_FOR_ANDROID |
241 bool onBuildTileIndex(SkStreamRewindable *stream, int *width, int *height) S
K_OVERRIDE; | 241 bool onBuildTileIndex(SkStreamRewindable *stream, int *width, int *height) o
verride; |
242 bool onDecodeSubset(SkBitmap* bitmap, const SkIRect& rect) SK_OVERRIDE; | 242 bool onDecodeSubset(SkBitmap* bitmap, const SkIRect& rect) override; |
243 #endif | 243 #endif |
244 Result onDecode(SkStream* stream, SkBitmap* bm, Mode) SK_OVERRIDE; | 244 Result onDecode(SkStream* stream, SkBitmap* bm, Mode) override; |
245 virtual bool onDecodeYUV8Planes(SkStream* stream, SkISize componentSizes[3], | 245 virtual bool onDecodeYUV8Planes(SkStream* stream, SkISize componentSizes[3], |
246 void* planes[3], size_t rowBytes[3], | 246 void* planes[3], size_t rowBytes[3], |
247 SkYUVColorSpace* colorSpace) SK_OVERRIDE; | 247 SkYUVColorSpace* colorSpace) override; |
248 | 248 |
249 private: | 249 private: |
250 #ifdef SK_BUILD_FOR_ANDROID | 250 #ifdef SK_BUILD_FOR_ANDROID |
251 SkJPEGImageIndex* fImageIndex; | 251 SkJPEGImageIndex* fImageIndex; |
252 int fImageWidth; | 252 int fImageWidth; |
253 int fImageHeight; | 253 int fImageHeight; |
254 #endif | 254 #endif |
255 | 255 |
256 /** | 256 /** |
257 * Determine the appropriate bitmap colortype and out_color_space based on | 257 * Determine the appropriate bitmap colortype and out_color_space based on |
(...skipping 1209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1467 return SkImageDecoder::kUnknown_Format; | 1467 return SkImageDecoder::kUnknown_Format; |
1468 } | 1468 } |
1469 | 1469 |
1470 static SkImageEncoder* sk_libjpeg_efactory(SkImageEncoder::Type t) { | 1470 static SkImageEncoder* sk_libjpeg_efactory(SkImageEncoder::Type t) { |
1471 return (SkImageEncoder::kJPEG_Type == t) ? SkNEW(SkJPEGImageEncoder) : NULL; | 1471 return (SkImageEncoder::kJPEG_Type == t) ? SkNEW(SkJPEGImageEncoder) : NULL; |
1472 } | 1472 } |
1473 | 1473 |
1474 static SkImageDecoder_DecodeReg gDReg(sk_libjpeg_dfactory); | 1474 static SkImageDecoder_DecodeReg gDReg(sk_libjpeg_dfactory); |
1475 static SkImageDecoder_FormatReg gFormatReg(get_format_jpeg); | 1475 static SkImageDecoder_FormatReg gFormatReg(get_format_jpeg); |
1476 static SkImageEncoder_EncodeReg gEReg(sk_libjpeg_efactory); | 1476 static SkImageEncoder_EncodeReg gEReg(sk_libjpeg_efactory); |
OLD | NEW |