src/third_party/angle/src/tests/egl_tests/EGLSurfaceTest.cpp
// Test that the window surface is correctly resized after calling swapBuffers
Test that the window surface is correctly resized after calling swapBuffers
Test that the window surface is correctly resized after calling swapBuffers
TEST_P(EGLSurfaceTest, ResizeWindow)
{
    ANGLE_SKIP_TEST_IF(isVulkanRenderer() && IsLinux() && IsIntel());
    ANGLE_SKIP_TEST_IF(IsLinux() && isSwiftshader());
    setWindowVisible(mOSWindow, true);
    GLenum platform               = GetParam().getRenderer();
    bool platformSupportsZeroSize = platform == EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE ||
                                    platform == EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE;
    int minSize = platformSupportsZeroSize ? 0 : 1;
    initializeDisplay();
    initializeSurfaceWithDefaultConfig(true);
    initializeContext();
    ASSERT_NE(mWindowSurface, EGL_NO_SURFACE);
    eglMakeCurrent(mDisplay, mWindowSurface, mWindowSurface, mContext);
    eglSwapBuffers(mDisplay, mWindowSurface);
    ASSERT_EGL_SUCCESS();
    EGLint height;
    eglQuerySurface(mDisplay, mWindowSurface, EGL_HEIGHT, &height);
    ASSERT_EGL_SUCCESS();
    ASSERT_EQ(64, height);  
    mOSWindow->resize(64, minSize);
    eglSwapBuffers(mDisplay, mWindowSurface);
    ASSERT_EGL_SUCCESS();
    ANGLE_SKIP_TEST_IF(IsLinux() && IsOpenGL());
    eglQuerySurface(mDisplay, mWindowSurface, EGL_HEIGHT, &height);
    ASSERT_EGL_SUCCESS();
    ASSERT_EQ(minSize, height);
    mOSWindow->resize(64, 64);
    eglSwapBuffers(mDisplay, mWindowSurface);
    ASSERT_EGL_SUCCESS();
    eglQuerySurface(mDisplay, mWindowSurface, EGL_HEIGHT, &height);
    ASSERT_EGL_SUCCESS();
    ASSERT_EQ(64, height);
}
TEST_P ( EGLSurfaceTest , ResizeWindow ) { ANGLE_SKIP_TEST_IF ( isVulkanRenderer ( ) && IsLinux ( ) && IsIntel ( ) ) ; ANGLE_SKIP_TEST_IF ( IsLinux ( ) && isSwiftshader ( ) ) ; setWindowVisible ( mOSWindow , true ) ; GLenum platform = GetParam ( ) . getRenderer ( ) ; bool platformSupportsZeroSize = platform == EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE || platform == EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE ; int minSize = platformSupportsZeroSize ? 0 : 1 ; initializeDisplay ( ) ; initializeSurfaceWithDefaultConfig ( true ) ; initializeContext ( ) ; ASSERT_NE ( mWindowSurface , EGL_NO_SURFACE ) ; eglMakeCurrent ( mDisplay , mWindowSurface , mWindowSurface , mContext ) ; eglSwapBuffers ( mDisplay , mWindowSurface ) ; ASSERT_EGL_SUCCESS ( ) ; EGLint height ; eglQuerySurface ( mDisplay , mWindowSurface , EGL_HEIGHT , & height ) ; ASSERT_EGL_SUCCESS ( ) ; ASSERT_EQ ( 64 , height ) ; mOSWindow -> resize ( 64 , minSize ) ; eglSwapBuffers ( mDisplay , mWindowSurface ) ; ASSERT_EGL_SUCCESS ( ) ; ANGLE_SKIP_TEST_IF ( IsLinux ( ) && IsOpenGL ( ) ) ; eglQuerySurface ( mDisplay , mWindowSurface , EGL_HEIGHT , & height ) ; ASSERT_EGL_SUCCESS ( ) ; ASSERT_EQ ( minSize , height ) ; mOSWindow -> resize ( 64 , 64 ) ; eglSwapBuffers ( mDisplay , mWindowSurface ) ; ASSERT_EGL_SUCCESS ( ) ; eglQuerySurface ( mDisplay , mWindowSurface , EGL_HEIGHT , & height ) ; ASSERT_EGL_SUCCESS ( ) ; ASSERT_EQ ( 64 , height ) ; }
Test that the window surface is correctly resized after calling swapBuffers
Test that the window surface is correctly resized after calling swapBuffers
// http://anglebug.com/4453 // Flaky on Linux SwANGLE http://anglebug.com/4453 // Necessary for a window resizing test if there is no per-frame window size query // initial size // set window's height to 0 (if possible) or 1 // TODO(syoussefi): the GLX implementation still reads the window size as 64x64 through // XGetGeometry.  http://anglebug.com/3122 // restore window's height