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

Unified Diff: ui/gl/gl_surface.h

Issue 817653003: Update from https://crrev.com/309717 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: 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_implementation_x11.cc ('k') | ui/gl/gl_surface.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_surface.h
diff --git a/ui/gl/gl_surface.h b/ui/gl/gl_surface.h
index c218267e01d2ae887da58e4343e46d71c6045848..220bda6806e284b89802834807491d283b62bc38 100644
--- a/ui/gl/gl_surface.h
+++ b/ui/gl/gl_surface.h
@@ -7,6 +7,7 @@
#include <string>
+#include "base/callback.h"
#include "base/memory/ref_counted.h"
#include "build/build_config.h"
#include "ui/gfx/native_widget_types.h"
@@ -72,9 +73,28 @@ class GL_EXPORT GLSurface : public base::RefCounted<GLSurface> {
// FBO. Otherwise returns 0.
virtual unsigned int GetBackingFrameBufferObject();
+ typedef base::Callback<void()> SwapCompletionCallback;
+ // Swaps front and back buffers. This has no effect for off-screen
+ // contexts. On some platforms, we want to send SwapBufferAck only after the
+ // surface is displayed on screen. The callback can be used to delay sending
+ // SwapBufferAck till that data is available. The callback should be run on
+ // the calling thread (i.e. same thread SwapBuffersAsync is called)
+ virtual bool SwapBuffersAsync(const SwapCompletionCallback& callback);
+
// Copy part of the backbuffer to the frontbuffer.
virtual bool PostSubBuffer(int x, int y, int width, int height);
+ // Copy part of the backbuffer to the frontbuffer. On some platforms, we want
+ // to send SwapBufferAck only after the surface is displayed on screen. The
+ // callback can be used to delay sending SwapBufferAck till that data is
+ // available. The callback should be run on the calling thread (i.e. same
+ // thread PostSubBufferAsync is called)
+ virtual bool PostSubBufferAsync(int x,
+ int y,
+ int width,
+ int height,
+ const SwapCompletionCallback& callback);
+
// Initialize GL bindings.
static bool InitializeOneOff(GLImplementation = kGLImplementationNone);
@@ -173,7 +193,13 @@ class GL_EXPORT GLSurfaceAdapter : public GLSurface {
bool DeferDraws() override;
bool IsOffscreen() override;
bool SwapBuffers() override;
+ bool SwapBuffersAsync(const SwapCompletionCallback& callback) override;
bool PostSubBuffer(int x, int y, int width, int height) override;
+ bool PostSubBufferAsync(int x,
+ int y,
+ int width,
+ int height,
+ const SwapCompletionCallback& callback) override;
bool SupportsPostSubBuffer() override;
gfx::Size GetSize() override;
void* GetHandle() override;
« no previous file with comments | « ui/gl/gl_implementation_x11.cc ('k') | ui/gl/gl_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698