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

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
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)
« no previous file with comments | « no previous file | chrome/renderer/pepper_platform_context_3d_impl.h » ('j') | webkit/plugins/ppapi/ppb_surface_3d_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698