From d2f34e5fd6c20854b45c76f2a514fb8864277ea2 Mon Sep 17 00:00:00 2001 From: Mathias Agopian <> Date: Wed, 25 Mar 2009 21:42:35 -0700 Subject: Automated import from //branches/cupcake/...@142856,142856 --- libs/surfaceflinger/OrientationAnimation.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'libs/surfaceflinger/OrientationAnimation.cpp') diff --git a/libs/surfaceflinger/OrientationAnimation.cpp b/libs/surfaceflinger/OrientationAnimation.cpp index f6f1326..e59688e 100644 --- a/libs/surfaceflinger/OrientationAnimation.cpp +++ b/libs/surfaceflinger/OrientationAnimation.cpp @@ -21,6 +21,7 @@ #include #include "LayerOrientationAnim.h" +#include "LayerOrientationAnimRotate.h" #include "OrientationAnimation.h" #include "SurfaceFlinger.h" #include "VRamHeap.h" @@ -112,8 +113,14 @@ bool OrientationAnimation::prepare() bitmap.getBitmapSurface(&front); hw.copyFrontToImage(front); - LayerOrientationAnim* l = new LayerOrientationAnim( + LayerOrientationAnimBase* l; + + l = new LayerOrientationAnim( mFlinger.get(), 0, this, bitmap, bitmapIn); + + //l = new LayerOrientationAnimRotate( + // mFlinger.get(), 0, this, bitmap, bitmapIn); + l->initStates(w, h, 0); l->setLayer(INT_MAX-1); mFlinger->addLayer(l); -- cgit v1.1 From c75c4364eae030a9ea6db658c4d1e38cdb05ab4c Mon Sep 17 00:00:00 2001 From: Mathias Agopian <> Date: Wed, 25 Mar 2009 23:18:56 -0700 Subject: Automated import from //branches/cupcake/...@142873,142873 --- libs/surfaceflinger/OrientationAnimation.cpp | 31 ++++++++++++++-------------- 1 file changed, 15 insertions(+), 16 deletions(-) (limited to 'libs/surfaceflinger/OrientationAnimation.cpp') diff --git a/libs/surfaceflinger/OrientationAnimation.cpp b/libs/surfaceflinger/OrientationAnimation.cpp index e59688e..70eec8d 100644 --- a/libs/surfaceflinger/OrientationAnimation.cpp +++ b/libs/surfaceflinger/OrientationAnimation.cpp @@ -44,10 +44,14 @@ OrientationAnimation::~OrientationAnimation() { } -void OrientationAnimation::onOrientationChanged() +void OrientationAnimation::onOrientationChanged(uint32_t type) { - if (mState == DONE) - mState = PREPARE; + if (mState == DONE) { + mType = type; + if (!(type & ISurfaceComposer::eOrientationAnimationDisable)) { + mState = PREPARE; + } + } } void OrientationAnimation::onAnimationFinished() @@ -82,14 +86,7 @@ bool OrientationAnimation::run_impl() bool OrientationAnimation::done() { - if (mFlinger->isFrozen()) { - // we are not allowed to draw, but pause a bit to make sure - // apps don't end up using the whole CPU, if they depend on - // surfaceflinger for synchronization. - usleep(8333); // 8.3ms ~ 120fps - return true; - } - return false; + return done_impl(); } bool OrientationAnimation::prepare() @@ -115,11 +112,13 @@ bool OrientationAnimation::prepare() LayerOrientationAnimBase* l; - l = new LayerOrientationAnim( - mFlinger.get(), 0, this, bitmap, bitmapIn); - - //l = new LayerOrientationAnimRotate( - // mFlinger.get(), 0, this, bitmap, bitmapIn); + if (mType & 0x80) { + l = new LayerOrientationAnimRotate( + mFlinger.get(), 0, this, bitmap, bitmapIn); + } else { + l = new LayerOrientationAnim( + mFlinger.get(), 0, this, bitmap, bitmapIn); + } l->initStates(w, h, 0); l->setLayer(INT_MAX-1); -- cgit v1.1