Index: ui/gl/gl_surface.cc |
diff --git a/ui/gl/gl_surface.cc b/ui/gl/gl_surface.cc |
index 3de560bbca4bdb97ec57d653c46e2ae833b518c7..d4b421c61c78bfc625b5a2422bc6dd97acbc61ca 100644 |
--- a/ui/gl/gl_surface.cc |
+++ b/ui/gl/gl_surface.cc |
@@ -191,10 +191,27 @@ unsigned int GLSurface::GetBackingFrameBufferObject() { |
return 0; |
} |
+bool GLSurface::SwapBuffersAsync(const SwapCompletionCallback& callback) { |
+ DCHECK(!IsSurfaceless()); |
+ bool success = SwapBuffers(); |
+ callback.Run(); |
+ return success; |
+} |
+ |
bool GLSurface::PostSubBuffer(int x, int y, int width, int height) { |
return false; |
} |
+bool GLSurface::PostSubBufferAsync(int x, |
+ int y, |
+ int width, |
+ int height, |
+ const SwapCompletionCallback& callback) { |
+ bool success = PostSubBuffer(x, y, width, height); |
+ callback.Run(); |
+ return success; |
+} |
+ |
bool GLSurface::OnMakeCurrent(GLContext* context) { |
return true; |
} |
@@ -302,10 +319,21 @@ bool GLSurfaceAdapter::SwapBuffers() { |
return surface_->SwapBuffers(); |
} |
+bool GLSurfaceAdapter::SwapBuffersAsync( |
+ const SwapCompletionCallback& callback) { |
+ return surface_->SwapBuffersAsync(callback); |
+} |
+ |
bool GLSurfaceAdapter::PostSubBuffer(int x, int y, int width, int height) { |
return surface_->PostSubBuffer(x, y, width, height); |
} |
+bool GLSurfaceAdapter::PostSubBufferAsync( |
+ int x, int y, int width, int height, |
+ const SwapCompletionCallback& callback) { |
+ return surface_->PostSubBufferAsync(x, y, width, height, callback); |
+} |
+ |
bool GLSurfaceAdapter::SupportsPostSubBuffer() { |
return surface_->SupportsPostSubBuffer(); |
} |