| 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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 Format getFormat() const 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) o
verride; | 241 bool onBuildTileIndex(SkStreamRewindable *stream, int *width, int *height) o
verride; |
| 242 bool onDecodeSubset(SkBitmap* bitmap, const SkIRect& rect) override; | 242 bool onDecodeSubset(SkBitmap* bitmap, const SkIRect& rect) override; |
| 243 #endif | 243 #endif |
| 244 Result onDecode(SkStream* stream, SkBitmap* bm, Mode) override; | 244 Result onDecode(SkStream* stream, SkBitmap* bm, Mode) override; |
| 245 virtual bool onDecodeYUV8Planes(SkStream* stream, SkISize componentSizes[3], | 245 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) 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 1208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1466 return SkImageDecoder::kUnknown_Format; | 1466 return SkImageDecoder::kUnknown_Format; |
| 1467 } | 1467 } |
| 1468 | 1468 |
| 1469 static SkImageEncoder* sk_libjpeg_efactory(SkImageEncoder::Type t) { | 1469 static SkImageEncoder* sk_libjpeg_efactory(SkImageEncoder::Type t) { |
| 1470 return (SkImageEncoder::kJPEG_Type == t) ? SkNEW(SkJPEGImageEncoder) : NULL; | 1470 return (SkImageEncoder::kJPEG_Type == t) ? SkNEW(SkJPEGImageEncoder) : NULL; |
| 1471 } | 1471 } |
| 1472 | 1472 |
| 1473 static SkImageDecoder_DecodeReg gDReg(sk_libjpeg_dfactory); | 1473 static SkImageDecoder_DecodeReg gDReg(sk_libjpeg_dfactory); |
| 1474 static SkImageDecoder_FormatReg gFormatReg(get_format_jpeg); | 1474 static SkImageDecoder_FormatReg gFormatReg(get_format_jpeg); |
| 1475 static SkImageEncoder_EncodeReg gEReg(sk_libjpeg_efactory); | 1475 static SkImageEncoder_EncodeReg gEReg(sk_libjpeg_efactory); |
| OLD | NEW |