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..1c152c9c3eb58f50d9fc4f98e670a6f27a1a3c7d 100644 |
--- a/ui/gl/gl_surface_ozone.cc |
+++ b/ui/gl/gl_surface_ozone.cc |
@@ -388,9 +388,13 @@ 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); |
+ } else { |
+ ozone_surface_->OnSwapBuffersAsync(frame->callback); |
spang
2015/11/12 01:34:07
I think you should return in the error path instea
dnicoara
2015/11/12 15:16:52
Done.
|
+ } |
} |
} |
@@ -413,8 +417,10 @@ void GLSurfaceOzoneSurfaceless::SwapCompleted( |
gfx::SwapResult result) { |
callback.Run(result); |
swap_buffers_pending_ = false; |
- |
- SubmitFrame(); |
+ if (result == gfx::SwapResult::SWAP_FAILED) |
+ last_swap_buffers_result_ = false; |
+ else |
+ SubmitFrame(); |
spang
2015/11/12 01:34:07
same comment, avoid putting success path flow into
dnicoara
2015/11/12 15:16:52
Done.
|
} |
// This provides surface-like semantics implemented through surfaceless. |