OLD | NEW |
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/renderer/gpu_channel_host.h" | 5 #include "chrome/renderer/gpu_channel_host.h" |
6 | 6 |
7 #include "chrome/common/child_process.h" | 7 #include "chrome/common/child_process.h" |
8 #include "chrome/common/gpu_messages.h" | 8 #include "chrome/common/gpu_messages.h" |
9 #include "chrome/renderer/command_buffer_proxy.h" | 9 #include "chrome/renderer/command_buffer_proxy.h" |
10 | 10 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 bool GpuChannelHost::Send(IPC::Message* message) { | 61 bool GpuChannelHost::Send(IPC::Message* message) { |
62 if (!channel_.get()) { | 62 if (!channel_.get()) { |
63 delete message; | 63 delete message; |
64 return false; | 64 return false; |
65 } | 65 } |
66 | 66 |
67 return channel_->Send(message); | 67 return channel_->Send(message); |
68 } | 68 } |
69 | 69 |
70 CommandBufferProxy* GpuChannelHost::CreateViewCommandBuffer( | 70 CommandBufferProxy* GpuChannelHost::CreateViewCommandBuffer( |
71 gfx::NativeViewId view) { | 71 gfx::NativeViewId view, int render_view_id) { |
72 #if defined(ENABLE_GPU) | 72 #if defined(ENABLE_GPU) |
73 // An error occurred. Need to get the host again to reinitialize it. | 73 // An error occurred. Need to get the host again to reinitialize it. |
74 if (!channel_.get()) | 74 if (!channel_.get()) |
75 return NULL; | 75 return NULL; |
76 | 76 |
77 int32 route_id; | 77 int32 route_id; |
78 if (!Send(new GpuChannelMsg_CreateViewCommandBuffer(view, &route_id)) && | 78 if (!Send(new GpuChannelMsg_CreateViewCommandBuffer(view, |
| 79 render_view_id, |
| 80 &route_id)) && |
79 route_id != MSG_ROUTING_NONE) { | 81 route_id != MSG_ROUTING_NONE) { |
80 return NULL; | 82 return NULL; |
81 } | 83 } |
82 | 84 |
83 CommandBufferProxy* command_buffer = new CommandBufferProxy(this, route_id); | 85 CommandBufferProxy* command_buffer = new CommandBufferProxy(this, route_id); |
84 router_.AddRoute(route_id, command_buffer); | 86 router_.AddRoute(route_id, command_buffer); |
85 proxies_[route_id] = command_buffer; | 87 proxies_[route_id] = command_buffer; |
86 return command_buffer; | 88 return command_buffer; |
87 #else | 89 #else |
88 return NULL; | 90 return NULL; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 int route_id = command_buffer->route_id(); | 127 int route_id = command_buffer->route_id(); |
126 if (proxies_.find(command_buffer->route_id()) != proxies_.end()) { | 128 if (proxies_.find(command_buffer->route_id()) != proxies_.end()) { |
127 proxies_.erase(route_id); | 129 proxies_.erase(route_id); |
128 router_.RemoveRoute(route_id); | 130 router_.RemoveRoute(route_id); |
129 } | 131 } |
130 | 132 |
131 delete command_buffer; | 133 delete command_buffer; |
132 #endif | 134 #endif |
133 } | 135 } |
134 | 136 |
OLD | NEW |