Chromium Code Reviews| Index: chrome/gpu/gpu_command_buffer_stub.cc |
| diff --git a/chrome/gpu/gpu_command_buffer_stub.cc b/chrome/gpu/gpu_command_buffer_stub.cc |
| index 930f6f57a09b78c096b5561027e1504650a9cb6d..3894daccc385c11fc8704b3755a1326d34a00883 100644 |
| --- a/chrome/gpu/gpu_command_buffer_stub.cc |
| +++ b/chrome/gpu/gpu_command_buffer_stub.cc |
| @@ -257,15 +257,13 @@ void GpuCommandBufferStub::OnInitialize( |
| NewCallback(this, |
| &GpuCommandBufferStub::SwapBuffersCallback)); |
| } |
| -#elif defined(OS_LINUX) || defined(OS_WIN) |
| - if (handle_) { |
| - // Set up a pathway for resizing the output window at the right time |
| - // relative to other GL commands. |
| - processor_->SetResizeCallback( |
| - NewCallback(this, |
| - &GpuCommandBufferStub::ResizeCallback)); |
| - } |
| #endif // defined(OS_MACOSX) |
| + |
| + // Set up a pathway for resizing the output window or framebuffer at the |
| + // right time relative to other GL commands. |
| + processor_->SetResizeCallback( |
| + NewCallback(this, |
|
neb
2011/01/25 19:16:06
This can fit on the same line, no?
Antoine Labour
2011/01/25 19:32:24
Done.
|
| + &GpuCommandBufferStub::ResizeCallback)); |
| } else { |
| processor_.reset(); |
| command_buffer_.reset(); |
| @@ -375,20 +373,22 @@ void GpuCommandBufferStub::AcceleratedSurfaceBuffersSwapped( |
| #endif // defined(OS_MACOSX) |
| void GpuCommandBufferStub::ResizeCallback(gfx::Size size) { |
| - if (handle_ == gfx::kNullPluginWindow) |
| - return; |
| - |
| + if (handle_ == gfx::kNullPluginWindow) { |
| + processor_->decoder()->ResizeOffscreenFrameBuffer(size); |
| + processor_->decoder()->UpdateOffscreenFrameBufferSize(); |
| + } else { |
| #if defined(OS_LINUX) |
| - GpuThread* gpu_thread = channel_->gpu_thread(); |
| - bool result = false; |
| - gpu_thread->Send( |
| - new GpuHostMsg_ResizeXID(handle_, size, &result)); |
| + GpuThread* gpu_thread = channel_->gpu_thread(); |
| + bool result = false; |
| + gpu_thread->Send( |
| + new GpuHostMsg_ResizeXID(handle_, size, &result)); |
| #elif defined(OS_WIN) |
| - HWND hwnd = static_cast<HWND>(compositor_window_); |
| - UINT swp_flags = SWP_NOSENDCHANGING | SWP_NOOWNERZORDER | SWP_NOCOPYBITS | |
| - SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_DEFERERASE; |
| - SetWindowPos(hwnd, NULL, 0, 0, size.width(), size.height(), swp_flags); |
| + HWND hwnd = static_cast<HWND>(compositor_window_); |
| + UINT swp_flags = SWP_NOSENDCHANGING | SWP_NOOWNERZORDER | SWP_NOCOPYBITS | |
| + SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE | SWP_DEFERERASE; |
| + SetWindowPos(hwnd, NULL, 0, 0, size.width(), size.height(), swp_flags); |
| #endif // defined(OS_LINUX) |
| + } |
| } |
| #endif // defined(ENABLE_GPU) |