diff options
author | Ramkumar Radhakrishnan <ramkumar@codeaurora.org> | 2013-05-07 15:59:11 -0700 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2015-10-26 16:09:10 -0700 |
commit | d869f6d3b606e68ff9c6a5944639efb72748ca7d (patch) | |
tree | 2867f6934c6938e558beaedc970cc291647fc82d /cmds/bootanimation | |
parent | d168891d421662aa2ed561a6657daf762a20fe53 (diff) | |
download | frameworks_base-d869f6d3b606e68ff9c6a5944639efb72748ca7d.zip frameworks_base-d869f6d3b606e68ff9c6a5944639efb72748ca7d.tar.gz frameworks_base-d869f6d3b606e68ff9c6a5944639efb72748ca7d.tar.bz2 |
framework/base: Create surface based on the panel orientation.
- Create Surface for boot animation based on panel orientation
- Set the display projection values based on panel orientation.
Change-Id: Iaf66ac13cc44cf7910ff150b3a104eb52bcefdbf
Diffstat (limited to 'cmds/bootanimation')
-rw-r--r-- | cmds/bootanimation/BootAnimation.cpp | 12 | ||||
-rw-r--r-- | cmds/bootanimation/BootAnimation.h | 6 |
2 files changed, 18 insertions, 0 deletions
diff --git a/cmds/bootanimation/BootAnimation.cpp b/cmds/bootanimation/BootAnimation.cpp index f7a75d3..9d9b20b 100644 --- a/cmds/bootanimation/BootAnimation.cpp +++ b/cmds/bootanimation/BootAnimation.cpp @@ -337,6 +337,18 @@ status_t BootAnimation::readyToRun() { status_t status = SurfaceComposerClient::getDisplayInfo(dtoken, &dinfo); if (status) return -1; + char value[PROPERTY_VALUE_MAX]; + property_get("persist.panel.orientation", value, "0"); + int orient = atoi(value) / 90; + + if(orient == eOrientation90 || orient == eOrientation270) { + int temp = dinfo.h; + dinfo.h = dinfo.w; + dinfo.w = temp; + } + + Rect destRect(dinfo.w, dinfo.h); + mSession->setDisplayProjection(dtoken, orient, destRect, destRect); // create the native surface sp<SurfaceControl> control = session()->createSurface(String8("BootAnimation"), diff --git a/cmds/bootanimation/BootAnimation.h b/cmds/bootanimation/BootAnimation.h index 758f7f7..09ea484 100644 --- a/cmds/bootanimation/BootAnimation.h +++ b/cmds/bootanimation/BootAnimation.h @@ -40,6 +40,12 @@ class SurfaceControl; class BootAnimation : public Thread, public IBinder::DeathRecipient { public: + enum { + eOrientationDefault = 0, + eOrientation90 = 1, + eOrientation180 = 2, + eOrientation270 = 3, + }; BootAnimation(); virtual ~BootAnimation(); |