summaryrefslogtreecommitdiffstats
path: root/ui/gl/gl_surface.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ui/gl/gl_surface.cc')
-rw-r--r--ui/gl/gl_surface.cc24
1 files changed, 14 insertions, 10 deletions
diff --git a/ui/gl/gl_surface.cc b/ui/gl/gl_surface.cc
index 4769092..8a60ca5 100644
--- a/ui/gl/gl_surface.cc
+++ b/ui/gl/gl_surface.cc
@@ -12,6 +12,7 @@
#include "base/logging.h"
#include "base/threading/thread_local.h"
#include "base/trace_event/trace_event.h"
+#include "ui/gfx/swap_result.h"
#include "ui/gl/gl_context.h"
#include "ui/gl/gl_implementation.h"
#include "ui/gl/gl_switches.h"
@@ -194,13 +195,13 @@ unsigned int GLSurface::GetBackingFrameBufferObject() {
bool GLSurface::SwapBuffersAsync(const SwapCompletionCallback& callback) {
DCHECK(!IsSurfaceless());
- bool success = SwapBuffers();
- callback.Run();
- return success;
+ gfx::SwapResult result = SwapBuffers();
+ callback.Run(result);
+ return result == gfx::SwapResult::SWAP_ACK;
}
-bool GLSurface::PostSubBuffer(int x, int y, int width, int height) {
- return false;
+gfx::SwapResult GLSurface::PostSubBuffer(int x, int y, int width, int height) {
+ return gfx::SwapResult::SWAP_FAILED;
}
bool GLSurface::PostSubBufferAsync(int x,
@@ -208,9 +209,9 @@ bool GLSurface::PostSubBufferAsync(int x,
int width,
int height,
const SwapCompletionCallback& callback) {
- bool success = PostSubBuffer(x, y, width, height);
- callback.Run();
- return success;
+ gfx::SwapResult result = PostSubBuffer(x, y, width, height);
+ callback.Run(result);
+ return result == gfx::SwapResult::SWAP_ACK;
}
bool GLSurface::OnMakeCurrent(GLContext* context) {
@@ -319,7 +320,7 @@ bool GLSurfaceAdapter::IsOffscreen() {
return surface_->IsOffscreen();
}
-bool GLSurfaceAdapter::SwapBuffers() {
+gfx::SwapResult GLSurfaceAdapter::SwapBuffers() {
return surface_->SwapBuffers();
}
@@ -328,7 +329,10 @@ bool GLSurfaceAdapter::SwapBuffersAsync(
return surface_->SwapBuffersAsync(callback);
}
-bool GLSurfaceAdapter::PostSubBuffer(int x, int y, int width, int height) {
+gfx::SwapResult GLSurfaceAdapter::PostSubBuffer(int x,
+ int y,
+ int width,
+ int height) {
return surface_->PostSubBuffer(x, y, width, height);
}