diff options
Diffstat (limited to 'include/ui/egl/android_natives.h')
-rw-r--r-- | include/ui/egl/android_natives.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/include/ui/egl/android_natives.h b/include/ui/egl/android_natives.h index 654d0f3..0fc1ddf 100644 --- a/include/ui/egl/android_natives.h +++ b/include/ui/egl/android_natives.h @@ -75,6 +75,49 @@ enum { NATIVE_WINDOW_WIDTH = 0, NATIVE_WINDOW_HEIGHT, NATIVE_WINDOW_FORMAT, + + /* The minimum number of buffers that must remain un-dequeued after a buffer + * has been queued. This value applies only if set_buffer_count was used to + * override the number of buffers and if a buffer has since been queued. + * Users of the set_buffer_count ANativeWindow method should query this + * value before calling set_buffer_count. If it is necessary to have N + * buffers simultaneously dequeued as part of the steady-state operation, + * and this query returns M then N+M buffers should be requested via + * native_window_set_buffer_count. + * + * Note that this value does NOT apply until a single buffer has been + * queued. In particular this means that it is possible to: + * + * 1. Query M = min undequeued buffers + * 2. Set the buffer count to N + M + * 3. Dequeue all N + M buffers + * 4. Cancel M buffers + * 5. Queue, dequeue, queue, dequeue, ad infinitum + */ + NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS, + + /* Check whether queueBuffer operations on the ANativeWindow send the buffer + * to the window compositor. The query sets the returned 'value' argument + * to 1 if the ANativeWindow DOES send queued buffers directly to the window + * compositor and 0 if the buffers do not go directly to the window + * compositor. + * + * This can be used to determine whether protected buffer content should be + * sent to the ANativeWindow. Note, however, that a result of 1 does NOT + * indicate that queued buffers will be protected from applications or users + * capturing their contents. If that behavior is desired then some other + * mechanism (e.g. the GRALLOC_USAGE_PROTECTED flag) should be used in + * conjunction with this query. + */ + NATIVE_WINDOW_QUEUES_TO_WINDOW_COMPOSER, + + /* Get the concrete type of a ANativeWindow. See below for the list of + * possible return values. + * + * This query should not be used outside the Android framework and will + * likely be removed in the near future. + */ + NATIVE_WINDOW_CONCRETE_TYPE, }; /* valid operations for the (*perform)() hook */ @@ -107,6 +150,13 @@ enum { NATIVE_WINDOW_TRANSFORM_ROT_270 = HAL_TRANSFORM_ROT_270, }; +/* values returned by the NATIVE_WINDOW_CONCRETE_TYPE query */ +enum { + NATIVE_WINDOW_FRAMEBUFFER, // FramebufferNativeWindow + NATIVE_WINDOW_SURFACE, // Surface + NATIVE_WINDOW_SURFACE_TEXTURE_CLIENT, // SurfaceTextureClient +}; + struct ANativeWindow { #ifdef __cplusplus @@ -315,6 +365,8 @@ static inline int native_window_set_buffer_count( * If all parameters are 0, the normal behavior is restored. That is, * dequeued buffers following this call will be sized to the window'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_geometry( ANativeWindow* window, |