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

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

Issue 6343006: Route IPC through browser when creating a viewable command buffer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Some final cleanup before review. 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 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 #include "chrome/gpu/gpu_thread.h" 5 #include "chrome/gpu/gpu_thread.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "app/gfx/gl/gl_context.h" 10 #include "app/gfx/gl/gl_context.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 gpu_channels_.erase(renderer_id); 62 gpu_channels_.erase(renderer_id);
63 } 63 }
64 64
65 bool GpuThread::OnControlMessageReceived(const IPC::Message& msg) { 65 bool GpuThread::OnControlMessageReceived(const IPC::Message& msg) {
66 bool msg_is_ok = true; 66 bool msg_is_ok = true;
67 bool handled = true; 67 bool handled = true;
68 IPC_BEGIN_MESSAGE_MAP_EX(GpuThread, msg, msg_is_ok) 68 IPC_BEGIN_MESSAGE_MAP_EX(GpuThread, msg, msg_is_ok)
69 IPC_MESSAGE_HANDLER(GpuMsg_Initialize, OnInitialize) 69 IPC_MESSAGE_HANDLER(GpuMsg_Initialize, OnInitialize)
70 IPC_MESSAGE_HANDLER(GpuMsg_EstablishChannel, OnEstablishChannel) 70 IPC_MESSAGE_HANDLER(GpuMsg_EstablishChannel, OnEstablishChannel)
71 IPC_MESSAGE_HANDLER(GpuMsg_CloseChannel, OnCloseChannel) 71 IPC_MESSAGE_HANDLER(GpuMsg_CloseChannel, OnCloseChannel)
72 IPC_MESSAGE_HANDLER(GpuMsg_CreateViewCommandBuffer,
73 OnCreateViewCommandBuffer);
72 IPC_MESSAGE_HANDLER(GpuMsg_Synchronize, OnSynchronize) 74 IPC_MESSAGE_HANDLER(GpuMsg_Synchronize, OnSynchronize)
73 IPC_MESSAGE_HANDLER(GpuMsg_CollectGraphicsInfo, OnCollectGraphicsInfo) 75 IPC_MESSAGE_HANDLER(GpuMsg_CollectGraphicsInfo, OnCollectGraphicsInfo)
74 #if defined(OS_MACOSX) 76 #if defined(OS_MACOSX)
75 IPC_MESSAGE_HANDLER(GpuMsg_AcceleratedSurfaceBuffersSwappedACK, 77 IPC_MESSAGE_HANDLER(GpuMsg_AcceleratedSurfaceBuffersSwappedACK,
76 OnAcceleratedSurfaceBuffersSwappedACK) 78 OnAcceleratedSurfaceBuffersSwappedACK)
77 IPC_MESSAGE_HANDLER(GpuMsg_DidDestroyAcceleratedSurface, 79 IPC_MESSAGE_HANDLER(GpuMsg_DidDestroyAcceleratedSurface,
78 OnDidDestroyAcceleratedSurface) 80 OnDidDestroyAcceleratedSurface)
79 #endif 81 #endif
80 IPC_MESSAGE_HANDLER(GpuMsg_Crash, OnCrash) 82 IPC_MESSAGE_HANDLER(GpuMsg_Crash, OnCrash)
81 IPC_MESSAGE_HANDLER(GpuMsg_Hang, OnHang) 83 IPC_MESSAGE_HANDLER(GpuMsg_Hang, OnHang)
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 gpu_channels_.erase(iter); 203 gpu_channels_.erase(iter);
202 return; 204 return;
203 } 205 }
204 } 206 }
205 } 207 }
206 208
207 void GpuThread::OnSynchronize() { 209 void GpuThread::OnSynchronize() {
208 Send(new GpuHostMsg_SynchronizeReply()); 210 Send(new GpuHostMsg_SynchronizeReply());
209 } 211 }
210 212
213 void GpuThread::OnCreateViewCommandBuffer(
214 gfx::PluginWindowHandle window,
215 int32 render_view_id,
216 int32 renderer_id,
217 const GPUCreateCommandBufferConfig& init_params) {
218 int32 route_id = MSG_ROUTING_NONE;
219
220 GpuChannelMap::const_iterator iter = gpu_channels_.find(renderer_id);
221 if (iter != gpu_channels_.end())
222 iter->second->CreateViewCommandBuffer(
apatrick 2011/01/26 19:50:05 More than one line so surround with braces.
jonathan.backer 2011/01/26 20:42:17 Done.
223 window, render_view_id, init_params, &route_id);
224
225 Send(new GpuHostMsg_CommandBufferCreated(route_id));
226 }
227
211 void GpuThread::OnCollectGraphicsInfo() { 228 void GpuThread::OnCollectGraphicsInfo() {
212 Send(new GpuHostMsg_GraphicsInfoCollected(gpu_info_)); 229 Send(new GpuHostMsg_GraphicsInfoCollected(gpu_info_));
213 } 230 }
214 231
215 #if defined(OS_MACOSX) 232 #if defined(OS_MACOSX)
216 void GpuThread::OnAcceleratedSurfaceBuffersSwappedACK( 233 void GpuThread::OnAcceleratedSurfaceBuffersSwappedACK(
217 int renderer_id, int32 route_id, uint64 swap_buffers_count) { 234 int renderer_id, int32 route_id, uint64 swap_buffers_count) {
218 GpuChannelMap::const_iterator iter = gpu_channels_.find(renderer_id); 235 GpuChannelMap::const_iterator iter = gpu_channels_.find(renderer_id);
219 if (iter == gpu_channels_.end()) 236 if (iter == gpu_channels_.end())
220 return; 237 return;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 NewRunnableFunction(&GpuThread::SetDxDiagnostics, thread, node)); 276 NewRunnableFunction(&GpuThread::SetDxDiagnostics, thread, node));
260 } 277 }
261 278
262 // Runs on the GPU thread. 279 // Runs on the GPU thread.
263 void GpuThread::SetDxDiagnostics(GpuThread* thread, const DxDiagNode& node) { 280 void GpuThread::SetDxDiagnostics(GpuThread* thread, const DxDiagNode& node) {
264 thread->gpu_info_.SetDxDiagnostics(node); 281 thread->gpu_info_.SetDxDiagnostics(node);
265 thread->gpu_info_.SetProgress(GPUInfo::kComplete); 282 thread->gpu_info_.SetProgress(GPUInfo::kComplete);
266 } 283 }
267 284
268 #endif 285 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698