From 8d91b425078083d0e4967dcd8d669d9f7196123a Mon Sep 17 00:00:00 2001 From: Jamie Gennis Date: Fri, 23 Sep 2011 15:54:34 -0700 Subject: [PATCH] SurfaceFlinger: fix the transform hint This change fixes the transform hint to use only the global display transform rather than incorporating the transient layer-specific transform used during animations. Bug: 5366891 Change-Id: I5408dcd3f4771d010953e8a696a484c835bfe81e --- services/surfaceflinger/Layer.cpp | 2 +- services/surfaceflinger/LayerBase.cpp | 2 ++ services/surfaceflinger/LayerBase.h | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index edbc7b023..74ea4c751 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -578,7 +578,7 @@ uint32_t Layer::getEffectiveUsage(uint32_t usage) const uint32_t Layer::getTransformHint() const { uint32_t orientation = 0; if (!mFlinger->mDebugDisableTransformHint) { - orientation = getOrientation(); + orientation = getPlaneOrientation(); if (orientation & Transform::ROT_INVALID) { orientation = 0; } diff --git a/services/surfaceflinger/LayerBase.cpp b/services/surfaceflinger/LayerBase.cpp index e5ce814bd..7a47f620f 100644 --- a/services/surfaceflinger/LayerBase.cpp +++ b/services/surfaceflinger/LayerBase.cpp @@ -45,6 +45,7 @@ LayerBase::LayerBase(SurfaceFlinger* flinger, DisplayID display) mFlinger(flinger), mFiltering(false), mNeedsFiltering(false), mInOverlay(false), mOrientation(0), + mPlaneOrientation(0), mTransactionFlags(0), mPremultipliedAlpha(true), mName("unnamed"), mDebug(false), mInvalidate(0) @@ -256,6 +257,7 @@ void LayerBase::validateVisibility(const Transform& planeTransform) // cache a few things... mOrientation = tr.getOrientation(); + mPlaneOrientation = planeTransform.getOrientation(); mTransform = tr; mTransformedBounds = tr.makeBounds(w, h); } diff --git a/services/surfaceflinger/LayerBase.h b/services/surfaceflinger/LayerBase.h index a14b397a8..268ba2daa 100644 --- a/services/surfaceflinger/LayerBase.h +++ b/services/surfaceflinger/LayerBase.h @@ -221,6 +221,7 @@ public: inline State& currentState() { return mCurrentState; } int32_t getOrientation() const { return mOrientation; } + int32_t getPlaneOrientation() const { return mPlaneOrientation; } protected: const GraphicPlane& graphicPlane(int dpy) const; @@ -254,6 +255,7 @@ private: protected: // cached during validateVisibility() int32_t mOrientation; + int32_t mPlaneOrientation; Transform mTransform; GLfloat mVertices[4][2]; Rect mTransformedBounds;