aboutsummaryrefslogtreecommitdiffstats
path: root/include/system
diff options
context:
space:
mode:
authorMichael I. Gold <gold@nvidia.com>2012-04-09 18:21:13 -0700
committerJamie Gennis <jgennis@google.com>2012-04-10 18:15:48 -0700
commitafcdef635718985aae26e5f94c21ae4f3248a0b9 (patch)
tree1fc9d951e80e966921f4a888e988708c9cb70aa1 /include/system
parent720d598280e5ebd3fb7c845a2a11520bb646d645 (diff)
downloadsystem_core-afcdef635718985aae26e5f94c21ae4f3248a0b9.tar.gz
system_core-afcdef635718985aae26e5f94c21ae4f3248a0b9.tar.bz2
system_core-afcdef635718985aae26e5f94c21ae4f3248a0b9.zip
window: add API for native_window_set_buffers_user_dimensions
Add token and wrapper function for a new private function native_window_set_buffers_user_dimensions which overrides the native window size as the default buffer size. This is intended for use primarily by ANativeWindow_SetBuffersGeometry so that application-set buffer dimensions may co-exist with pre-rotation in e.g. the GLES driver which calls native_window_set_buffers_dimension. Change-Id: I6c0fc334c070290cc15b04daae1484d0a28cd8ad
Diffstat (limited to 'include/system')
-rw-r--r--include/system/window.h36
1 files changed, 32 insertions, 4 deletions
diff --git a/include/system/window.h b/include/system/window.h
index 96024459..3595514b 100644
--- a/include/system/window.h
+++ b/include/system/window.h
@@ -157,9 +157,10 @@ enum {
/*
- * Default width and height of the ANativeWindow, these are the dimensions
- * of the window irrespective of the NATIVE_WINDOW_SET_BUFFERS_DIMENSIONS
- * call.
+ * Default width and height of ANativeWindow buffers, these are the
+ * dimensions of the window buffers irrespective of the
+ * NATIVE_WINDOW_SET_BUFFERS_DIMENSIONS call and match the native window
+ * size unless overriden by NATIVE_WINDOW_SET_BUFFERS_USER_DIMENSIONS.
*/
NATIVE_WINDOW_DEFAULT_WIDTH = 6,
NATIVE_WINDOW_DEFAULT_HEIGHT = 7,
@@ -231,6 +232,7 @@ enum {
NATIVE_WINDOW_UNLOCK_AND_POST = 12, /* private */
NATIVE_WINDOW_API_CONNECT = 13, /* private */
NATIVE_WINDOW_API_DISCONNECT = 14, /* private */
+ NATIVE_WINDOW_SET_BUFFERS_USER_DIMENSIONS = 15, /* private */
};
/* parameter for NATIVE_WINDOW_[API_][DIS]CONNECT */
@@ -417,6 +419,7 @@ struct ANativeWindow
* NATIVE_WINDOW_UNLOCK_AND_POST (private)
* NATIVE_WINDOW_API_CONNECT (private)
* NATIVE_WINDOW_API_DISCONNECT (private)
+ * NATIVE_WINDOW_SET_BUFFERS_USER_DIMENSIONS (private)
*
*/
@@ -527,7 +530,7 @@ static inline int native_window_set_buffers_geometry(
/*
* native_window_set_buffers_dimensions(..., int w, int h)
* All buffers dequeued after this call will have the dimensions specified.
- * In particular, all buffers will have a fixed-size, independent form the
+ * In particular, all buffers will have a fixed-size, independent from the
* native-window size. They will be scaled according to the scaling mode
* (see native_window_set_scaling_mode) upon window composition.
*
@@ -546,6 +549,31 @@ static inline int native_window_set_buffers_dimensions(
}
/*
+ * native_window_set_buffers_user_dimensions(..., int w, int h)
+ *
+ * Sets the user buffer size for the window, which overrides the
+ * window's size. All buffers dequeued after this call will have the
+ * dimensions specified unless overridden by
+ * native_window_set_buffers_dimensions. All buffers will have a
+ * fixed-size, independent from the native-window size. They will be
+ * scaled according to the scaling mode (see
+ * native_window_set_scaling_mode) upon window composition.
+ *
+ * If w and h are 0, the normal behavior is restored. That is, the
+ * default buffer size will match the windows's size.
+ *
+ * Calling this function will reset the window crop to a NULL value, which
+ * disables cropping of the buffers.
+ */
+static inline int native_window_set_buffers_user_dimensions(
+ struct ANativeWindow* window,
+ int w, int h)
+{
+ return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_USER_DIMENSIONS,
+ w, h);
+}
+
+/*
* native_window_set_buffers_format(..., int format)
* All buffers dequeued after this call will have the format specified.
*