| Index: ui/gl/gl_surface_ozone.cc
|
| diff --git a/ui/gl/gl_surface_ozone.cc b/ui/gl/gl_surface_ozone.cc
|
| index 7dac123f0d1527cb61fdbaf8986ef12fa4f3ce48..fa5086b64ce22d54eb3af4501063fcbad57f01a5 100644
|
| --- a/ui/gl/gl_surface_ozone.cc
|
| +++ b/ui/gl/gl_surface_ozone.cc
|
| @@ -56,11 +56,11 @@ class GL_EXPORT GLSurfaceOzoneEGL : public NativeViewGLSurfaceEGL {
|
|
|
| return NativeViewGLSurfaceEGL::Resize(size);
|
| }
|
| - bool SwapBuffers() override {
|
| + gfx::SwapResult SwapBuffers() override {
|
| if (!NativeViewGLSurfaceEGL::SwapBuffers())
|
| - return false;
|
| + return gfx::SWAP_FAILED;
|
|
|
| - return ozone_surface_->OnSwapBuffers();
|
| + return ozone_surface_->OnSwapBuffers() ? gfx::SWAP_ACK : gfx::SWAP_FAILED;
|
| }
|
| bool ScheduleOverlayPlane(int z_order,
|
| OverlayTransform transform,
|
| @@ -142,14 +142,14 @@ class GL_EXPORT GLSurfaceOzoneSurfaceless : public SurfacelessEGL {
|
|
|
| return SurfacelessEGL::Resize(size);
|
| }
|
| - bool SwapBuffers() override {
|
| + gfx::SwapResult SwapBuffers() override {
|
| glFlush();
|
| // TODO: the following should be replaced by a per surface flush as it gets
|
| // implemented in GL drivers.
|
| if (has_implicit_external_sync_) {
|
| EGLSyncKHR fence = InsertFence();
|
| if (!fence)
|
| - return false;
|
| + return gfx::SWAP_FAILED;
|
|
|
| EGLDisplay display = GetDisplay();
|
| WaitForFence(display, fence);
|
| @@ -161,7 +161,7 @@ class GL_EXPORT GLSurfaceOzoneSurfaceless : public SurfacelessEGL {
|
| unsubmitted_frames_.back()->ScheduleOverlayPlanes(widget_);
|
| unsubmitted_frames_.back()->overlays.clear();
|
|
|
| - return ozone_surface_->OnSwapBuffers();
|
| + return ozone_surface_->OnSwapBuffers() ? gfx::SWAP_ACK : gfx::SWAP_FAILED;
|
| }
|
| bool ScheduleOverlayPlane(int z_order,
|
| OverlayTransform transform,
|
| @@ -175,10 +175,9 @@ class GL_EXPORT GLSurfaceOzoneSurfaceless : public SurfacelessEGL {
|
| bool IsOffscreen() override { return false; }
|
| VSyncProvider* GetVSyncProvider() override { return vsync_provider_.get(); }
|
| bool SupportsPostSubBuffer() override { return true; }
|
| - bool PostSubBuffer(int x, int y, int width, int height) override {
|
| + gfx::SwapResult PostSubBuffer(int x, int y, int width, int height) override {
|
| // The actual sub buffer handling is handled at higher layers.
|
| - SwapBuffers();
|
| - return true;
|
| + return SwapBuffers();
|
| }
|
| bool SwapBuffersAsync(const SwapCompletionCallback& callback) override {
|
| // If last swap failed, don't try to schedule new ones.
|
| @@ -187,7 +186,7 @@ class GL_EXPORT GLSurfaceOzoneSurfaceless : public SurfacelessEGL {
|
|
|
| glFlush();
|
|
|
| - base::Closure surface_swap_callback =
|
| + SwapCompletionCallback surface_swap_callback =
|
| base::Bind(&GLSurfaceOzoneSurfaceless::SwapCompleted,
|
| weak_factory_.GetWeakPtr(), callback);
|
|
|
| @@ -298,8 +297,9 @@ class GL_EXPORT GLSurfaceOzoneSurfaceless : public SurfacelessEGL {
|
| SubmitFrame();
|
| }
|
|
|
| - void SwapCompleted(const SwapCompletionCallback& callback) {
|
| - callback.Run();
|
| + void SwapCompleted(const SwapCompletionCallback& callback,
|
| + gfx::SwapResult result) {
|
| + callback.Run(result);
|
| swap_buffers_pending_ = false;
|
|
|
| SubmitFrame();
|
| @@ -358,16 +358,16 @@ class GL_EXPORT GLSurfaceOzoneSurfacelessSurfaceImpl
|
|
|
| bool SupportsPostSubBuffer() override { return false; }
|
|
|
| - bool SwapBuffers() override {
|
| + gfx::SwapResult SwapBuffers() override {
|
| if (!images_[current_surface_]->ScheduleOverlayPlane(
|
| widget_, 0, OverlayTransform::OVERLAY_TRANSFORM_NONE,
|
| gfx::Rect(GetSize()), gfx::RectF(1, 1)))
|
| - return false;
|
| + return gfx::SWAP_FAILED;
|
| if (!GLSurfaceOzoneSurfaceless::SwapBuffers())
|
| - return false;
|
| + return gfx::SWAP_FAILED;
|
| current_surface_ ^= 1;
|
| BindFramebuffer();
|
| - return true;
|
| + return gfx::SWAP_ACK;
|
| }
|
|
|
| bool SwapBuffersAsync(const SwapCompletionCallback& callback) override {
|
|
|