Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Unified Diff: chrome/gpu/gpu_command_buffer_stub.cc

Issue 6241015: Make Pepper resize the buffer through the command buffer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/renderer/pepper_platform_context_3d_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..43a1be50335c9d6e58cba968b89536f6a43dd720 100644
--- a/chrome/gpu/gpu_command_buffer_stub.cc
+++ b/chrome/gpu/gpu_command_buffer_stub.cc
@@ -257,15 +257,12 @@ 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, &GpuCommandBufferStub::ResizeCallback));
} else {
processor_.reset();
command_buffer_.reset();
@@ -375,20 +372,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)
« no previous file with comments | « no previous file | chrome/renderer/pepper_platform_context_3d_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698