| 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 | 95 |
| 96 GpuChannel* GpuChannelManager::LookupChannel(int32 client_id) { | 96 GpuChannel* GpuChannelManager::LookupChannel(int32 client_id) { |
| 97 GpuChannelMap::const_iterator iter = gpu_channels_.find(client_id); | 97 GpuChannelMap::const_iterator iter = gpu_channels_.find(client_id); |
| 98 if (iter == gpu_channels_.end()) | 98 if (iter == gpu_channels_.end()) |
| 99 return NULL; | 99 return NULL; |
| 100 else | 100 else |
| 101 return iter->second.get(); | 101 return iter->second.get(); |
| 102 } | 102 } |
| 103 | 103 |
| 104 bool GpuChannelManager::OnMessageReceived(const IPC::Message& msg) { | 104 bool GpuChannelManager::OnMessageReceived(const IPC::Message& msg) { |
| 105 bool msg_is_ok = true; | |
| 106 bool handled = true; | 105 bool handled = true; |
| 107 IPC_BEGIN_MESSAGE_MAP_EX(GpuChannelManager, msg, msg_is_ok) | 106 IPC_BEGIN_MESSAGE_MAP(GpuChannelManager, msg) |
| 108 IPC_MESSAGE_HANDLER(GpuMsg_EstablishChannel, OnEstablishChannel) | 107 IPC_MESSAGE_HANDLER(GpuMsg_EstablishChannel, OnEstablishChannel) |
| 109 IPC_MESSAGE_HANDLER(GpuMsg_CloseChannel, OnCloseChannel) | 108 IPC_MESSAGE_HANDLER(GpuMsg_CloseChannel, OnCloseChannel) |
| 110 IPC_MESSAGE_HANDLER(GpuMsg_CreateViewCommandBuffer, | 109 IPC_MESSAGE_HANDLER(GpuMsg_CreateViewCommandBuffer, |
| 111 OnCreateViewCommandBuffer) | 110 OnCreateViewCommandBuffer) |
| 112 IPC_MESSAGE_HANDLER(GpuMsg_CreateImage, OnCreateImage) | 111 IPC_MESSAGE_HANDLER(GpuMsg_CreateImage, OnCreateImage) |
| 113 IPC_MESSAGE_HANDLER(GpuMsg_DeleteImage, OnDeleteImage) | 112 IPC_MESSAGE_HANDLER(GpuMsg_DeleteImage, OnDeleteImage) |
| 114 IPC_MESSAGE_HANDLER(GpuMsg_LoadedShader, OnLoadedShader) | 113 IPC_MESSAGE_HANDLER(GpuMsg_LoadedShader, OnLoadedShader) |
| 115 IPC_MESSAGE_UNHANDLED(handled = false) | 114 IPC_MESSAGE_UNHANDLED(handled = false) |
| 116 IPC_END_MESSAGE_MAP_EX() | 115 IPC_END_MESSAGE_MAP() |
| 117 return handled; | 116 return handled; |
| 118 } | 117 } |
| 119 | 118 |
| 120 bool GpuChannelManager::Send(IPC::Message* msg) { return router_->Send(msg); } | 119 bool GpuChannelManager::Send(IPC::Message* msg) { return router_->Send(msg); } |
| 121 | 120 |
| 122 void GpuChannelManager::OnEstablishChannel(int client_id, bool share_context) { | 121 void GpuChannelManager::OnEstablishChannel(int client_id, bool share_context) { |
| 123 IPC::ChannelHandle channel_handle; | 122 IPC::ChannelHandle channel_handle; |
| 124 | 123 |
| 125 gfx::GLShareGroup* share_group = NULL; | 124 gfx::GLShareGroup* share_group = NULL; |
| 126 gpu::gles2::MailboxManager* mailbox_manager = NULL; | 125 gpu::gles2::MailboxManager* mailbox_manager = NULL; |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 | 299 |
| 301 gfx::GLSurface* GpuChannelManager::GetDefaultOffscreenSurface() { | 300 gfx::GLSurface* GpuChannelManager::GetDefaultOffscreenSurface() { |
| 302 if (!default_offscreen_surface_.get()) { | 301 if (!default_offscreen_surface_.get()) { |
| 303 default_offscreen_surface_ = | 302 default_offscreen_surface_ = |
| 304 gfx::GLSurface::CreateOffscreenGLSurface(gfx::Size(1, 1)); | 303 gfx::GLSurface::CreateOffscreenGLSurface(gfx::Size(1, 1)); |
| 305 } | 304 } |
| 306 return default_offscreen_surface_.get(); | 305 return default_offscreen_surface_.get(); |
| 307 } | 306 } |
| 308 | 307 |
| 309 } // namespace content | 308 } // namespace content |
| OLD | NEW |