| 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 19 matching lines...) Expand all Loading... |
| 30 const int fSampleSize; | 30 const int fSampleSize; |
| 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 virtual SkData* onRefEncodedData() SK_OVERRIDE; | 40 SkData* onRefEncodedData() SK_OVERRIDE; |
| 41 virtual bool onGetInfo(SkImageInfo* info) SK_OVERRIDE { | 41 bool onGetInfo(SkImageInfo* info) SK_OVERRIDE { |
| 42 *info = fInfo; | 42 *info = fInfo; |
| 43 return true; | 43 return true; |
| 44 } | 44 } |
| 45 virtual bool onGetPixels(const SkImageInfo& info, | 45 virtual bool onGetPixels(const SkImageInfo& info, |
| 46 void* pixels, size_t rowBytes, | 46 void* pixels, size_t rowBytes, |
| 47 SkPMColor ctable[], int* ctableCount) SK_OVERRIDE; | 47 SkPMColor ctable[], int* ctableCount) SK_OVERRIDE; |
| 48 virtual bool onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBy
tes[3], | 48 virtual bool onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBy
tes[3], |
| 49 SkYUVColorSpace* colorSpace) SK_OVERRIDE; | 49 SkYUVColorSpace* colorSpace) SK_OVERRIDE; |
| 50 | 50 |
| 51 private: | 51 private: |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 SkStreamRewindable* stream, | 288 SkStreamRewindable* stream, |
| 289 const SkDecodingImageGenerator::Options& opts) { | 289 const SkDecodingImageGenerator::Options& opts) { |
| 290 SkASSERT(stream != NULL); | 290 SkASSERT(stream != NULL); |
| 291 SkASSERT(stream->unique()); | 291 SkASSERT(stream->unique()); |
| 292 if ((stream == NULL) || !stream->unique()) { | 292 if ((stream == NULL) || !stream->unique()) { |
| 293 SkSafeUnref(stream); | 293 SkSafeUnref(stream); |
| 294 return NULL; | 294 return NULL; |
| 295 } | 295 } |
| 296 return CreateDecodingImageGenerator(NULL, stream, opts); | 296 return CreateDecodingImageGenerator(NULL, stream, opts); |
| 297 } | 297 } |
| OLD | NEW |