@@ -228,6 +228,8 @@ bool AngleSurfaceManager::CreateSurface(WindowsRenderTarget* render_target,
228228 LogEglError (" Surface creation failed." );
229229 }
230230
231+ surface_width_ = width;
232+ surface_height_ = height;
231233 render_surface_ = surface;
232234 return true ;
233235}
@@ -240,19 +242,24 @@ void AngleSurfaceManager::ResizeSurface(WindowsRenderTarget* render_target,
240242 if (width != existing_width || height != existing_height) {
241243 // Resize render_surface_. Internaly this calls mSwapChain->ResizeBuffers
242244 // avoiding the need to destory and recreate the underlying SwapChain.
245+ surface_width_ = width;
246+ surface_height_ = height;
243247 eglPostSubBufferNV (egl_display_, render_surface_, 1 , 1 , width, height);
244248 }
245249}
246250
247251void AngleSurfaceManager::GetSurfaceDimensions (EGLint* width, EGLint* height) {
248252 if (render_surface_ == EGL_NO_SURFACE || !initialize_succeeded_) {
249- width = 0 ;
250- height = 0 ;
253+ * width = 0 ;
254+ * height = 0 ;
251255 return ;
252256 }
253257
254- eglQuerySurface (egl_display_, render_surface_, EGL_WIDTH, width);
255- eglQuerySurface (egl_display_, render_surface_, EGL_HEIGHT, height);
258+ // Can't use eglQuerySurface here; Because we're not using
259+ // EGL_FIXED_SIZE_ANGLE flag anymore, Angle may resize the surface before
260+ // Flutter asks it to, which breaks resize redraw synchronization
261+ *width = surface_width_;
262+ *height = surface_height_;
256263}
257264
258265void AngleSurfaceManager::DestroySurface () {
0 commit comments