summaryrefslogtreecommitdiffstats
path: root/include/ui
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2010-05-21 14:19:50 -0700
committerMathias Agopian <mathias@google.com>2010-05-21 14:34:32 -0700
commitf10d7fde03218c17251416a34d7b726a43ec528a (patch)
tree4a3cc07b0b73c47fcb875e0e3e5e64c8318504cc /include/ui
parent3e23593d2f93e4449e22fdc0c9614cd119929084 (diff)
downloadframeworks_native-f10d7fde03218c17251416a34d7b726a43ec528a.zip
frameworks_native-f10d7fde03218c17251416a34d7b726a43ec528a.tar.gz
frameworks_native-f10d7fde03218c17251416a34d7b726a43ec528a.tar.bz2
added native_window_set_buffer_count()
this method can be used to change the number of buffers associated to a native window. the default is two. Change-Id: I608b959e6b29d77f95edb23c31dc9b099a758f2f
Diffstat (limited to 'include/ui')
-rw-r--r--include/ui/egl/android_natives.h30
1 files changed, 22 insertions, 8 deletions
diff --git a/include/ui/egl/android_natives.h b/include/ui/egl/android_natives.h
index 49bfa2b..b44901f 100644
--- a/include/ui/egl/android_natives.h
+++ b/include/ui/egl/android_natives.h
@@ -81,6 +81,7 @@ enum {
NATIVE_WINDOW_CONNECT,
NATIVE_WINDOW_DISCONNECT,
NATIVE_WINDOW_SET_CROP,
+ NATIVE_WINDOW_SET_BUFFER_COUNT,
};
/* parameter for NATIVE_WINDOW_[DIS]CONNECT */
@@ -190,6 +191,7 @@ typedef struct android_native_window_t
* NATIVE_WINDOW_CONNECT
* NATIVE_WINDOW_DISCONNECT
* NATIVE_WINDOW_SET_CROP
+ * NATIVE_WINDOW_SET_BUFFER_COUNT
*
*/
@@ -201,8 +203,9 @@ typedef struct android_native_window_t
/*
- * native_window_set_usage() sets the intended usage flags for the next
- * buffers acquired with (*lockBuffer)() and on.
+ * native_window_set_usage(..., usage)
+ * Sets the intended usage flags for the next buffers
+ * acquired with (*lockBuffer)() and on.
* By default (if this function is never called), a usage of
* GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_TEXTURE
* is assumed.
@@ -217,8 +220,8 @@ static inline int native_window_set_usage(
}
/*
- * native_window_connect(..., NATIVE_WINDOW_API_EGL) must be called
- * by EGL when the window is made current.
+ * native_window_connect(..., NATIVE_WINDOW_API_EGL)
+ * Must be called by EGL when the window is made current.
* Returns -EINVAL if for some reason the window cannot be connected, which
* can happen if it's connected to some other API.
*/
@@ -229,8 +232,8 @@ static inline int native_window_connect(
}
/*
- * native_window_disconnect(..., NATIVE_WINDOW_API_EGL) must be called
- * by EGL when the window is made not current.
+ * native_window_disconnect(..., NATIVE_WINDOW_API_EGL)
+ * Must be called by EGL when the window is made not current.
* An error is returned if for instance the window wasn't connected in the
* first place.
*/
@@ -241,8 +244,8 @@ static inline int native_window_disconnect(
}
/*
- * native_window_set_crop(..., crop) sets which region of the next queued
- * buffers needs to be considered.
+ * native_window_set_crop(..., crop)
+ * Sets which region of the next queued buffers needs to be considered.
* A buffer's crop region is scaled to match the surface's size.
*
* The specified crop region applies to all buffers queued after it is called.
@@ -259,6 +262,17 @@ static inline int native_window_set_crop(
return window->perform(window, NATIVE_WINDOW_SET_CROP, crop);
}
+/*
+ * native_window_set_buffer_count(..., count)
+ * Sets the number of buffers associated with this native window.
+ */
+static inline int native_window_set_buffer_count(
+ android_native_window_t* window,
+ size_t bufferCount)
+{
+ return window->perform(window, NATIVE_WINDOW_SET_BUFFER_COUNT, bufferCount);
+}
+
// ---------------------------------------------------------------------------
/* FIXME: this is legacy for pixmaps */