Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/common/gpu/gpu_channel_manager.h" | 5 #include "content/common/gpu/gpu_channel_manager.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "content/common/gpu/gpu_channel.h" | 9 #include "content/common/gpu/gpu_channel.h" |
| 10 #include "content/common/gpu/gpu_memory_manager.h" | 10 #include "content/common/gpu/gpu_memory_manager.h" |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 103 | 103 |
| 104 bool GpuChannelManager::OnMessageReceived(const IPC::Message& msg) { | 104 bool GpuChannelManager::OnMessageReceived(const IPC::Message& msg) { |
| 105 bool handled = true; | 105 bool handled = true; |
| 106 IPC_BEGIN_MESSAGE_MAP(GpuChannelManager, msg) | 106 IPC_BEGIN_MESSAGE_MAP(GpuChannelManager, msg) |
| 107 IPC_MESSAGE_HANDLER(GpuMsg_EstablishChannel, OnEstablishChannel) | 107 IPC_MESSAGE_HANDLER(GpuMsg_EstablishChannel, OnEstablishChannel) |
| 108 IPC_MESSAGE_HANDLER(GpuMsg_CloseChannel, OnCloseChannel) | 108 IPC_MESSAGE_HANDLER(GpuMsg_CloseChannel, OnCloseChannel) |
| 109 IPC_MESSAGE_HANDLER(GpuMsg_CreateViewCommandBuffer, | 109 IPC_MESSAGE_HANDLER(GpuMsg_CreateViewCommandBuffer, |
| 110 OnCreateViewCommandBuffer) | 110 OnCreateViewCommandBuffer) |
| 111 IPC_MESSAGE_HANDLER(GpuMsg_CreateImage, OnCreateImage) | 111 IPC_MESSAGE_HANDLER(GpuMsg_CreateImage, OnCreateImage) |
| 112 IPC_MESSAGE_HANDLER(GpuMsg_DeleteImage, OnDeleteImage) | 112 IPC_MESSAGE_HANDLER(GpuMsg_DeleteImage, OnDeleteImage) |
| 113 IPC_MESSAGE_HANDLER(GpuMsg_CreateGpuMemoryBuffer, OnCreateGpuMemoryBuffer) | |
| 114 IPC_MESSAGE_HANDLER(GpuMsg_DestroyGpuMemoryBuffer, OnDestroyGpuMemoryBuffer) | |
| 113 IPC_MESSAGE_HANDLER(GpuMsg_LoadedShader, OnLoadedShader) | 115 IPC_MESSAGE_HANDLER(GpuMsg_LoadedShader, OnLoadedShader) |
| 114 IPC_MESSAGE_UNHANDLED(handled = false) | 116 IPC_MESSAGE_UNHANDLED(handled = false) |
| 115 IPC_END_MESSAGE_MAP() | 117 IPC_END_MESSAGE_MAP() |
| 116 return handled; | 118 return handled; |
| 117 } | 119 } |
| 118 | 120 |
| 119 bool GpuChannelManager::Send(IPC::Message* msg) { return router_->Send(msg); } | 121 bool GpuChannelManager::Send(IPC::Message* msg) { return router_->Send(msg); } |
| 120 | 122 |
| 121 void GpuChannelManager::OnEstablishChannel(int client_id, bool share_context) { | 123 void GpuChannelManager::OnEstablishChannel(int client_id, bool share_context) { |
| 122 IPC::ChannelHandle channel_handle; | 124 IPC::ChannelHandle channel_handle; |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 248 // Check if operation has a pending sync point. | 250 // Check if operation has a pending sync point. |
| 249 if (image_operations_.front()->sync_point) | 251 if (image_operations_.front()->sync_point) |
| 250 return; | 252 return; |
| 251 | 253 |
| 252 image_operations_.front()->callback.Run(); | 254 image_operations_.front()->callback.Run(); |
| 253 delete image_operations_.front(); | 255 delete image_operations_.front(); |
| 254 image_operations_.pop_front(); | 256 image_operations_.pop_front(); |
| 255 } | 257 } |
| 256 } | 258 } |
| 257 | 259 |
| 260 void GpuChannelManager::OnCreateGpuMemoryBuffer( | |
| 261 const gfx::GpuMemoryBufferHandle& handle, | |
| 262 const gfx::Size& size, | |
| 263 unsigned internalformat, | |
| 264 unsigned usage) { | |
| 265 Send(new GpuHostMsg_GpuMemoryBufferCreated(gfx::GpuMemoryBufferHandle())); | |
| 266 } | |
| 267 | |
| 268 void GpuChannelManager::OnDestroyGpuMemoryBuffer( | |
| 269 const gfx::GpuMemoryBufferHandle& handle, | |
| 270 int32 sync_point) { | |
| 271 NOTIMPLEMENTED(); | |
|
reveman
2014/06/11 14:03:22
I don't think this should be here. You've implemen
alexst (slow to review)
2014/06/11 14:18:59
Done.
| |
| 272 } | |
| 273 | |
| 258 void GpuChannelManager::OnLoadedShader(std::string program_proto) { | 274 void GpuChannelManager::OnLoadedShader(std::string program_proto) { |
| 259 if (program_cache()) | 275 if (program_cache()) |
| 260 program_cache()->LoadProgram(program_proto); | 276 program_cache()->LoadProgram(program_proto); |
| 261 } | 277 } |
| 262 | 278 |
| 263 bool GpuChannelManager::HandleMessagesScheduled() { | 279 bool GpuChannelManager::HandleMessagesScheduled() { |
| 264 for (GpuChannelMap::iterator iter = gpu_channels_.begin(); | 280 for (GpuChannelMap::iterator iter = gpu_channels_.begin(); |
| 265 iter != gpu_channels_.end(); ++iter) { | 281 iter != gpu_channels_.end(); ++iter) { |
| 266 if (iter->second->handle_messages_scheduled()) | 282 if (iter->second->handle_messages_scheduled()) |
| 267 return true; | 283 return true; |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 296 | 312 |
| 297 gfx::GLSurface* GpuChannelManager::GetDefaultOffscreenSurface() { | 313 gfx::GLSurface* GpuChannelManager::GetDefaultOffscreenSurface() { |
| 298 if (!default_offscreen_surface_.get()) { | 314 if (!default_offscreen_surface_.get()) { |
| 299 default_offscreen_surface_ = | 315 default_offscreen_surface_ = |
| 300 gfx::GLSurface::CreateOffscreenGLSurface(gfx::Size()); | 316 gfx::GLSurface::CreateOffscreenGLSurface(gfx::Size()); |
| 301 } | 317 } |
| 302 return default_offscreen_surface_.get(); | 318 return default_offscreen_surface_.get(); |
| 303 } | 319 } |
| 304 | 320 |
| 305 } // namespace content | 321 } // namespace content |
| OLD | NEW |