Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(294)

Unified Diff: ui/gl/gl_surface.cc

Issue 797843005: Add support to delay sending SwapbufferAck as needed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use WeakptrFactory Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gl/gl_surface.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
« no previous file with comments | « ui/gl/gl_surface.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698