Index: ui/gl/gl_surface_egl.cc |
diff --git a/ui/gl/gl_surface_egl.cc b/ui/gl/gl_surface_egl.cc |
index 3b81daf83285a476768cb724f7facde9bbca8950..b57655651a041845d2fb9fb4bd0c91ff6e24ba59 100644 |
--- a/ui/gl/gl_surface_egl.cc |
+++ b/ui/gl/gl_surface_egl.cc |
@@ -399,18 +399,30 @@ bool NativeViewGLSurfaceEGL::Resize(const gfx::Size& size) { |
if (was_current) |
current_context->ReleaseCurrent(this); |
- Destroy(); |
+ Recreate(); |
+ |
+ if (was_current) |
+ return current_context->MakeCurrent(this); |
+ return true; |
+} |
+bool NativeViewGLSurfaceEGL::Recreate() { |
+ Destroy(); |
if (!Initialize()) { |
- LOG(ERROR) << "Failed to resize pbuffer."; |
+ LOG(ERROR) << "Failed to create surface."; |
return false; |
} |
- |
- if (was_current) |
- return current_context->MakeCurrent(this); |
return true; |
} |
+bool NativeViewGLSurfaceEGL::RecreateOnMakeCurrent() { |
+ return recreate_on_make_current_; |
+} |
+ |
+void NativeViewGLSurfaceEGL::SetRecreateOnMakeCurrent(bool recreate) { |
+ recreate_on_make_current_ = recreate; |
+} |
+ |
EGLSurface NativeViewGLSurfaceEGL::GetHandle() { |
return surface_; |
} |