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

Unified Diff: ui/gl/gl_surface.h

Issue 1477593002: gpu: Initial implementation of CommitOverlayPlanes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@add-cop-command
Patch Set: Remove NativeViewGLSurfaceEGL changes Created 5 years, 1 month 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 | « gpu/ipc/gpu_command_buffer_traits_multi.h ('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 f9de4fd5e7fc840bfbad2100697efc1b17e75a68..1f4bfbba4ed9890b5b775fadcf801884990892b9 100644
--- a/ui/gl/gl_surface.h
+++ b/ui/gl/gl_surface.h
@@ -70,6 +70,9 @@ class GL_EXPORT GLSurface : public base::RefCounted<GLSurface> {
// Returns whether or not the surface supports PostSubBuffer.
virtual bool SupportsPostSubBuffer();
+ // Returns whether or not the surface supports CommitOverlayPlanes.
+ virtual bool SupportsCommitOverlayPlanes();
+
// Returns whether SwapBuffersAsync() is supported.
virtual bool SupportsAsyncSwap();
@@ -99,6 +102,18 @@ class GL_EXPORT GLSurface : public base::RefCounted<GLSurface> {
int height,
const SwapCompletionCallback& callback);
+ // Show overlay planes but don't swap the front and back buffers. This acts
+ // like SwapBuffers from the point of view of the client, but is cheaper when
+ // overlays account for all the damage.
+ virtual gfx::SwapResult CommitOverlayPlanes();
+
+ // Show overlay planes but don't swap the front and back buffers. On some
+ // platforms, we want to send SwapBufferAck only after the overlays are
+ // 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 CommitOverlayPlanesAsync is called).
+ virtual void CommitOverlayPlanesAsync(const SwapCompletionCallback& callback);
+
// Initialize GL bindings.
static bool InitializeOneOff();
@@ -132,7 +147,8 @@ class GL_EXPORT GLSurface : public base::RefCounted<GLSurface> {
// of screen refresh. If unavailable, returns NULL.
virtual VSyncProvider* GetVSyncProvider();
- // Schedule an overlay plane to be shown at swap time.
+ // Schedule an overlay plane to be shown at swap time, or on the next
+ // CommitOverlayPlanes call.
// |z_order| specifies the stacking order of the plane relative to the
// main framebuffer located at index 0. For the case where there is no
// main framebuffer, overlays may be scheduled at 0, taking its place.
@@ -220,7 +236,11 @@ class GL_EXPORT GLSurfaceAdapter : public GLSurface {
int width,
int height,
const SwapCompletionCallback& callback) override;
+ gfx::SwapResult CommitOverlayPlanes() override;
+ void CommitOverlayPlanesAsync(
+ const SwapCompletionCallback& callback) override;
bool SupportsPostSubBuffer() override;
+ bool SupportsCommitOverlayPlanes() override;
bool SupportsAsyncSwap() override;
gfx::Size GetSize() override;
void* GetHandle() override;
« no previous file with comments | « gpu/ipc/gpu_command_buffer_traits_multi.h ('k') | ui/gl/gl_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698