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

Side by Side Diff: chrome/gpu/gpu_command_buffer_stub.cc

Issue 5105006: Resize synchronization for Linux. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Handle resize in GpuCommandBufferStub instead of GLContext. Created 10 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/gpu/gpu_command_buffer_stub.h ('k') | gfx/gtk_preserve_window.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #if defined(ENABLE_GPU) 5 #if defined(ENABLE_GPU)
6 6
7 #include "base/process_util.h" 7 #include "base/process_util.h"
8 #include "base/shared_memory.h" 8 #include "base/shared_memory.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "chrome/common/child_thread.h" 10 #include "chrome/common/child_thread.h"
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 if (handle_) { 107 if (handle_) {
108 // This context conceptually puts its output directly on the 108 // This context conceptually puts its output directly on the
109 // screen, rendered by the accelerated plugin layer in 109 // screen, rendered by the accelerated plugin layer in
110 // RenderWidgetHostViewMac. Set up a pathway to notify the 110 // RenderWidgetHostViewMac. Set up a pathway to notify the
111 // browser process when its contents change. 111 // browser process when its contents change.
112 processor_->SetSwapBuffersCallback( 112 processor_->SetSwapBuffersCallback(
113 NewCallback(this, 113 NewCallback(this,
114 &GpuCommandBufferStub::SwapBuffersCallback)); 114 &GpuCommandBufferStub::SwapBuffersCallback));
115 } 115 }
116 #endif 116 #endif
117 #if defined(OS_LINUX)
nduca 2010/11/23 21:03:51 hmm, elif?
118 if (handle_) {
119 // Set up a pathway to allow the Gpu process to ask the browser
120 // for a window resize.
121 processor_->SetResizeCallback(
122 NewCallback(this,
123 &GpuCommandBufferStub::ResizeCallback));
124 }
125 #endif
117 } else { 126 } else {
118 processor_.reset(); 127 processor_.reset();
119 command_buffer_.reset(); 128 command_buffer_.reset();
120 } 129 }
121 } 130 }
122 } 131 }
123 } 132 }
124 133
125 void GpuCommandBufferStub::OnGetState(gpu::CommandBuffer::State* state) { 134 void GpuCommandBufferStub::OnGetState(gpu::CommandBuffer::State* state) {
126 *state = command_buffer_->GetState(); 135 *state = command_buffer_->GetState();
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 } 205 }
197 } 206 }
198 207
199 void GpuCommandBufferStub::SwapBuffersCallback() { 208 void GpuCommandBufferStub::SwapBuffersCallback() {
200 ChildThread* gpu_thread = ChildThread::current(); 209 ChildThread* gpu_thread = ChildThread::current();
201 gpu_thread->Send(new GpuHostMsg_AcceleratedSurfaceBuffersSwapped( 210 gpu_thread->Send(new GpuHostMsg_AcceleratedSurfaceBuffersSwapped(
202 renderer_id_, render_view_id_, handle_, processor_->GetSurfaceId())); 211 renderer_id_, render_view_id_, handle_, processor_->GetSurfaceId()));
203 } 212 }
204 #endif // defined(OS_MACOSX) 213 #endif // defined(OS_MACOSX)
205 214
215 #if defined(OS_LINUX)
216 void GpuCommandBufferStub::ResizeCallback(gfx::Size size) {
217 ChildThread* gpu_thread = ChildThread::current();
218 bool result = false;
219 gpu_thread->Send(
220 new GpuHostMsg_ResizeXID(handle_, size, &result));
221 }
222 #endif // defined(OS_LINUX)
223
206 #endif // ENABLE_GPU 224 #endif // ENABLE_GPU
OLDNEW
« no previous file with comments | « chrome/gpu/gpu_command_buffer_stub.h ('k') | gfx/gtk_preserve_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698