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 | 10 #ifndef SK_SUPPORT_LEGACY_IMAGEGENERATORAPI |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 if (kIndex_8_SkColorType == info.colorType()) { | 53 if (kIndex_8_SkColorType == info.colorType()) { |
54 return false; | 54 return false; |
55 } | 55 } |
56 return this->getPixels(info, pixels, rowBytes, NULL, NULL); | 56 return this->getPixels(info, pixels, rowBytes, NULL, NULL); |
57 } | 57 } |
58 #endif | 58 #endif |
59 | 59 |
60 bool SkImageGenerator::getYUV8Planes(SkISize sizes[3], void* planes[3], size_t r
owBytes[3]) { | 60 bool SkImageGenerator::getYUV8Planes(SkISize sizes[3], void* planes[3], size_t r
owBytes[3]) { |
61 #ifdef SK_DEBUG | 61 #ifdef SK_DEBUG |
62 // In all cases, we need the sizes array | 62 // In all cases, we need the sizes array |
63 SkASSERT(NULL != sizes); | 63 SkASSERT(sizes); |
64 | 64 |
65 bool isValidWithPlanes = (NULL != planes) && (NULL != rowBytes) && | 65 bool isValidWithPlanes = (planes) && (rowBytes) && |
66 ((NULL != planes[0]) && (NULL != planes[1]) && (NULL != planes[2]) && | 66 ((planes[0]) && (planes[1]) && (planes[2]) && |
67 (0 != rowBytes[0]) && (0 != rowBytes[1]) && (0 != rowBytes[2])); | 67 (0 != rowBytes[0]) && (0 != rowBytes[1]) && (0 != rowBytes[2])); |
68 bool isValidWithoutPlanes = | 68 bool isValidWithoutPlanes = |
69 ((NULL == planes) || | 69 ((NULL == planes) || |
70 ((NULL == planes[0]) && (NULL == planes[1]) && (NULL == planes[2]))) && | 70 ((NULL == planes[0]) && (NULL == planes[1]) && (NULL == planes[2]))) && |
71 ((NULL == rowBytes) || | 71 ((NULL == rowBytes) || |
72 ((0 == rowBytes[0]) && (0 == rowBytes[1]) && (0 == rowBytes[2]))); | 72 ((0 == rowBytes[0]) && (0 == rowBytes[1]) && (0 == rowBytes[2]))); |
73 | 73 |
74 // Either we have all planes and rowBytes information or we have none of it | 74 // Either we have all planes and rowBytes information or we have none of it |
75 // Having only partial information is not supported | 75 // Having only partial information is not supported |
76 SkASSERT(isValidWithPlanes || isValidWithoutPlanes); | 76 SkASSERT(isValidWithPlanes || isValidWithoutPlanes); |
(...skipping 25 matching lines...) Expand all Loading... |
102 return NULL; | 102 return NULL; |
103 } | 103 } |
104 | 104 |
105 bool SkImageGenerator::onGetInfo(SkImageInfo*) { | 105 bool SkImageGenerator::onGetInfo(SkImageInfo*) { |
106 return false; | 106 return false; |
107 } | 107 } |
108 | 108 |
109 bool SkImageGenerator::onGetPixels(const SkImageInfo&, void*, size_t, SkPMColor*
, int*) { | 109 bool SkImageGenerator::onGetPixels(const SkImageInfo&, void*, size_t, SkPMColor*
, int*) { |
110 return false; | 110 return false; |
111 } | 111 } |
OLD | NEW |