diff options
Diffstat (limited to 'native')
-rw-r--r-- | native/android/native_window.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/native/android/native_window.cpp b/native/android/native_window.cpp index 5c016c4..36fc9bf 100644 --- a/native/android/native_window.cpp +++ b/native/android/native_window.cpp @@ -76,7 +76,15 @@ int32_t ANativeWindow_getFormat(ANativeWindow* window) { int32_t ANativeWindow_setBuffersGeometry(ANativeWindow* window, int32_t width, int32_t height, int32_t format) { - return native_window_set_buffers_geometry(window, width, height, format); + int32_t err = native_window_set_buffers_geometry(window, width, height, 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); + } + return err; } int32_t ANativeWindow_lock(ANativeWindow* window, ANativeWindow_Buffer* outBuffer, |