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() SK_OVERRIDE; | 40 SkData* onRefEncodedData() SK_OVERRIDE; |
| 41 #ifdef SK_SUPPORT_LEGACY_BOOL_ONGETINFO |
41 bool onGetInfo(SkImageInfo* info) SK_OVERRIDE { | 42 bool onGetInfo(SkImageInfo* info) SK_OVERRIDE { |
42 *info = fInfo; | 43 *info = fInfo; |
43 return true; | 44 return true; |
44 } | 45 } |
| 46 #endif |
45 virtual Result onGetPixels(const SkImageInfo& info, | 47 virtual Result onGetPixels(const SkImageInfo& info, |
46 void* pixels, size_t rowBytes, const Options&, | 48 void* pixels, size_t rowBytes, const Options&, |
47 SkPMColor ctable[], int* ctableCount) SK_OVERRIDE
; | 49 SkPMColor ctable[], int* ctableCount) SK_OVERRIDE
; |
48 virtual bool onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBy
tes[3], | 50 virtual bool onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBy
tes[3], |
49 SkYUVColorSpace* colorSpace) SK_OVERRIDE; | 51 SkYUVColorSpace* colorSpace) SK_OVERRIDE; |
50 | 52 |
51 private: | 53 private: |
52 typedef SkImageGenerator INHERITED; | 54 typedef SkImageGenerator INHERITED; |
53 }; | 55 }; |
54 | 56 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 #endif // SK_DEBUG | 111 #endif // SK_DEBUG |
110 | 112 |
111 //////////////////////////////////////////////////////////////////////////////// | 113 //////////////////////////////////////////////////////////////////////////////// |
112 | 114 |
113 DecodingImageGenerator::DecodingImageGenerator( | 115 DecodingImageGenerator::DecodingImageGenerator( |
114 SkData* data, | 116 SkData* data, |
115 SkStreamRewindable* stream, | 117 SkStreamRewindable* stream, |
116 const SkImageInfo& info, | 118 const SkImageInfo& info, |
117 int sampleSize, | 119 int sampleSize, |
118 bool ditherImage) | 120 bool ditherImage) |
119 : fData(data) | 121 : INHERITED(info) |
| 122 , fData(data) |
120 , fStream(stream) | 123 , fStream(stream) |
121 , fInfo(info) | 124 , fInfo(info) |
122 , fSampleSize(sampleSize) | 125 , fSampleSize(sampleSize) |
123 , fDitherImage(ditherImage) | 126 , fDitherImage(ditherImage) |
124 { | 127 { |
125 SkASSERT(stream != NULL); | 128 SkASSERT(stream != NULL); |
126 SkSafeRef(fData); // may be NULL. | 129 SkSafeRef(fData); // may be NULL. |
127 } | 130 } |
128 | 131 |
129 DecodingImageGenerator::~DecodingImageGenerator() { | 132 DecodingImageGenerator::~DecodingImageGenerator() { |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 | 294 |
292 SkImageGenerator* SkDecodingImageGenerator::Create( | 295 SkImageGenerator* SkDecodingImageGenerator::Create( |
293 SkStreamRewindable* stream, | 296 SkStreamRewindable* stream, |
294 const SkDecodingImageGenerator::Options& opts) { | 297 const SkDecodingImageGenerator::Options& opts) { |
295 SkASSERT(stream != NULL); | 298 SkASSERT(stream != NULL); |
296 if (stream == NULL) { | 299 if (stream == NULL) { |
297 return NULL; | 300 return NULL; |
298 } | 301 } |
299 return CreateDecodingImageGenerator(NULL, stream, opts); | 302 return CreateDecodingImageGenerator(NULL, stream, opts); |
300 } | 303 } |
OLD | NEW |