diff options
author | achaulk <achaulk@chromium.org> | 2015-05-28 18:36:21 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-05-29 01:36:56 +0000 |
commit | c794eda78e9ba3c46b550b433e9fe5a248d40104 (patch) | |
tree | 8054088552654845102920183531ee33d1c12914 /gpu | |
parent | bcb07449ce226e9263cf4f2637a1656377782e17 (diff) | |
download | chromium_src-c794eda78e9ba3c46b550b433e9fe5a248d40104.zip chromium_src-c794eda78e9ba3c46b550b433e9fe5a248d40104.tar.gz chromium_src-c794eda78e9ba3c46b550b433e9fe5a248d40104.tar.bz2 |
Adding status to swap buffers completion
This will give us more options than completing all swaps successfully, or losing context
BUG=476966
TBR=torne - approved interface change
Review URL: https://codereview.chromium.org/1084173004
Cr-Commit-Position: refs/heads/master@{#331906}
Diffstat (limited to 'gpu')
-rw-r--r-- | gpu/command_buffer/service/gl_surface_mock.h | 8 | ||||
-rw-r--r-- | gpu/command_buffer/service/gles2_cmd_decoder.cc | 5 |
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); |