diff options
| author | Jamie Gennis <jgennis@google.com> | 2011-07-08 13:51:31 -0700 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-07-08 13:51:31 -0700 |
| commit | 6b06f9f48dde2802218cade3fdb12a4fed5f46f6 (patch) | |
| tree | 89d8f1ca85201c0b4eda98350f5b4b21419802fc /include | |
| parent | 7da24861ea933db3bd27509f91717b5c63fd6dde (diff) | |
| parent | 208ec5ec564597bdf8b478a424cc9ccc09547bac (diff) | |
| download | core-6b06f9f48dde2802218cade3fdb12a4fed5f46f6.tar.gz core-6b06f9f48dde2802218cade3fdb12a4fed5f46f6.tar.bz2 core-6b06f9f48dde2802218cade3fdb12a4fed5f46f6.zip | |
Merge "ANativeWindow: add setters for dimensions and fmt"
Diffstat (limited to 'include')
| -rw-r--r-- | include/system/window.h | 50 |
1 files changed, 42 insertions, 8 deletions
diff --git a/include/system/window.h b/include/system/window.h index eef567db1..a990a09c2 100644 --- a/include/system/window.h +++ b/include/system/window.h @@ -165,6 +165,8 @@ enum { NATIVE_WINDOW_SET_BUFFERS_GEOMETRY, NATIVE_WINDOW_SET_BUFFERS_TRANSFORM, NATIVE_WINDOW_SET_BUFFERS_TIMESTAMP, + NATIVE_WINDOW_SET_BUFFERS_DIMENSIONS, + NATIVE_WINDOW_SET_BUFFERS_FORMAT, }; /* parameter for NATIVE_WINDOW_[DIS]CONNECT */ @@ -306,6 +308,8 @@ struct ANativeWindow * NATIVE_WINDOW_SET_BUFFERS_GEOMETRY * NATIVE_WINDOW_SET_BUFFERS_TRANSFORM * NATIVE_WINDOW_SET_BUFFERS_TIMESTAMP + * NATIVE_WINDOW_SET_BUFFERS_DIMENSIONS + * NATIVE_WINDOW_SET_BUFFERS_FORMAT * */ @@ -404,23 +408,53 @@ static inline int native_window_set_buffer_count( /* * native_window_set_buffers_geometry(..., int w, int h, int format) - * All buffers dequeued after this call will have the geometry specified. + * All buffers dequeued after this call will have the dimensions and format + * specified. A successful call to this function has the same effect as calling + * native_window_set_buffers_size and native_window_set_buffers_format. + * + * XXX: This function is deprecated. The native_window_set_buffers_dimensions + * and native_window_set_buffers_format functions should be used instead. + */ +static inline int native_window_set_buffers_geometry( + struct ANativeWindow* window, + int w, int h, int format) +{ + return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_GEOMETRY, + w, h, format); +} + +/* + * 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 * native-window size. They will be appropriately scaled to the window-size - * upon composition. + * upon window composition. * - * 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. + * If w and h are 0, the normal behavior is restored. That is, dequeued buffers + * following this call will be sized to match 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( +static inline int native_window_set_buffers_dimensions( struct ANativeWindow* window, - int w, int h, int format) + int w, int h) { - return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_GEOMETRY, - w, h, format); + return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_DIMENSIONS, + w, h); +} + +/* + * native_window_set_buffers_format(..., int format) + * All buffers dequeued after this call will have the format specified. + * + * If the specified format is 0, the default buffer format will be used. + */ +static inline int native_window_set_buffers_format( + struct ANativeWindow* window, + int format) +{ + return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_FORMAT, format); } /* |
