| Index: ui/gl/gl_surface.h
|
| diff --git a/ui/gl/gl_surface.h b/ui/gl/gl_surface.h
|
| index 1302cce4e5331b558a502e4311fac3a1ed7e529a..7905a84ec55c22237fcf69f4477bc6cef6e7a514 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,26 @@ 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.
|
| + 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.
|
| + virtual bool PostSubBufferAsync(int x,
|
| + int y,
|
| + int width,
|
| + int height,
|
| + const SwapCompletionCallback& callback);
|
| +
|
| // Initialize GL bindings.
|
| static bool InitializeOneOff();
|
|
|
| @@ -169,7 +187,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;
|
|
|