From 4952f4297bc5cfc7d37870f908e5f95903b3d62e Mon Sep 17 00:00:00 2001 From: Neti Ravi Kumar Date: Thu, 9 Feb 2012 15:35:22 +0530 Subject: [PATCH] libqcomui : Compose UI in S3D format The new class QCBaseLayer has been added. It implementsthe composition of S3D UI when 3D video is playing. HWC adds hints to UIlayers for composing them in S3D format when running S3D video. Compose them in requested format. (cherry picked from commit 080e303a70f89a1b0601a45c0815042addb7ac63) Change-Id: I1d33a1419914b8e06618acd335f89808dc692742 --- libqcomui/qcom_ui.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/libqcomui/qcom_ui.h b/libqcomui/qcom_ui.h index 410ef70..517649f 100644 --- a/libqcomui/qcom_ui.h +++ b/libqcomui/qcom_ui.h @@ -171,6 +171,35 @@ private: }; #endif +class QCBaseLayer +{ +// int mS3DFormat; + int32_t mComposeS3DFormat; +public: + QCBaseLayer() + { + mComposeS3DFormat = 0; + } + enum { // S3D formats + eS3D_SIDE_BY_SIDE = 0x10000, + eS3D_TOP_BOTTOM = 0x20000 + }; +/* + virtual status_t setStereoscopic3DFormat(int format) { mS3DFormat = format; return 0; } + virtual int getStereoscopic3DFormat() const { return mS3DFormat; } + */ + void setS3DComposeFormat (int32_t hints) + { + if (hints & HWC_HINT_DRAW_S3D_SIDE_BY_SIDE) + mComposeS3DFormat = eS3D_SIDE_BY_SIDE; + else if (hints & HWC_HINT_DRAW_S3D_TOP_BOTTOM) + mComposeS3DFormat = eS3D_TOP_BOTTOM; + else + mComposeS3DFormat = 0; + } + int32_t needsS3DCompose () const { return mComposeS3DFormat; } +}; + /* * Function to check if the allocated buffer is of the correct size. * Reallocate the buffer with the correct size, if the size doesn't