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

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: Fix nit. 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
« no previous file with comments | « chrome/gpu/gpu_thread.h ('k') | chrome/renderer/ggl/ggl.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 #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(
223 window, render_view_id, init_params, &route_id);
224 }
225
226 Send(new GpuHostMsg_CommandBufferCreated(route_id));
227 }
228
211 void GpuThread::OnCollectGraphicsInfo() { 229 void GpuThread::OnCollectGraphicsInfo() {
212 Send(new GpuHostMsg_GraphicsInfoCollected(gpu_info_)); 230 Send(new GpuHostMsg_GraphicsInfoCollected(gpu_info_));
213 } 231 }
214 232
215 #if defined(OS_MACOSX) 233 #if defined(OS_MACOSX)
216 void GpuThread::OnAcceleratedSurfaceBuffersSwappedACK( 234 void GpuThread::OnAcceleratedSurfaceBuffersSwappedACK(
217 int renderer_id, int32 route_id, uint64 swap_buffers_count) { 235 int renderer_id, int32 route_id, uint64 swap_buffers_count) {
218 GpuChannelMap::const_iterator iter = gpu_channels_.find(renderer_id); 236 GpuChannelMap::const_iterator iter = gpu_channels_.find(renderer_id);
219 if (iter == gpu_channels_.end()) 237 if (iter == gpu_channels_.end())
220 return; 238 return;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 NewRunnableFunction(&GpuThread::SetDxDiagnostics, thread, node)); 277 NewRunnableFunction(&GpuThread::SetDxDiagnostics, thread, node));
260 } 278 }
261 279
262 // Runs on the GPU thread. 280 // Runs on the GPU thread.
263 void GpuThread::SetDxDiagnostics(GpuThread* thread, const DxDiagNode& node) { 281 void GpuThread::SetDxDiagnostics(GpuThread* thread, const DxDiagNode& node) {
264 thread->gpu_info_.SetDxDiagnostics(node); 282 thread->gpu_info_.SetDxDiagnostics(node);
265 thread->gpu_info_.SetProgress(GPUInfo::kComplete); 283 thread->gpu_info_.SetProgress(GPUInfo::kComplete);
266 } 284 }
267 285
268 #endif 286 #endif
OLDNEW
« no previous file with comments | « chrome/gpu/gpu_thread.h ('k') | chrome/renderer/ggl/ggl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698