diff options
author | achaulk <achaulk@chromium.org> | 2015-05-28 18:36:21 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-05-29 01:36:56 +0000 |
commit | c794eda78e9ba3c46b550b433e9fe5a248d40104 (patch) | |
tree | 8054088552654845102920183531ee33d1c12914 /ui/ozone/platform/drm/gpu/gbm_surface.cc | |
parent | bcb07449ce226e9263cf4f2637a1656377782e17 (diff) | |
download | chromium_src-c794eda78e9ba3c46b550b433e9fe5a248d40104.zip chromium_src-c794eda78e9ba3c46b550b433e9fe5a248d40104.tar.gz chromium_src-c794eda78e9ba3c46b550b433e9fe5a248d40104.tar.bz2 |
Adding status to swap buffers completion
This will give us more options than completing all swaps successfully, or losing context
BUG=476966
TBR=torne - approved interface change
Review URL: https://codereview.chromium.org/1084173004
Cr-Commit-Position: refs/heads/master@{#331906}
Diffstat (limited to 'ui/ozone/platform/drm/gpu/gbm_surface.cc')
-rw-r--r-- | ui/ozone/platform/drm/gpu/gbm_surface.cc | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/ui/ozone/platform/drm/gpu/gbm_surface.cc b/ui/ozone/platform/drm/gpu/gbm_surface.cc index 8b5b167..08a32f4 100644 --- a/ui/ozone/platform/drm/gpu/gbm_surface.cc +++ b/ui/ozone/platform/drm/gpu/gbm_surface.cc @@ -19,6 +19,9 @@ namespace ui { namespace { +void DoNothing(gfx::SwapResult) { +} + class GbmSurfaceBuffer : public GbmBufferBase { public: static scoped_refptr<GbmSurfaceBuffer> CreateBuffer( @@ -131,7 +134,7 @@ bool GbmSurface::ResizeNativeWindow(const gfx::Size& viewport_size) { } bool GbmSurface::OnSwapBuffers() { - return OnSwapBuffersAsync(base::Bind(&base::DoNothing)); + return OnSwapBuffersAsync(base::Bind(&DoNothing)); } bool GbmSurface::OnSwapBuffersAsync(const SwapCompletionCallback& callback) { @@ -144,7 +147,7 @@ bool GbmSurface::OnSwapBuffersAsync(const SwapCompletionCallback& callback) { primary = GbmSurfaceBuffer::CreateBuffer(gbm_, pending_buffer); if (!primary.get()) { LOG(ERROR) << "Failed to associate the buffer with the controller"; - callback.Run(); + callback.Run(gfx::SwapResult::SWAP_FAILED); return false; } } @@ -155,7 +158,7 @@ bool GbmSurface::OnSwapBuffersAsync(const SwapCompletionCallback& callback) { if (!GbmSurfaceless::OnSwapBuffersAsync( base::Bind(&GbmSurface::OnSwapBuffersCallback, weak_factory_.GetWeakPtr(), callback, pending_buffer))) { - callback.Run(); + callback.Run(gfx::SwapResult::SWAP_FAILED); return false; } @@ -163,13 +166,14 @@ bool GbmSurface::OnSwapBuffersAsync(const SwapCompletionCallback& callback) { } void GbmSurface::OnSwapBuffersCallback(const SwapCompletionCallback& callback, - gbm_bo* pending_buffer) { + gbm_bo* pending_buffer, + gfx::SwapResult result) { // If there was a frontbuffer, it is no longer active. Release it back to GBM. if (current_buffer_) gbm_surface_release_buffer(native_surface_, current_buffer_); current_buffer_ = pending_buffer; - callback.Run(); + callback.Run(result); } } // namespace ui |