summaryrefslogtreecommitdiffstats
path: root/native
diff options
context:
space:
mode:
authorMichael I. Gold <gold@nvidia.com>2012-04-09 19:51:55 -0700
committerJamie Gennis <jgennis@google.com>2012-04-10 18:15:47 -0700
commit0e5ed706a2a7c85ddb11bcac55a6e210f725c3f9 (patch)
tree5a569d941bd660a061aa4b95021a4b93f94293e8 /native
parent54ae14749bc7f9e73cfda35a8b49f9efa80a77fb (diff)
downloadframeworks_base-0e5ed706a2a7c85ddb11bcac55a6e210f725c3f9.zip
frameworks_base-0e5ed706a2a7c85ddb11bcac55a6e210f725c3f9.tar.gz
frameworks_base-0e5ed706a2a7c85ddb11bcac55a6e210f725c3f9.tar.bz2
ANativeWindow: support for application buffer dimensions
Make the NDK use the new native_window_set_buffers_user_dimensions to implement the ANativeWindow_setBuffersGeometry call. Change-Id: I2d5981cbd619ee2e090fe8f2ddc69217915c9d9e
Diffstat (limited to 'native')
-rw-r--r--native/android/native_window.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/native/android/native_window.cpp b/native/android/native_window.cpp
index c58ee00..99c0fd3 100644
--- a/native/android/native_window.cpp
+++ b/native/android/native_window.cpp
@@ -60,13 +60,16 @@ int32_t ANativeWindow_getFormat(ANativeWindow* window) {
int32_t ANativeWindow_setBuffersGeometry(ANativeWindow* window, int32_t width,
int32_t height, int32_t format) {
- int32_t err = native_window_set_buffers_geometry(window, width, height, format);
+ int32_t err = native_window_set_buffers_format(window, format);
if (!err) {
- int mode = NATIVE_WINDOW_SCALING_MODE_FREEZE;
- if (width && height) {
- mode = NATIVE_WINDOW_SCALING_MODE_SCALE_TO_WINDOW;
- }
- err = native_window_set_scaling_mode(window, mode);
+ err = native_window_set_buffers_user_dimensions(window, width, height);
+ if (!err) {
+ int mode = NATIVE_WINDOW_SCALING_MODE_FREEZE;
+ if (width && height) {
+ mode = NATIVE_WINDOW_SCALING_MODE_SCALE_TO_WINDOW;
+ }
+ err = native_window_set_scaling_mode(window, mode);
+ }
}
return err;
}