From 91e13af7e1056a7bad83eb34ebf63fdd45e24bea Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 8 Feb 2018 17:30:06 +0100 Subject: YUV colorspace adaptations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Switch to using Chromium's Colorspace class and its generated shader code instead of our own enums. Change-Id: I89ee96adf68e2421efa2350cb0b78ce0fea7221f Reviewed-by: Michael BrĂ¼ning --- src/core/yuv_video_node.h | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'src/core/yuv_video_node.h') diff --git a/src/core/yuv_video_node.h b/src/core/yuv_video_node.h index 0baa5f5be..dca8fa5e2 100644 --- a/src/core/yuv_video_node.h +++ b/src/core/yuv_video_node.h @@ -43,6 +43,8 @@ #include #include +#include "ui/gfx/color_space.h" + QT_FORWARD_DECLARE_CLASS(QSGTexture) namespace QtWebEngineCore { @@ -53,14 +55,9 @@ namespace QtWebEngineCore { class YUVVideoMaterial : public QSGMaterial { public: - enum ColorSpace { - REC_601, // SDTV standard with restricted "studio swing" color range. - REC_709, // HDTV standard with restricted "studio swing" color range. - JPEG // Full color range [0, 255] JPEG color space. - }; YUVVideoMaterial(QSGTexture *yTexture, QSGTexture *uTexture, QSGTexture *vTexture, const QRectF &yaTexCoordRect, const QRectF &uvTexCoordRect, const QSizeF &yaTexSize, const QSizeF &uvTexSize, - ColorSpace colorspace, float rMul, float rOff); + const gfx::ColorSpace &colorspace, float rMul, float rOff); QSGMaterialType *type() const override { @@ -78,7 +75,7 @@ public: QRectF m_uvTexCoordRect; QSizeF m_yaTexSize; QSizeF m_uvTexSize; - ColorSpace m_colorSpace; + gfx::ColorSpace m_colorSpace; float m_resourceMultiplier; float m_resourceOffset; }; @@ -88,7 +85,7 @@ class YUVAVideoMaterial : public YUVVideoMaterial public: YUVAVideoMaterial(QSGTexture *yTexture, QSGTexture *uTexture, QSGTexture *vTexture, QSGTexture *aTexture, const QRectF &yaTexCoordRect, const QRectF &uvTexCoordRect, const QSizeF &yaTexSize, const QSizeF &uvTexSize, - ColorSpace colorspace, float rMul, float rOff); + const gfx::ColorSpace &colorspace, float rMul, float rOff); QSGMaterialType *type() const override { @@ -107,7 +104,7 @@ class YUVVideoNode : public QSGGeometryNode public: YUVVideoNode(QSGTexture *yTexture, QSGTexture *uTexture, QSGTexture *vTexture, QSGTexture *aTexture, const QRectF &yaTexCoordRect, const QRectF &uvTexCoordRect, const QSizeF &yaTexSize, const QSizeF &uvTexSize, - YUVVideoMaterial::ColorSpace colorspace, float rMul, float rOff); + const gfx::ColorSpace &colorspace, float rMul, float rOff); void setRect(const QRectF &rect); private: -- cgit v1.2.3