Skip to content

Commit 0e5ed70

Browse files
mig1964Jamie Gennis
authored andcommitted
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
1 parent 54ae147 commit 0e5ed70

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

native/android/native_window.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,16 @@ int32_t ANativeWindow_getFormat(ANativeWindow* window) {
6060

6161
int32_t ANativeWindow_setBuffersGeometry(ANativeWindow* window, int32_t width,
6262
int32_t height, int32_t format) {
63-
int32_t err = native_window_set_buffers_geometry(window, width, height, format);
63+
int32_t err = native_window_set_buffers_format(window, format);
6464
if (!err) {
65-
int mode = NATIVE_WINDOW_SCALING_MODE_FREEZE;
66-
if (width && height) {
67-
mode = NATIVE_WINDOW_SCALING_MODE_SCALE_TO_WINDOW;
68-
}
69-
err = native_window_set_scaling_mode(window, mode);
65+
err = native_window_set_buffers_user_dimensions(window, width, height);
66+
if (!err) {
67+
int mode = NATIVE_WINDOW_SCALING_MODE_FREEZE;
68+
if (width && height) {
69+
mode = NATIVE_WINDOW_SCALING_MODE_SCALE_TO_WINDOW;
70+
}
71+
err = native_window_set_scaling_mode(window, mode);
72+
}
7073
}
7174
return err;
7275
}

0 commit comments

Comments
 (0)