diff options
Diffstat (limited to 'chrome/gpu')
-rw-r--r-- | chrome/gpu/gpu_command_buffer_stub.cc | 17 | ||||
-rw-r--r-- | chrome/gpu/gpu_command_buffer_stub.h | 4 |
2 files changed, 21 insertions, 0 deletions
diff --git a/chrome/gpu/gpu_command_buffer_stub.cc b/chrome/gpu/gpu_command_buffer_stub.cc index 2834c00..1adb22c 100644 --- a/chrome/gpu/gpu_command_buffer_stub.cc +++ b/chrome/gpu/gpu_command_buffer_stub.cc @@ -113,6 +113,14 @@ void GpuCommandBufferStub::OnInitialize( NewCallback(this, &GpuCommandBufferStub::SwapBuffersCallback)); } +#elif defined(OS_LINUX) + if (handle_) { + // Set up a pathway to allow the Gpu process to ask the browser + // for a window resize. + processor_->SetResizeCallback( + NewCallback(this, + &GpuCommandBufferStub::ResizeCallback)); + } #endif } else { processor_.reset(); @@ -203,4 +211,13 @@ void GpuCommandBufferStub::SwapBuffersCallback() { } #endif // defined(OS_MACOSX) +#if defined(OS_LINUX) +void GpuCommandBufferStub::ResizeCallback(gfx::Size size) { + ChildThread* gpu_thread = ChildThread::current(); + bool result = false; + gpu_thread->Send( + new GpuHostMsg_ResizeXID(handle_, size, &result)); +} +#endif // defined(OS_LINUX) + #endif // ENABLE_GPU diff --git a/chrome/gpu/gpu_command_buffer_stub.h b/chrome/gpu/gpu_command_buffer_stub.h index fe8b743..1a1e9be 100644 --- a/chrome/gpu/gpu_command_buffer_stub.h +++ b/chrome/gpu/gpu_command_buffer_stub.h @@ -72,6 +72,10 @@ class GpuCommandBufferStub void SwapBuffersCallback(); #endif +#if defined(OS_LINUX) + void ResizeCallback(gfx::Size size); +#endif + // The lifetime of objects of this class is managed by a GpuChannel. The // GpuChannels destroy all the GpuCommandBufferStubs that they own when they // are destroyed. So a raw pointer is safe. |