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

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: Created 5 years, 8 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
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 80c84f98b73cad5e78a75f5dfac7a74cf7b2cf23..dfdd168b160d87bdde832a6286960a84442d6d0d 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(int) {
+}
+
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::SwapFailed);
return false;
}
}
@@ -156,7 +159,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::SwapFailed);
return false;
}
@@ -164,13 +167,14 @@ bool GbmSurface::OnSwapBuffersAsync(const SwapCompletionCallback& callback) {
}
void GbmSurface::OnSwapBuffersCallback(const SwapCompletionCallback& callback,
- gbm_bo* pending_buffer) {
+ gbm_bo* pending_buffer,
+ int 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

Powered by Google App Engine
This is Rietveld 408576698