diff options
author | Hashcode <hashcode0f@gmail.com> | 2012-12-10 16:33:53 -0800 |
---|---|---|
committer | Hashcode <hashcode0f@gmail.com> | 2012-12-10 19:58:57 -0800 |
commit | 5bb8917449681b0e9075e9b83244c95bbec117ac (patch) | |
tree | ee5d13fb852c7f6231010b4270550abd78a608a9 /services | |
parent | a1aa229340e805da8cbd1edaaf2e6fcb380a1070 (diff) | |
download | frameworks_native-5bb8917449681b0e9075e9b83244c95bbec117ac.zip frameworks_native-5bb8917449681b0e9075e9b83244c95bbec117ac.tar.gz frameworks_native-5bb8917449681b0e9075e9b83244c95bbec117ac.tar.bz2 |
surfaceflinger: odd hw rotation (90/270) patch for swapping width/height
This patch works in addition to the following commit
re-implementing ro.sf.hwrotation:
https://github.com/CyanogenMod/android_frameworks_native/commit/7d283431efffc4402cb1a6cacf5da64729c883bb
When using values of 90 and 270 for ro.sf.hwrotation the
LCD width and height also need to be swapped to display properly.
NOTE: This patch does not fix the initial startup of bootanimation
Change-Id: Iab9de66348967a378dd73a41bc96d632f750386c
Signed-off-by: Hashcode <hashcode0f@gmail.com>
Diffstat (limited to 'services')
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index ce10c78..f97bcef 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -665,10 +665,21 @@ status_t SurfaceFlinger::getDisplayInfo(const sp<IBinder>& display, DisplayInfo* info->orientation = 0; } - info->w = hwc.getWidth(type); - info->h = hwc.getHeight(type); - info->xdpi = xdpi; - info->ydpi = ydpi; + char value[PROPERTY_VALUE_MAX]; + property_get("ro.sf.hwrotation", value, "0"); + int additionalRot = atoi(value) / 90; + if ((type == DisplayDevice::DISPLAY_PRIMARY) && (additionalRot & DisplayState::eOrientationSwapMask)) { + info->h = hwc.getWidth(type); + info->w = hwc.getHeight(type); + info->xdpi = ydpi; + info->ydpi = xdpi; + } + else { + info->w = hwc.getWidth(type); + info->h = hwc.getHeight(type); + info->xdpi = xdpi; + info->ydpi = ydpi; + } info->fps = float(1e9 / hwc.getRefreshPeriod(type)); // All non-virtual displays are currently considered secure. |