Chromium Code Reviews| Index: gpu/command_buffer/service/gles2_cmd_decoder.cc |
| diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc |
| index c3402d9b59590b1a11fb4f11218c9ad91c1443ff..6ba9e5799d8de5c8dac2e8d7469cdc0d63b526bd 100644 |
| --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc |
| +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc |
| @@ -483,6 +483,8 @@ class GLES2DecoderImpl : public base::SupportsWeakPtr<GLES2DecoderImpl>, |
| virtual void SetResizeCallback(Callback1<gfx::Size>::Type* callback); |
| + virtual void SetSurfaceVisibleCallback(Callback1<bool>::Type* callback); |
| + |
| #if defined(OS_MACOSX) |
| virtual void SetSwapBuffersCallback(Callback0::Type* callback); |
| #endif |
| @@ -1291,6 +1293,8 @@ class GLES2DecoderImpl : public base::SupportsWeakPtr<GLES2DecoderImpl>, |
| scoped_ptr<Callback1<gfx::Size>::Type> resize_callback_; |
| + scoped_ptr<Callback1<bool>::Type> surface_visible_callback_; |
| + |
| #if defined(OS_MACOSX) |
| scoped_ptr<Callback0::Type> swap_buffers_callback_; |
| #endif |
| @@ -2336,6 +2340,11 @@ void GLES2DecoderImpl::SetResizeCallback( |
| resize_callback_.reset(callback); |
| } |
| +void GLES2DecoderImpl::SetSurfaceVisibleCallback( |
| + Callback1<bool>::Type* callback) { |
| + surface_visible_callback_.reset(callback); |
| +} |
| + |
| #if defined(OS_MACOSX) |
| void GLES2DecoderImpl::SetSwapBuffersCallback(Callback0::Type* callback) { |
| swap_buffers_callback_.reset(callback); |
| @@ -2620,6 +2629,18 @@ error::Error GLES2DecoderImpl::HandleResizeCHROMIUM( |
| return error::kNoError; |
| } |
| +error::Error GLES2DecoderImpl::HandleSetSurfaceVisibleCHROMIUM( |
| + uint32 immediate_data_size, const gles2::SetSurfaceVisibleCHROMIUM& c) { |
| + bool visible = !!static_cast<GLboolean>(c.visible); |
| + TRACE_EVENT1("gpu", "glSetSurfaceVisibleChromium", "visible", visible); |
|
jonathan.backer
2011/10/07 15:48:37
I'm not sure if this should be upstreamed. Not all
|
| + |
| + if (surface_visible_callback_.get()) { |
| + surface_visible_callback_->Run(visible); |
| + } |
| + |
| + return error::kNoError; |
| +} |
| + |
| const char* GLES2DecoderImpl::GetCommandName(unsigned int command_id) const { |
| if (command_id > kStartPoint && command_id < kNumCommands) { |
| return gles2::GetCommandName(static_cast<CommandId>(command_id)); |