| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "SkData.h" | 8 #include "SkData.h" |
| 9 #include "SkDecodingImageGenerator.h" | 9 #include "SkDecodingImageGenerator.h" |
| 10 #include "SkImageDecoder.h" | 10 #include "SkImageDecoder.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 const bool fDitherImage; | 31 const bool fDitherImage; |
| 32 | 32 |
| 33 DecodingImageGenerator(SkData* data, | 33 DecodingImageGenerator(SkData* data, |
| 34 SkStreamRewindable* stream, | 34 SkStreamRewindable* stream, |
| 35 const SkImageInfo& info, | 35 const SkImageInfo& info, |
| 36 int sampleSize, | 36 int sampleSize, |
| 37 bool ditherImage); | 37 bool ditherImage); |
| 38 | 38 |
| 39 protected: | 39 protected: |
| 40 SkData* onRefEncodedData() override; | 40 SkData* onRefEncodedData() override; |
| 41 #ifdef SK_SUPPORT_LEGACY_BOOL_ONGETINFO | |
| 42 bool onGetInfo(SkImageInfo* info) override { | |
| 43 *info = fInfo; | |
| 44 return true; | |
| 45 } | |
| 46 #endif | |
| 47 Result onGetPixels(const SkImageInfo& info, | 41 Result onGetPixels(const SkImageInfo& info, |
| 48 void* pixels, size_t rowBytes, const Options&, | 42 void* pixels, size_t rowBytes, const Options&, |
| 49 SkPMColor ctable[], int* ctableCount) override; | 43 SkPMColor ctable[], int* ctableCount) override; |
| 50 bool onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBytes[3], | 44 bool onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBytes[3], |
| 51 SkYUVColorSpace* colorSpace) override; | 45 SkYUVColorSpace* colorSpace) override; |
| 52 | 46 |
| 53 private: | 47 private: |
| 54 typedef SkImageGenerator INHERITED; | 48 typedef SkImageGenerator INHERITED; |
| 55 }; | 49 }; |
| 56 | 50 |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 | 288 |
| 295 SkImageGenerator* SkDecodingImageGenerator::Create( | 289 SkImageGenerator* SkDecodingImageGenerator::Create( |
| 296 SkStreamRewindable* stream, | 290 SkStreamRewindable* stream, |
| 297 const SkDecodingImageGenerator::Options& opts) { | 291 const SkDecodingImageGenerator::Options& opts) { |
| 298 SkASSERT(stream != NULL); | 292 SkASSERT(stream != NULL); |
| 299 if (stream == NULL) { | 293 if (stream == NULL) { |
| 300 return NULL; | 294 return NULL; |
| 301 } | 295 } |
| 302 return CreateDecodingImageGenerator(NULL, stream, opts); | 296 return CreateDecodingImageGenerator(NULL, stream, opts); |
| 303 } | 297 } |
| OLD | NEW |