Loading core/jni/android_app_NativeActivity.cpp +6 −2 Original line number Diff line number Diff line Loading @@ -362,8 +362,12 @@ onSurfaceChanged_native(JNIEnv* env, jobject clazz, jint handle, jobject surface sp<ANativeWindow> oldNativeWindow = code->nativeWindow; code->setSurface(surface); if (oldNativeWindow != code->nativeWindow) { if (code->nativeWindow != NULL && code->callbacks.onNativeWindowChanged != NULL) { code->callbacks.onNativeWindowChanged(&code->activity, if (oldNativeWindow != NULL && code->callbacks.onNativeWindowDestroyed != NULL) { code->callbacks.onNativeWindowDestroyed(&code->activity, oldNativeWindow.get()); } if (code->nativeWindow != NULL && code->callbacks.onNativeWindowCreated != NULL) { code->callbacks.onNativeWindowCreated(&code->activity, code->nativeWindow.get()); } } Loading native/android/native_window.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -39,3 +39,9 @@ int32_t ANativeWindow_getHeight(ANativeWindow* window) { int32_t ANativeWindow_getFormat(ANativeWindow* window) { return getWindowProp(window, NATIVE_WINDOW_FORMAT); } int32_t ANativeWindow_setBuffersGeometry(ANativeWindow* window, int32_t width, int32_t height, int32_t format) { native_window_set_buffers_geometry(window, width, height, format); return 0; } native/include/android/native_activity.h +0 −8 Original line number Diff line number Diff line Loading @@ -131,14 +131,6 @@ typedef struct ANativeActivityCallbacks { */ void (*onNativeWindowCreated)(ANativeActivity* activity, ANativeWindow* window); /** * The drawing window for this native activity has changed. During this time, * old ANativeWindow object is still valid but no longer active and drawing * should switch to the new ANativeWindow given here. After returning from * this function, you must not touch the old window. */ void (*onNativeWindowChanged)(ANativeActivity* activity, ANativeWindow* window); /** * The drawing window for this native activity is going to be destroyed. * You MUST ensure that you do not touch the window object after returning Loading native/include/android/native_window.h +25 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,15 @@ extern "C" { #endif /* * Pixel formats that a window can use. */ enum { WINDOW_FORMAT_RGBA_8888 = 1, WINDOW_FORMAT_RGBX_8888 = 2, WINDOW_FORMAT_RGB_565 = 4, }; struct ANativeWindow; typedef struct ANativeWindow ANativeWindow; Loading @@ -43,6 +52,22 @@ int32_t ANativeWindow_getHeight(ANativeWindow* window); */ int32_t ANativeWindow_getFormat(ANativeWindow* window); /* * Change the format and size of the window buffers. * * The width and height control the number of pixels in the buffers, not the * dimensions of the window on screen. If these are different than the * window's physical size, then it buffer will be scaled to match that size * when compositing it to the screen. * * The format may be one of the window format constants above. * * For all of these parameters, if 0 is supplied than the window's base * value will come back in force. */ int32_t ANativeWindow_setBuffersGeometry(ANativeWindow* window, int32_t width, int32_t height, int32_t format); #ifdef __cplusplus }; #endif Loading Loading
core/jni/android_app_NativeActivity.cpp +6 −2 Original line number Diff line number Diff line Loading @@ -362,8 +362,12 @@ onSurfaceChanged_native(JNIEnv* env, jobject clazz, jint handle, jobject surface sp<ANativeWindow> oldNativeWindow = code->nativeWindow; code->setSurface(surface); if (oldNativeWindow != code->nativeWindow) { if (code->nativeWindow != NULL && code->callbacks.onNativeWindowChanged != NULL) { code->callbacks.onNativeWindowChanged(&code->activity, if (oldNativeWindow != NULL && code->callbacks.onNativeWindowDestroyed != NULL) { code->callbacks.onNativeWindowDestroyed(&code->activity, oldNativeWindow.get()); } if (code->nativeWindow != NULL && code->callbacks.onNativeWindowCreated != NULL) { code->callbacks.onNativeWindowCreated(&code->activity, code->nativeWindow.get()); } } Loading
native/android/native_window.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -39,3 +39,9 @@ int32_t ANativeWindow_getHeight(ANativeWindow* window) { int32_t ANativeWindow_getFormat(ANativeWindow* window) { return getWindowProp(window, NATIVE_WINDOW_FORMAT); } int32_t ANativeWindow_setBuffersGeometry(ANativeWindow* window, int32_t width, int32_t height, int32_t format) { native_window_set_buffers_geometry(window, width, height, format); return 0; }
native/include/android/native_activity.h +0 −8 Original line number Diff line number Diff line Loading @@ -131,14 +131,6 @@ typedef struct ANativeActivityCallbacks { */ void (*onNativeWindowCreated)(ANativeActivity* activity, ANativeWindow* window); /** * The drawing window for this native activity has changed. During this time, * old ANativeWindow object is still valid but no longer active and drawing * should switch to the new ANativeWindow given here. After returning from * this function, you must not touch the old window. */ void (*onNativeWindowChanged)(ANativeActivity* activity, ANativeWindow* window); /** * The drawing window for this native activity is going to be destroyed. * You MUST ensure that you do not touch the window object after returning Loading
native/include/android/native_window.h +25 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,15 @@ extern "C" { #endif /* * Pixel formats that a window can use. */ enum { WINDOW_FORMAT_RGBA_8888 = 1, WINDOW_FORMAT_RGBX_8888 = 2, WINDOW_FORMAT_RGB_565 = 4, }; struct ANativeWindow; typedef struct ANativeWindow ANativeWindow; Loading @@ -43,6 +52,22 @@ int32_t ANativeWindow_getHeight(ANativeWindow* window); */ int32_t ANativeWindow_getFormat(ANativeWindow* window); /* * Change the format and size of the window buffers. * * The width and height control the number of pixels in the buffers, not the * dimensions of the window on screen. If these are different than the * window's physical size, then it buffer will be scaled to match that size * when compositing it to the screen. * * The format may be one of the window format constants above. * * For all of these parameters, if 0 is supplied than the window's base * value will come back in force. */ int32_t ANativeWindow_setBuffersGeometry(ANativeWindow* window, int32_t width, int32_t height, int32_t format); #ifdef __cplusplus }; #endif Loading