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 #ifndef SK_SUPPORT_LEGACY_IMAGEGENERATORAPI | |
11 bool SkImageGenerator::getInfo(SkImageInfo* info) { | 10 bool SkImageGenerator::getInfo(SkImageInfo* info) { |
12 SkImageInfo dummy; | 11 SkImageInfo dummy; |
13 if (NULL == info) { | 12 if (NULL == info) { |
14 info = &dummy; | 13 info = &dummy; |
15 } | 14 } |
16 return this->onGetInfo(info); | 15 return this->onGetInfo(info); |
17 } | 16 } |
18 | 17 |
19 bool SkImageGenerator::getPixels(const SkImageInfo& info, void* pixels, size_t r
owBytes, | 18 bool SkImageGenerator::getPixels(const SkImageInfo& info, void* pixels, size_t r
owBytes, |
20 SkPMColor ctable[], int* ctableCount) { | 19 SkPMColor ctable[], int* ctableCount) { |
(...skipping 27 matching lines...) Expand all Loading... |
48 return success; | 47 return success; |
49 } | 48 } |
50 | 49 |
51 bool SkImageGenerator::getPixels(const SkImageInfo& info, void* pixels, size_t r
owBytes) { | 50 bool SkImageGenerator::getPixels(const SkImageInfo& info, void* pixels, size_t r
owBytes) { |
52 SkASSERT(kIndex_8_SkColorType != info.colorType()); | 51 SkASSERT(kIndex_8_SkColorType != info.colorType()); |
53 if (kIndex_8_SkColorType == info.colorType()) { | 52 if (kIndex_8_SkColorType == info.colorType()) { |
54 return false; | 53 return false; |
55 } | 54 } |
56 return this->getPixels(info, pixels, rowBytes, NULL, NULL); | 55 return this->getPixels(info, pixels, rowBytes, NULL, NULL); |
57 } | 56 } |
58 #endif | |
59 | 57 |
60 bool SkImageGenerator::getYUV8Planes(SkISize sizes[3], void* planes[3], size_t r
owBytes[3], | 58 bool SkImageGenerator::getYUV8Planes(SkISize sizes[3], void* planes[3], size_t r
owBytes[3], |
61 SkYUVColorSpace* colorSpace) { | 59 SkYUVColorSpace* colorSpace) { |
62 #ifdef SK_DEBUG | 60 #ifdef SK_DEBUG |
63 // In all cases, we need the sizes array | 61 // In all cases, we need the sizes array |
64 SkASSERT(sizes); | 62 SkASSERT(sizes); |
65 | 63 |
66 bool isValidWithPlanes = (planes) && (rowBytes) && | 64 bool isValidWithPlanes = (planes) && (rowBytes) && |
67 ((planes[0]) && (planes[1]) && (planes[2]) && | 65 ((planes[0]) && (planes[1]) && (planes[2]) && |
68 (0 != rowBytes[0]) && (0 != rowBytes[1]) && (0 != rowBytes[2])); | 66 (0 != rowBytes[0]) && (0 != rowBytes[1]) && (0 != rowBytes[2])); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 return NULL; | 113 return NULL; |
116 } | 114 } |
117 | 115 |
118 bool SkImageGenerator::onGetInfo(SkImageInfo*) { | 116 bool SkImageGenerator::onGetInfo(SkImageInfo*) { |
119 return false; | 117 return false; |
120 } | 118 } |
121 | 119 |
122 bool SkImageGenerator::onGetPixels(const SkImageInfo&, void*, size_t, SkPMColor*
, int*) { | 120 bool SkImageGenerator::onGetPixels(const SkImageInfo&, void*, size_t, SkPMColor*
, int*) { |
123 return false; | 121 return false; |
124 } | 122 } |
OLD | NEW |