summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Mathias Agopian <mathias@google.com> 2010-12-07 21:00:25 -0800
committer Mathias Agopian <mathias@google.com> 2010-12-07 21:16:14 -0800
commitee5a3aca5752f201b69fe0307414ca16ca492f0e (patch)
treea70a3671f29058edac447805905d3fab7434fd04
parenta2977c383d363e1e88a5b36230b1fa4c312807d2 (diff)
[317580] fix issue where the screen wouldn't be rotated properly in bypass mode
In some situations, the screen transformation would not be applied while in bypass mode. Change-Id: I3d6dd52e4c12b11aae97b54bf8e2322536eee37f
-rw-r--r--services/surfaceflinger/Layer.cpp12
-rw-r--r--services/surfaceflinger/Layer.h2
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp6
3 files changed, 19 insertions, 1 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index a18f47331506..3a8690eb5da4 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -466,6 +466,18 @@ bool Layer::setBypass(bool enable)
return true;
}
+void Layer::updateBuffersOrientation()
+{
+ sp<GraphicBuffer> buffer(getBypassBuffer());
+ if (buffer != NULL && mOrientation != buffer->transform) {
+ ClientRef::Access sharedClient(mUserClientRef);
+ SharedBufferServer* lcblk(sharedClient.get());
+ if (lcblk) { // all buffers need reallocation
+ lcblk->reallocateAll();
+ }
+ }
+}
+
uint32_t Layer::doTransaction(uint32_t flags)
{
const Layer::State& front(drawingState());
diff --git a/services/surfaceflinger/Layer.h b/services/surfaceflinger/Layer.h
index 9ff57164a877..cb62558f04f3 100644
--- a/services/surfaceflinger/Layer.h
+++ b/services/surfaceflinger/Layer.h
@@ -83,6 +83,8 @@ public:
virtual void onRemoved();
virtual bool setBypass(bool enable);
+ void updateBuffersOrientation();
+
inline sp<GraphicBuffer> getBypassBuffer() const {
return mBufferManager.getActiveBuffer(); }
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 5e9e06cd0447..af0f95a25c1c 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -725,8 +725,12 @@ void SurfaceFlinger::setBypassLayer(const sp<LayerBase>& layer)
{
// if this layer is already the bypass layer, do nothing
sp<Layer> cur(mBypassLayer.promote());
- if (mBypassLayer == layer)
+ if (mBypassLayer == layer) {
+ if (cur != NULL) {
+ cur->updateBuffersOrientation();
+ }
return;
+ }
// clear the current bypass layer
mBypassLayer.clear();