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
This commit is contained in:
Neti Ravi Kumar 2012-02-09 15:35:22 +05:30 committed by Andrew Sutherland
parent 6fd8923a96
commit 4952f4297b

View File

@ -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