summaryrefslogtreecommitdiffstats
path: root/gpu/command_buffer
diff options
context:
space:
mode:
Diffstat (limited to 'gpu/command_buffer')
-rw-r--r--gpu/command_buffer/service/gl_surface_mock.h8
-rw-r--r--gpu/command_buffer/service/gles2_cmd_decoder.cc5
2 files changed, 8 insertions, 5 deletions
diff --git a/gpu/command_buffer/service/gl_surface_mock.h b/gpu/command_buffer/service/gl_surface_mock.h
index 0652be6..1d756d4 100644
--- a/gpu/command_buffer/service/gl_surface_mock.h
+++ b/gpu/command_buffer/service/gl_surface_mock.h
@@ -5,8 +5,9 @@
#ifndef GPU_COMMAND_BUFFER_SERVICE_GL_SURFACE_MOCK_H_
#define GPU_COMMAND_BUFFER_SERVICE_GL_SURFACE_MOCK_H_
-#include "ui/gl/gl_surface.h"
#include "testing/gmock/include/gmock/gmock.h"
+#include "ui/gfx/swap_result.h"
+#include "ui/gl/gl_surface.h"
namespace gpu {
@@ -18,8 +19,9 @@ class GLSurfaceMock : public gfx::GLSurface {
MOCK_METHOD0(Destroy, void());
MOCK_METHOD1(Resize, bool(const gfx::Size& size));
MOCK_METHOD0(IsOffscreen, bool());
- MOCK_METHOD0(SwapBuffers, bool());
- MOCK_METHOD4(PostSubBuffer, bool(int x, int y, int width, int height));
+ MOCK_METHOD0(SwapBuffers, gfx::SwapResult());
+ MOCK_METHOD4(PostSubBuffer,
+ gfx::SwapResult(int x, int y, int width, int height));
MOCK_METHOD0(SupportsPostSubBuffer, bool());
MOCK_METHOD0(GetSize, gfx::Size());
MOCK_METHOD0(GetHandle, void*());
diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc
index 1e8e80f..951bbd6 100644
--- a/gpu/command_buffer/service/gles2_cmd_decoder.cc
+++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc
@@ -8485,7 +8485,8 @@ error::Error GLES2DecoderImpl::HandlePostSubBufferCHROMIUM(
gpu_state_tracer_->TakeSnapshotWithCurrentFramebuffer(
is_offscreen ? offscreen_size_ : surface_->GetSize());
}
- if (surface_->PostSubBuffer(c.x, c.y, c.width, c.height)) {
+ if (surface_->PostSubBuffer(c.x, c.y, c.width, c.height) !=
+ gfx::SwapResult::SWAP_FAILED) {
return error::kNoError;
} else {
LOG(ERROR) << "Context lost because PostSubBuffer failed.";
@@ -11018,7 +11019,7 @@ void GLES2DecoderImpl::DoSwapBuffers() {
glFlush();
}
} else {
- if (!surface_->SwapBuffers()) {
+ if (surface_->SwapBuffers() == gfx::SwapResult::SWAP_FAILED) {
LOG(ERROR) << "Context lost because SwapBuffers failed.";
if (!CheckResetStatus()) {
MarkContextLost(error::kUnknown);