ui/gl: Gracefully handle failure to schedule the main overlay plane.

Each swap for a surfaceless surface must have at least one overlay plane,
for the OutputSurface, before SwapBuffers is issued. The SurfaceControl
surface assumes this and will crash in SwapBuffers if at least one plane
has not been scheduled.

Crash reports indicate that we have cases where
glScheduleOverlayPlaneCHROMIUM, presumably for the main plane, fails and
we end up crashing during CommitPendingTransaction as a result. Handle
this failure better by reporting a failed swap, which should always lose
the context and recreate the surface.

R=piman@chromium.org

Bug: 977812
Change-Id: I53028e5494d5da39d91d1f685913c46ec9a1bb4f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1673026
Commit-Queue: Khushal <khushalsagar@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Auto-Submit: Khushal <khushalsagar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#671757}
2 files changed