Chromium Code Reviews| 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 |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 109 */ | 109 */ |
| 110 bool getPixels(const SkImageInfo& info, void* pixels, size_t rowBytes, | 110 bool getPixels(const SkImageInfo& info, void* pixels, size_t rowBytes, |
| 111 SkPMColor ctable[], int* ctableCount); | 111 SkPMColor ctable[], int* ctableCount); |
| 112 | 112 |
| 113 /** | 113 /** |
| 114 * Simplified version of getPixels() that asserts that info is NOT kIndex8_ SkColorType. | 114 * Simplified version of getPixels() that asserts that info is NOT kIndex8_ SkColorType. |
| 115 */ | 115 */ |
| 116 bool getPixels(const SkImageInfo& info, void* pixels, size_t rowBytes); | 116 bool getPixels(const SkImageInfo& info, void* pixels, size_t rowBytes); |
| 117 #endif | 117 #endif |
| 118 | 118 |
| 119 struct YUV8Planes { | |
| 120 // do we want/need per-buffer rowbytes? or just assume tight? | |
| 121 SkImageInfo fInfo; | |
|
sugoi1
2014/07/08 14:42:02
The SkImageInfo member is required so that onGetYU
| |
| 122 uint8_t* fPixels; | |
|
sugoi1
2014/07/08 14:42:02
The current implementation in Blink makes it very
| |
| 123 }; | |
| 124 /** | |
| 125 * If planes is NULL, this imagegenerator should output the sizes and retur n true | |
| 126 * if it can efficiently return YUV planar data. If it cannot, it should re turn false. | |
| 127 * | |
| 128 * If planes is not NULL, then it should copy the associated Y,U,V data int o those planes | |
| 129 * of memory supplied by the caller. It should validate that the sizes matc h what it expected. | |
| 130 * If the sizes do not match, it should return false. | |
| 131 */ | |
| 132 bool getYUV8Planes(SkISize* sizes, const YUV8Planes* planes = NULL); | |
|
Stephen White
2014/07/08 15:00:19
Does "planes" have to be a default parameter? It m
reed1
2014/07/08 15:08:52
What about
struct Plane8 {
uint8_t* fPixels;
| |
| 133 | |
| 119 protected: | 134 protected: |
| 120 virtual SkData* onRefEncodedData(); | 135 virtual SkData* onRefEncodedData(); |
| 121 virtual bool onGetInfo(SkImageInfo* info); | 136 virtual bool onGetInfo(SkImageInfo* info); |
| 122 virtual bool onGetPixels(const SkImageInfo& info, | 137 virtual bool onGetPixels(const SkImageInfo& info, |
| 123 void* pixels, size_t rowBytes, | 138 void* pixels, size_t rowBytes, |
| 124 SkPMColor ctable[], int* ctableCount); | 139 SkPMColor ctable[], int* ctableCount); |
| 140 virtual bool onGetYUV8Planes(SkISize*, const YUV8Planes*); | |
| 125 }; | 141 }; |
| 126 | 142 |
| 127 #endif // SkImageGenerator_DEFINED | 143 #endif // SkImageGenerator_DEFINED |
| OLD | NEW |