| 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 #if defined(OS_WIN) | 5 #if defined(OS_WIN) |
| 6 #include <windows.h> | 6 #include <windows.h> |
| 7 #endif | 7 #endif |
| 8 | 8 |
| 9 #include "content/common/gpu/gpu_channel.h" | 9 #include "content/common/gpu/gpu_channel.h" |
| 10 | 10 |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 FROM_HERE, base::Bind(&GpuChannel::OnDestroy, this)); | 170 FROM_HERE, base::Bind(&GpuChannel::OnDestroy, this)); |
| 171 } | 171 } |
| 172 | 172 |
| 173 void GpuChannel::OnDestroy() { | 173 void GpuChannel::OnDestroy() { |
| 174 TRACE_EVENT0("gpu", "GpuChannel::OnDestroy"); | 174 TRACE_EVENT0("gpu", "GpuChannel::OnDestroy"); |
| 175 gpu_channel_manager_->RemoveChannel(client_id_); | 175 gpu_channel_manager_->RemoveChannel(client_id_); |
| 176 } | 176 } |
| 177 | 177 |
| 178 void GpuChannel::CreateViewCommandBuffer( | 178 void GpuChannel::CreateViewCommandBuffer( |
| 179 gfx::PluginWindowHandle window, | 179 gfx::PluginWindowHandle window, |
| 180 int32 render_view_id, | 180 int32 surface_id, |
| 181 const GPUCreateCommandBufferConfig& init_params, | 181 const GPUCreateCommandBufferConfig& init_params, |
| 182 int32* route_id) { | 182 int32* route_id) { |
| 183 *route_id = MSG_ROUTING_NONE; | 183 *route_id = MSG_ROUTING_NONE; |
| 184 content::GetContentClient()->SetActiveURL(init_params.active_url); | 184 content::GetContentClient()->SetActiveURL(init_params.active_url); |
| 185 | 185 |
| 186 #if defined(ENABLE_GPU) | 186 #if defined(ENABLE_GPU) |
| 187 WillCreateCommandBuffer(init_params.gpu_preference); | 187 WillCreateCommandBuffer(init_params.gpu_preference); |
| 188 | 188 |
| 189 GpuCommandBufferStub* share_group = stubs_.Lookup(init_params.share_group_id); | 189 GpuCommandBufferStub* share_group = stubs_.Lookup(init_params.share_group_id); |
| 190 | 190 |
| 191 *route_id = GenerateRouteID(); | 191 *route_id = GenerateRouteID(); |
| 192 scoped_ptr<GpuCommandBufferStub> stub(new GpuCommandBufferStub( | 192 scoped_ptr<GpuCommandBufferStub> stub(new GpuCommandBufferStub( |
| 193 this, | 193 this, |
| 194 share_group, | 194 share_group, |
| 195 window, | 195 window, |
| 196 gfx::Size(), | 196 gfx::Size(), |
| 197 disallowed_features_, | 197 disallowed_features_, |
| 198 init_params.allowed_extensions, | 198 init_params.allowed_extensions, |
| 199 init_params.attribs, | 199 init_params.attribs, |
| 200 init_params.gpu_preference, | 200 init_params.gpu_preference, |
| 201 *route_id, | 201 *route_id, |
| 202 client_id_, | 202 surface_id, |
| 203 render_view_id, | |
| 204 watchdog_, | 203 watchdog_, |
| 205 software_)); | 204 software_)); |
| 206 router_.AddRoute(*route_id, stub.get()); | 205 router_.AddRoute(*route_id, stub.get()); |
| 207 stubs_.AddWithID(stub.release(), *route_id); | 206 stubs_.AddWithID(stub.release(), *route_id); |
| 208 #endif // ENABLE_GPU | 207 #endif // ENABLE_GPU |
| 209 } | 208 } |
| 210 | 209 |
| 211 GpuCommandBufferStub* GpuChannel::LookupCommandBuffer(int32 route_id) { | 210 GpuCommandBufferStub* GpuChannel::LookupCommandBuffer(int32 route_id) { |
| 212 return stubs_.Lookup(route_id); | 211 return stubs_.Lookup(route_id); |
| 213 } | 212 } |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 scoped_ptr<GpuCommandBufferStub> stub(new GpuCommandBufferStub( | 321 scoped_ptr<GpuCommandBufferStub> stub(new GpuCommandBufferStub( |
| 323 this, | 322 this, |
| 324 share_group, | 323 share_group, |
| 325 gfx::kNullPluginWindow, | 324 gfx::kNullPluginWindow, |
| 326 size, | 325 size, |
| 327 disallowed_features_, | 326 disallowed_features_, |
| 328 init_params.allowed_extensions, | 327 init_params.allowed_extensions, |
| 329 init_params.attribs, | 328 init_params.attribs, |
| 330 init_params.gpu_preference, | 329 init_params.gpu_preference, |
| 331 route_id, | 330 route_id, |
| 332 0, 0, watchdog_, | 331 0, watchdog_, |
| 333 software_)); | 332 software_)); |
| 334 router_.AddRoute(route_id, stub.get()); | 333 router_.AddRoute(route_id, stub.get()); |
| 335 stubs_.AddWithID(stub.release(), route_id); | 334 stubs_.AddWithID(stub.release(), route_id); |
| 336 TRACE_EVENT1("gpu", "GpuChannel::OnCreateOffscreenCommandBuffer", | 335 TRACE_EVENT1("gpu", "GpuChannel::OnCreateOffscreenCommandBuffer", |
| 337 "route_id", route_id); | 336 "route_id", route_id); |
| 338 #endif | 337 #endif |
| 339 | 338 |
| 340 GpuChannelMsg_CreateOffscreenCommandBuffer::WriteReplyParams( | 339 GpuChannelMsg_CreateOffscreenCommandBuffer::WriteReplyParams( |
| 341 reply_message, | 340 reply_message, |
| 342 route_id); | 341 route_id); |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 433 | 432 |
| 434 #if defined(OS_POSIX) | 433 #if defined(OS_POSIX) |
| 435 int GpuChannel::TakeRendererFileDescriptor() { | 434 int GpuChannel::TakeRendererFileDescriptor() { |
| 436 if (!channel_.get()) { | 435 if (!channel_.get()) { |
| 437 NOTREACHED(); | 436 NOTREACHED(); |
| 438 return -1; | 437 return -1; |
| 439 } | 438 } |
| 440 return channel_->TakeClientFileDescriptor(); | 439 return channel_->TakeClientFileDescriptor(); |
| 441 } | 440 } |
| 442 #endif // defined(OS_POSIX) | 441 #endif // defined(OS_POSIX) |
| OLD | NEW |