| 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 SkData* onRefEncodedData() SK_OVERRIDE; | 40 SkData* onRefEncodedData() override; |
| 41 #ifdef SK_SUPPORT_LEGACY_BOOL_ONGETINFO | 41 #ifdef SK_SUPPORT_LEGACY_BOOL_ONGETINFO |
| 42 bool onGetInfo(SkImageInfo* info) SK_OVERRIDE { | 42 bool onGetInfo(SkImageInfo* info) override { |
| 43 *info = fInfo; | 43 *info = fInfo; |
| 44 return true; | 44 return true; |
| 45 } | 45 } |
| 46 #endif | 46 #endif |
| 47 virtual Result onGetPixels(const SkImageInfo& info, | 47 virtual Result onGetPixels(const SkImageInfo& info, |
| 48 void* pixels, size_t rowBytes, const Options&, | 48 void* pixels, size_t rowBytes, const Options&, |
| 49 SkPMColor ctable[], int* ctableCount) SK_OVERRIDE
; | 49 SkPMColor ctable[], int* ctableCount) override; |
| 50 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], |
| 51 SkYUVColorSpace* colorSpace) SK_OVERRIDE; | 51 SkYUVColorSpace* colorSpace) override; |
| 52 | 52 |
| 53 private: | 53 private: |
| 54 typedef SkImageGenerator INHERITED; | 54 typedef SkImageGenerator INHERITED; |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 /** | 57 /** |
| 58 * Special allocator used by getPixels(). Uses preallocated memory | 58 * Special allocator used by getPixels(). Uses preallocated memory |
| 59 * provided if possible, else fall-back on the default allocator | 59 * provided if possible, else fall-back on the default allocator |
| 60 */ | 60 */ |
| 61 class TargetAllocator : public SkBitmap::Allocator { | 61 class TargetAllocator : public SkBitmap::Allocator { |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 | 294 |
| 295 SkImageGenerator* SkDecodingImageGenerator::Create( | 295 SkImageGenerator* SkDecodingImageGenerator::Create( |
| 296 SkStreamRewindable* stream, | 296 SkStreamRewindable* stream, |
| 297 const SkDecodingImageGenerator::Options& opts) { | 297 const SkDecodingImageGenerator::Options& opts) { |
| 298 SkASSERT(stream != NULL); | 298 SkASSERT(stream != NULL); |
| 299 if (stream == NULL) { | 299 if (stream == NULL) { |
| 300 return NULL; | 300 return NULL; |
| 301 } | 301 } |
| 302 return CreateDecodingImageGenerator(NULL, stream, opts); | 302 return CreateDecodingImageGenerator(NULL, stream, opts); |
| 303 } | 303 } |
| OLD | NEW |