Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(248)

Unified Diff: src/gpu/GrYUVProvider.h

Issue 1716523002: Update Skia's YUV API (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Rebase Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkYUVPlanesCache.h ('k') | src/gpu/GrYUVProvider.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrYUVProvider.h
diff --git a/src/gpu/GrYUVProvider.h b/src/gpu/GrYUVProvider.h
index 869e1fd00d92c214b6bd58052734001cd2533b07..85b238d098b7377d6fa99cb9252f45423fd27e14 100644
--- a/src/gpu/GrYUVProvider.h
+++ b/src/gpu/GrYUVProvider.h
@@ -10,6 +10,7 @@
#include "GrTypes.h"
#include "SkImageInfo.h"
+#include "SkYUVSizeInfo.h"
class GrContext;
class GrTexture;
@@ -38,32 +39,29 @@ public:
virtual uint32_t onGetID() = 0;
- enum {
- kY_Index = 0,
- kU_Index = 1,
- kV_Index = 2,
-
- kPlaneCount = 3
- };
-
// These are not meant to be called by a client, only by the implementation
/**
- * Return the 3 dimensions for each plane and return true. On failure, return false and
- * ignore the sizes parameter. Typical failure is that the provider does not contain YUV
- * data, and may just be an RGB src.
+ * If decoding to YUV is supported, this returns 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.
*/
- virtual bool onGetYUVSizes(SkISize sizes[kPlaneCount]) = 0;
+ virtual bool onQueryYUV8(SkYUVSizeInfo* sizeInfo, SkYUVColorSpace* colorSpace) const = 0;
/**
- * On success, return true, and set sizes, rowbytes and colorspace to the appropriate values.
- * planes[] will have already been allocated by the client (based on the worst-case sizes
- * returned by onGetYUVSizes(). This method copies its planar data into those buffers.
+ * Returns true on success and false on failure.
+ * This always attempts to perform a full decode. If the client only
+ * wants size, it should call onQueryYUV8().
*
- * On failure, return false and ignore other parameters.
+ * @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.
*/
- virtual bool onGetYUVPlanes(SkISize sizes[kPlaneCount], void* planes[kPlaneCount],
- size_t rowBytes[kPlaneCount], SkYUVColorSpace*) = 0;
+ virtual bool onGetYUV8Planes(const SkYUVSizeInfo& sizeInfo, void* planes[3]) = 0;
};
#endif
« no previous file with comments | « src/core/SkYUVPlanesCache.h ('k') | src/gpu/GrYUVProvider.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698