Index: include/core/SkPixelRef.h |
diff --git a/include/core/SkPixelRef.h b/include/core/SkPixelRef.h |
index 651176ebbbba0fc6a9e07826a44f86cb157c11d9..e1ce6d4c7f2edc14ecf01e3105a58c9cdc0c561d 100644 |
--- a/include/core/SkPixelRef.h |
+++ b/include/core/SkPixelRef.h |
@@ -18,7 +18,6 @@ |
#include "SkRefCnt.h" |
#include "SkSize.h" |
#include "SkString.h" |
-#include "SkYUVSizeInfo.h" |
class SkColorTable; |
class SkData; |
@@ -211,28 +210,19 @@ |
virtual GrTexture* getTexture() { return NULL; } |
/** |
- * If this can efficiently return YUV data, this should return true. |
- * Otherwise this returns false and does not modify any of the parameters. |
- * |
- * @param sizeInfo Output parameter indicating the sizes and required |
- * allocation widths of the Y, U, and V planes. |
- * @param colorSpace Output parameter. |
- */ |
- bool queryYUV8(SkYUVSizeInfo* sizeInfo, SkYUVColorSpace* colorSpace) const { |
- return this->onQueryYUV8(sizeInfo, colorSpace); |
- } |
- |
- /** |
- * Returns true on success and false on failure. |
- * Copies YUV data into the provided YUV planes. |
- * |
- * @param sizeInfo Needs to exactly match the values returned by the |
- * query, except the WidthBytes may be larger than the |
- * recommendation (but not smaller). |
- * @param planes Memory for each of the Y, U, and V planes. |
- */ |
- bool getYUV8Planes(const SkYUVSizeInfo& sizeInfo, void* planes[3]) { |
- return this->onGetYUV8Planes(sizeInfo, planes); |
+ * If any planes or rowBytes is NULL, this should output the sizes and return true |
+ * if it can efficiently return YUV planar data. If it cannot, it should return false. |
+ * |
+ * If all planes and rowBytes are not NULL, then it should copy the associated Y,U,V data |
+ * into those planes of memory supplied by the caller. It should validate that the sizes |
+ * match what it expected. If the sizes do not match, it should return false. |
+ * |
+ * If colorSpace is not NULL, the YUV color space of the data should be stored in the address |
+ * it points at. |
+ */ |
+ bool getYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBytes[3], |
+ SkYUVColorSpace* colorSpace) { |
+ return this->onGetYUV8Planes(sizes, planes, rowBytes, colorSpace); |
} |
/** Populates dst with the pixels of this pixelRef, converting them to colorType. */ |
@@ -318,12 +308,9 @@ |
// default impl does nothing. |
virtual void onNotifyPixelsChanged(); |
- virtual bool onQueryYUV8(SkYUVSizeInfo*, SkYUVColorSpace*) const { |
- return false; |
- } |
- virtual bool onGetYUV8Planes(const SkYUVSizeInfo&, void*[3] /*planes*/) { |
- return false; |
- } |
+ // default impl returns false. |
+ virtual bool onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBytes[3], |
+ SkYUVColorSpace* colorSpace); |
/** |
* Returns the size (in bytes) of the internally allocated memory. |