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

Unified Diff: ui/gl/gl_surface_ozone.cc

Issue 1436993002: Remove return bool in SurfaceOzoneEGL::OnSwapBuffersAsync (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . 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 | « no previous file | ui/ozone/platform/cast/surface_ozone_egl_cast.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gl/gl_surface_ozone.cc
diff --git a/ui/gl/gl_surface_ozone.cc b/ui/gl/gl_surface_ozone.cc
index 978c982315a611baf1cb7daac2851431bae80082..a75680c9ffae0a68cb96cd27d7ec19e952292730 100644
--- a/ui/gl/gl_surface_ozone.cc
+++ b/ui/gl/gl_surface_ozone.cc
@@ -388,9 +388,14 @@ void GLSurfaceOzoneSurfaceless::SubmitFrame() {
unsubmitted_frames_.weak_erase(unsubmitted_frames_.begin());
swap_buffers_pending_ = true;
- last_swap_buffers_result_ =
- frame->ScheduleOverlayPlanes(widget_) &&
- ozone_surface_->OnSwapBuffersAsync(frame->callback);
+ if (!frame->ScheduleOverlayPlanes(widget_)) {
+ // |callback| is a wrapper for SwapCompleted(). Call it to properly
+ // propagate the failed state.
+ frame->callback.Run(gfx::SwapResult::SWAP_FAILED);
+ return;
+ }
+
+ ozone_surface_->OnSwapBuffersAsync(frame->callback);
}
}
@@ -413,6 +418,10 @@ void GLSurfaceOzoneSurfaceless::SwapCompleted(
gfx::SwapResult result) {
callback.Run(result);
swap_buffers_pending_ = false;
+ if (result == gfx::SwapResult::SWAP_FAILED) {
+ last_swap_buffers_result_ = false;
+ return;
+ }
SubmitFrame();
}
« no previous file with comments | « no previous file | ui/ozone/platform/cast/surface_ozone_egl_cast.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698