summaryrefslogtreecommitdiffstats
path: root/libs/surfaceflinger/OrientationAnimation.cpp
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-03-27 15:38:40 -0700
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-27 15:38:40 -0700
commite1861133d51b9e6a6f658eb366630ad4f4d3ff8f (patch)
tree046aaac6d455ccd57d38f3a13df44ecd13ac0322 /libs/surfaceflinger/OrientationAnimation.cpp
parentd91450e1169b3a57b3507fe86d947de05549f4ed (diff)
parent3f2fd987b230740e1b28ccb541d1181cb2187ae6 (diff)
downloadframeworks_base-e1861133d51b9e6a6f658eb366630ad4f4d3ff8f.zip
frameworks_base-e1861133d51b9e6a6f658eb366630ad4f4d3ff8f.tar.gz
frameworks_base-e1861133d51b9e6a6f658eb366630ad4f4d3ff8f.tar.bz2
Merge commit 'korg/cupcake'
Conflicts: core/java/android/webkit/WebView.java core/java/android/widget/TwoLineListItem.java preloaded-classes
Diffstat (limited to 'libs/surfaceflinger/OrientationAnimation.cpp')
-rw-r--r--libs/surfaceflinger/OrientationAnimation.cpp32
1 files changed, 19 insertions, 13 deletions
diff --git a/libs/surfaceflinger/OrientationAnimation.cpp b/libs/surfaceflinger/OrientationAnimation.cpp
index f6f1326..70eec8d 100644
--- a/libs/surfaceflinger/OrientationAnimation.cpp
+++ b/libs/surfaceflinger/OrientationAnimation.cpp
@@ -21,6 +21,7 @@
#include <limits.h>
#include "LayerOrientationAnim.h"
+#include "LayerOrientationAnimRotate.h"
#include "OrientationAnimation.h"
#include "SurfaceFlinger.h"
#include "VRamHeap.h"
@@ -43,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()
@@ -81,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()
@@ -112,8 +110,16 @@ bool OrientationAnimation::prepare()
bitmap.getBitmapSurface(&front);
hw.copyFrontToImage(front);
- LayerOrientationAnim* l = new LayerOrientationAnim(
- mFlinger.get(), 0, this, bitmap, bitmapIn);
+ LayerOrientationAnimBase* l;
+
+ 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);
mFlinger->addLayer(l);