diff options
author | Ricardo Cerqueira <cyanogenmod@cerqueira.org> | 2012-12-12 14:52:44 -0800 |
---|---|---|
committer | Gerrit Code Review <gerrit@review.cyanogenmod.com> | 2012-12-12 14:52:44 -0800 |
commit | 0a70c9c72dcce36e2a43937506af289c870707d7 (patch) | |
tree | 04719fdbd84587dd8308ab81613d790af1776666 /services | |
parent | 49e4bcbf733c909b369dc62cc0902fb38dea1c67 (diff) | |
parent | 5bb8917449681b0e9075e9b83244c95bbec117ac (diff) | |
download | frameworks_native-0a70c9c72dcce36e2a43937506af289c870707d7.zip frameworks_native-0a70c9c72dcce36e2a43937506af289c870707d7.tar.gz frameworks_native-0a70c9c72dcce36e2a43937506af289c870707d7.tar.bz2 |
Merge "surfaceflinger: odd hw rotation (90/270) patch for swapping width/height" into mr1-staging
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. |