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

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

Issue 5317007: Add flow control between renderer and GPU processes, and, on Mac OS X,... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years 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
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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 gpu_thread->Send(new GpuHostMsg_AcceleratedSurfaceSetIOSurface(params)); 190 gpu_thread->Send(new GpuHostMsg_AcceleratedSurfaceSetIOSurface(params));
191 } else { 191 } else {
192 // TODO(kbr): figure out what to do here. It wouldn't be difficult 192 // TODO(kbr): figure out what to do here. It wouldn't be difficult
193 // to support the compositor on 10.5, but the performance would be 193 // to support the compositor on 10.5, but the performance would be
194 // questionable. 194 // questionable.
195 NOTREACHED(); 195 NOTREACHED();
196 } 196 }
197 } 197 }
198 198
199 void GpuCommandBufferStub::SwapBuffersCallback() { 199 void GpuCommandBufferStub::SwapBuffersCallback() {
200 OnSwapBuffers();
200 ChildThread* gpu_thread = ChildThread::current(); 201 ChildThread* gpu_thread = ChildThread::current();
201 gpu_thread->Send(new GpuHostMsg_AcceleratedSurfaceBuffersSwapped( 202 GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params params;
202 renderer_id_, render_view_id_, handle_, processor_->GetSurfaceId())); 203 params.renderer_id = renderer_id_;
204 params.render_view_id = render_view_id_;
205 params.window = handle_;
206 params.surface_id = processor_->GetSurfaceId();
207 params.route_id = route_id();
208 #if defined(OS_MACOSX)
209 params.swap_buffers_count = processor_->swap_buffers_count();
210 #endif
211 gpu_thread->Send(new GpuHostMsg_AcceleratedSurfaceBuffersSwapped(params));
212 }
213
214 void GpuCommandBufferStub::AcceleratedSurfaceBuffersSwapped(
215 uint64 swap_buffers_count) {
216 processor_->set_acknowledged_swap_buffers_count(swap_buffers_count);
217 // Wake up the GpuProcessor to start doing work again.
218 processor_->ScheduleProcessCommands();
203 } 219 }
204 #endif // defined(OS_MACOSX) 220 #endif // defined(OS_MACOSX)
205 221
206 #endif // ENABLE_GPU 222 #endif // ENABLE_GPU
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698