summaryrefslogtreecommitdiff
path: root/libs/nativewindow/ANativeWindow.cpp
diff options
context:
space:
mode:
author Robert Carr <racarr@google.com> 2018-04-06 13:59:00 -0700
committer Robert Carr <racarr@google.com> 2018-04-06 13:59:00 -0700
commit175ed5bade222558de483a7b875e9ab42576fda2 (patch)
tree6d79ca5a5d6baa9db2fdce6a2316d93b643c730b /libs/nativewindow/ANativeWindow.cpp
parent0d5aac13b1d0cab7837f03ec7cfe4bc73152e7b4 (diff)
ANativeWindow_setBuffersTransform: Allow forwarding INVERSE_DISPLAY
For OpenGL based camera viewfinder implementations, we want to let them read the Transform bit off the original camera API provided image and forward it to their OpenGL surface so they can achieve the same rotation functionality. Bug: 74400997 Test: Manual Change-Id: Idccd977e6d885b1b12de019faa98b564cc7baf48
Diffstat (limited to 'libs/nativewindow/ANativeWindow.cpp')
-rw-r--r--libs/nativewindow/ANativeWindow.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/libs/nativewindow/ANativeWindow.cpp b/libs/nativewindow/ANativeWindow.cpp
index 2598451ad3..765dcd9973 100644
--- a/libs/nativewindow/ANativeWindow.cpp
+++ b/libs/nativewindow/ANativeWindow.cpp
@@ -113,7 +113,10 @@ int32_t ANativeWindow_setBuffersTransform(ANativeWindow* window, int32_t transfo
constexpr int32_t kAllTransformBits =
ANATIVEWINDOW_TRANSFORM_MIRROR_HORIZONTAL |
ANATIVEWINDOW_TRANSFORM_MIRROR_VERTICAL |
- ANATIVEWINDOW_TRANSFORM_ROTATE_90;
+ ANATIVEWINDOW_TRANSFORM_ROTATE_90 |
+ // We don't expose INVERSE_DISPLAY as an NDK constant, but someone could have read it
+ // from a buffer already set by Camera framework, so we allow it to be forwarded.
+ NATIVE_WINDOW_TRANSFORM_INVERSE_DISPLAY;
if (!window || !query(window, NATIVE_WINDOW_IS_VALID))
return -EINVAL;
if ((transform & ~kAllTransformBits) != 0)