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 #ifndef SkImageGenerator_DEFINED | 8 #ifndef SkImageGenerator_DEFINED |
9 #define SkImageGenerator_DEFINED | 9 #define SkImageGenerator_DEFINED |
10 | 10 |
11 #include "SkColor.h" | |
11 #include "SkImageInfo.h" | 12 #include "SkImageInfo.h" |
12 #include "SkColor.h" | 13 #include "SkPixelRef.h" |
13 | 14 |
14 class SkBitmap; | 15 class SkBitmap; |
15 class SkData; | 16 class SkData; |
16 class SkImageGenerator; | 17 class SkImageGenerator; |
17 | 18 |
18 /** | 19 /** |
19 * Takes ownership of SkImageGenerator. If this method fails for | 20 * Takes ownership of SkImageGenerator. If this method fails for |
20 * whatever reason, it will return false and immediatetely delete | 21 * whatever reason, it will return false and immediatetely delete |
21 * the generator. If it succeeds, it will modify destination | 22 * the generator. If it succeeds, it will modify destination |
22 * bitmap. | 23 * bitmap. |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
114 * If planes or rowBytes is NULL or if any entry in planes is NULL or if an y entry in rowBytes | 115 * If planes or rowBytes is NULL or if any entry in planes is NULL or if an y entry in rowBytes |
115 * is 0, this imagegenerator should output the sizes and return true if it can efficiently | 116 * is 0, this imagegenerator should output the sizes and return true if it can efficiently |
116 * return YUV planar data. If it cannot, it should return false. Note that either planes and | 117 * return YUV planar data. If it cannot, it should return false. Note that either planes and |
117 * rowBytes are both fully defined and non NULL/non 0 or they are both NULL or have NULL or 0 | 118 * rowBytes are both fully defined and non NULL/non 0 or they are both NULL or have NULL or 0 |
118 * entries only. Having only partial planes/rowBytes information is not sup ported. | 119 * entries only. Having only partial planes/rowBytes information is not sup ported. |
119 * | 120 * |
120 * If all planes and rowBytes entries are non NULL or non 0, then it should copy the | 121 * If all planes and rowBytes entries are non NULL or non 0, then it should copy the |
121 * associated YUV data into those planes of memory supplied by the caller. It should validate | 122 * associated YUV data into those planes of memory supplied by the caller. It should validate |
122 * that the sizes match what it expected. If the sizes do not match, it sho uld return false. | 123 * that the sizes match what it expected. If the sizes do not match, it sho uld return false. |
123 */ | 124 */ |
124 bool getYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBytes[3]); | 125 bool getYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBytes[3], |
126 SkYUVColorSpace* colorSpace); | |
125 | 127 |
126 protected: | 128 protected: |
127 virtual SkData* onRefEncodedData(); | 129 virtual SkData* onRefEncodedData(); |
128 virtual bool onGetInfo(SkImageInfo* info); | 130 virtual bool onGetInfo(SkImageInfo* info); |
129 virtual bool onGetPixels(const SkImageInfo& info, | 131 virtual bool onGetPixels(const SkImageInfo& info, |
130 void* pixels, size_t rowBytes, | 132 void* pixels, size_t rowBytes, |
131 SkPMColor ctable[], int* ctableCount); | 133 SkPMColor ctable[], int* ctableCount); |
132 virtual bool onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBy tes[3]); | 134 virtual bool onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBy tes[3]); |
135 virtual bool onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBy tes[3], | |
bsalomon
2014/09/11 20:17:17
Is the plan to remove the virtual that doesn't tak
rileya (GONE FROM CHROMIUM)
2014/09/11 20:43:40
Exactly, assuming we're okay changing the interfac
| |
136 SkYUVColorSpace* colorSpace); | |
133 }; | 137 }; |
134 | 138 |
135 #endif // SkImageGenerator_DEFINED | 139 #endif // SkImageGenerator_DEFINED |
OLD | NEW |