summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChirayu Desai <cdesai@cyanogenmod.org>2012-12-29 12:56:13 +0530
committerGerrit Code Review <gerrit@review.cyanogenmod.com>2013-01-26 21:22:39 -0800
commitc9d395f986e2a271b3bce497449da270bcaf38b2 (patch)
treeb22a62f3b31a0c6ab23da3b74ee3efbe39d24bfe
parentf442ef1dfc17ca56b88c68c318599942f94e1d68 (diff)
downloadframeworks_native-c9d395f986e2a271b3bce497449da270bcaf38b2.zip
frameworks_native-c9d395f986e2a271b3bce497449da270bcaf38b2.tar.gz
frameworks_native-c9d395f986e2a271b3bce497449da270bcaf38b2.tar.bz2
SurfaceComposerClient: bring back getDisplayWidth, Height & Orientation
enable it with either ICS_CAMERA_BLOB or MR0_CAMERA_BLOB CFLAG Change-Id: Ieb5d36ad2a87ed1f0aa28ae3afbd5d48c880d6ab
-rw-r--r--include/gui/SurfaceComposerClient.h6
-rw-r--r--libs/gui/SurfaceComposerClient.cpp20
2 files changed, 26 insertions, 0 deletions
diff --git a/include/gui/SurfaceComposerClient.h b/include/gui/SurfaceComposerClient.h
index 1bbad60..7eb6b64 100644
--- a/include/gui/SurfaceComposerClient.h
+++ b/include/gui/SurfaceComposerClient.h
@@ -77,6 +77,12 @@ public:
// this legacy function (when they shouldn't).
static status_t getDisplayInfo(int32_t displayId, DisplayInfo* info);
+#if defined(ICS_CAMERA_BLOB) || defined(MR0_CAMERA_BLOB)
+ static ssize_t getDisplayWidth(int32_t displayId);
+ static ssize_t getDisplayHeight(int32_t displayId);
+ static ssize_t getDisplayOrientation(int32_t displayId);
+#endif
+
// ------------------------------------------------------------------------
// surface creation / destruction
diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp
index 0301f72..e6b4b21 100644
--- a/libs/gui/SurfaceComposerClient.cpp
+++ b/libs/gui/SurfaceComposerClient.cpp
@@ -630,6 +630,26 @@ status_t SurfaceComposerClient::getDisplayInfo(
return getDisplayInfo(getBuiltInDisplay(displayId), info);
}
+#if defined(ICS_CAMERA_BLOB) || defined(MR0_CAMERA_BLOB)
+ssize_t SurfaceComposerClient::getDisplayWidth(int32_t displayId) {
+ DisplayInfo info;
+ getDisplayInfo(getBuiltInDisplay(displayId), &info);
+ return info.w;
+}
+
+ssize_t SurfaceComposerClient::getDisplayHeight(int32_t displayId) {
+ DisplayInfo info;
+ getDisplayInfo(getBuiltInDisplay(displayId), &info);
+ return info.h;
+}
+
+ssize_t SurfaceComposerClient::getDisplayOrientation(int32_t displayId) {
+ DisplayInfo info;
+ getDisplayInfo(getBuiltInDisplay(displayId), &info);
+ return info.orientation;
+}
+#endif
+
// ----------------------------------------------------------------------------
ScreenshotClient::ScreenshotClient()