@@ -205,13 +205,7 @@ bool AngleSurfaceManager::CreateSurface(WindowsRenderTarget* render_target,
205205
206206 EGLSurface surface = EGL_NO_SURFACE;
207207
208- // Disable Angle's automatic surface sizing logic and provide and exlicit
209- // size. AngleSurfaceManager is responsible for initiating Angle surface size
210- // changes to avoid race conditions with rendering when automatic mode is
211- // used.
212- const EGLint surfaceAttributes[] = {
213- EGL_FIXED_SIZE_ANGLE, EGL_TRUE, EGL_WIDTH, width,
214- EGL_HEIGHT, height, EGL_NONE};
208+ const EGLint surfaceAttributes[] = {EGL_NONE};
215209
216210#ifdef WINUWP
217211#ifdef USECOREWINDOW
@@ -244,19 +238,9 @@ void AngleSurfaceManager::ResizeSurface(WindowsRenderTarget* render_target,
244238 EGLint existing_width, existing_height;
245239 GetSurfaceDimensions (&existing_width, &existing_height);
246240 if (width != existing_width || height != existing_height) {
247- // Destroy existing surface with previous stale dimensions and create new
248- // surface at new size. Since the Windows compositor retains the front
249- // buffer until the new surface has been presented, no need to manually
250- // preserve the previous surface contents. This resize approach could be
251- // further optimized if Angle exposed a public entrypoint for
252- // SwapChain11::reset or SwapChain11::resize.
253- // a possible starting point for that could build on
254- // eglPostSubBufferNV(egl_display_, render_surface_, 1, 1, width, height);
255- DestroySurface ();
256- if (!CreateSurface (render_target, width, height)) {
257- std::cerr << " AngleSurfaceManager::ResizeSurface failed to create surface"
258- << std::endl;
259- }
241+ // Resize render_surface_. Internaly this calls mSwapChain->ResizeBuffers
242+ // avoiding the need to destory and recreate the underlying SwapChain.
243+ eglPostSubBufferNV (egl_display_, render_surface_, 1 , 1 , width, height);
260244 }
261245}
262246
0 commit comments