fix camera API 2.0 orientation
we add a flag to ANativeWindow::setBufferTransform that means
"apply the inverse rotation of the display this buffer is displayed
onto to".
Bug: 10804238
Change-Id: Id2447676271950463e8dbcef1b95935c5c3f32b2
diff --git a/services/surfaceflinger/SurfaceFlingerConsumer.h b/services/surfaceflinger/SurfaceFlingerConsumer.h
index c7fc164..688ad32 100644
--- a/services/surfaceflinger/SurfaceFlingerConsumer.h
+++ b/services/surfaceflinger/SurfaceFlingerConsumer.h
@@ -40,6 +40,8 @@
virtual ~BufferRejecter() { }
};
+ virtual status_t acquireBufferLocked(BufferQueue::BufferItem *item, nsecs_t presentWhen);
+
// This version of updateTexImage() takes a functor that may be used to
// reject the newly acquired buffer. Unlike the GLConsumer version,
// this does not guarantee that the buffer has been bound to the GL
@@ -49,8 +51,16 @@
// See GLConsumer::bindTextureImageLocked().
status_t bindTextureImage();
+ // must be called from SF main thread
+ bool getTransformToDisplayInverse() const;
+
private:
nsecs_t computeExpectedPresent();
+
+ // Indicates this buffer must be transformed by the inverse transform of the screen
+ // it is displayed onto. This is applied after GLConsumer::mCurrentTransform.
+ // This must be set/read from SurfaceFlinger's main thread.
+ bool mTransformToDisplayInverse;
};
// ----------------------------------------------------------------------------