| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "SkImageGenerator.h" | 8 #include "SkImageGenerator.h" |
| 9 | 9 |
| 10 bool SkImageGenerator::getInfo(SkImageInfo* info) { | 10 bool SkImageGenerator::getInfo(SkImageInfo* info) { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 return kInvalidParameters; | 33 return kInvalidParameters; |
| 34 } | 34 } |
| 35 } else { | 35 } else { |
| 36 if (ctableCount) { | 36 if (ctableCount) { |
| 37 *ctableCount = 0; | 37 *ctableCount = 0; |
| 38 } | 38 } |
| 39 ctableCount = NULL; | 39 ctableCount = NULL; |
| 40 ctable = NULL; | 40 ctable = NULL; |
| 41 } | 41 } |
| 42 | 42 |
| 43 const Result result = this->onGetPixelsEnum(info, pixels, rowBytes, ctable,
ctableCount); | 43 const Result result = this->onGetPixels(info, pixels, rowBytes, ctable, ctab
leCount); |
| 44 | 44 |
| 45 if ((kIncompleteInput == result || kSuccess == result) && ctableCount) { | 45 if ((kIncompleteInput == result || kSuccess == result) && ctableCount) { |
| 46 SkASSERT(*ctableCount >= 0 && *ctableCount <= 256); | 46 SkASSERT(*ctableCount >= 0 && *ctableCount <= 256); |
| 47 } | 47 } |
| 48 return result; | 48 return result; |
| 49 } | 49 } |
| 50 | 50 |
| 51 SkImageGenerator::Result SkImageGenerator::getPixels(const SkImageInfo& info, vo
id* pixels, | 51 SkImageGenerator::Result SkImageGenerator::getPixels(const SkImageInfo& info, vo
id* pixels, |
| 52 size_t rowBytes) { | 52 size_t rowBytes) { |
| 53 SkASSERT(kIndex_8_SkColorType != info.colorType()); | 53 SkASSERT(kIndex_8_SkColorType != info.colorType()); |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 ////////////////////////////////////////////////////////////////////////////////
///////////// | 112 ////////////////////////////////////////////////////////////////////////////////
///////////// |
| 113 | 113 |
| 114 SkData* SkImageGenerator::onRefEncodedData() { | 114 SkData* SkImageGenerator::onRefEncodedData() { |
| 115 return NULL; | 115 return NULL; |
| 116 } | 116 } |
| 117 | 117 |
| 118 bool SkImageGenerator::onGetInfo(SkImageInfo*) { | 118 bool SkImageGenerator::onGetInfo(SkImageInfo*) { |
| 119 return false; | 119 return false; |
| 120 } | 120 } |
| 121 | 121 |
| 122 #ifdef SK_SUPPORT_LEGACY_IMAGE_GENERATOR_RETURN | 122 SkImageGenerator::Result SkImageGenerator::onGetPixels(const SkImageInfo&, void*
, size_t, |
| 123 bool SkImageGenerator::onGetPixels(const SkImageInfo&, void*, size_t, | |
| 124 SkPMColor*, int*) { | 123 SkPMColor*, int*) { |
| 125 return false; | |
| 126 } | |
| 127 #endif | |
| 128 SkImageGenerator::Result SkImageGenerator::onGetPixelsEnum(const SkImageInfo& in
fo, void* pixels, | |
| 129 size_t rowBytes, SkPM
Color* colors, | |
| 130 int* colorCount) { | |
| 131 #ifdef SK_SUPPORT_LEGACY_IMAGE_GENERATOR_RETURN | |
| 132 if (this->onGetPixels(info, pixels, rowBytes, colors, colorCount)) { | |
| 133 return kSuccess; | |
| 134 } | |
| 135 #endif | |
| 136 return kUnimplemented; | 124 return kUnimplemented; |
| 137 } | 125 } |
| OLD | NEW |