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

Unified Diff: ui/ozone/platform/drm/gpu/gbm_surface.cc

Issue 1084173004: Adding status to swap complete (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix ozone demo Created 5 years, 7 months 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/ozone/platform/drm/gpu/gbm_surface.h ('k') | ui/ozone/platform/drm/gpu/gbm_surfaceless.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/ozone/platform/drm/gpu/gbm_surface.cc
diff --git a/ui/ozone/platform/drm/gpu/gbm_surface.cc b/ui/ozone/platform/drm/gpu/gbm_surface.cc
index 8b5b167bc85a3d9eefa3e0b0ffbf59cd9af9827c..08a32f44d7bf7c9c09fc83a49151deaaeb11bb5e 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
« no previous file with comments | « ui/ozone/platform/drm/gpu/gbm_surface.h ('k') | ui/ozone/platform/drm/gpu/gbm_surfaceless.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698