| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/debug/trace_event.h" |
| 12 #include "base/process_util.h" | 13 #include "base/process_util.h" |
| 13 #include "base/string_util.h" | 14 #include "base/string_util.h" |
| 14 #include "content/common/child_process.h" | 15 #include "content/common/child_process.h" |
| 15 #include "content/common/content_client.h" | 16 #include "content/common/content_client.h" |
| 16 #include "content/common/content_switches.h" | 17 #include "content/common/content_switches.h" |
| 17 #include "content/common/gpu/gpu_channel_manager.h" | 18 #include "content/common/gpu/gpu_channel_manager.h" |
| 18 #include "content/common/gpu/gpu_messages.h" | 19 #include "content/common/gpu/gpu_messages.h" |
| 19 #include "content/common/gpu/gpu_video_service.h" | 20 #include "content/common/gpu/gpu_video_service.h" |
| 20 #include "content/common/gpu/transport_texture.h" | 21 #include "content/common/gpu/transport_texture.h" |
| 21 #include "ui/gfx/gl/gl_surface.h" | 22 #include "ui/gfx/gl/gl_surface.h" |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 parent_stub, | 245 parent_stub, |
| 245 size, | 246 size, |
| 246 disallowed_extensions_, | 247 disallowed_extensions_, |
| 247 init_params.allowed_extensions, | 248 init_params.allowed_extensions, |
| 248 init_params.attribs, | 249 init_params.attribs, |
| 249 parent_texture_id, | 250 parent_texture_id, |
| 250 *route_id, | 251 *route_id, |
| 251 0, 0, watchdog_)); | 252 0, 0, watchdog_)); |
| 252 router_.AddRoute(*route_id, stub.get()); | 253 router_.AddRoute(*route_id, stub.get()); |
| 253 stubs_.AddWithID(stub.release(), *route_id); | 254 stubs_.AddWithID(stub.release(), *route_id); |
| 255 TRACE_EVENT1("gpu", "GpuChannel::OnCreateOffscreenCommandBuffer", |
| 256 "route_id", route_id); |
| 254 #else | 257 #else |
| 255 *route_id = MSG_ROUTING_NONE; | 258 *route_id = MSG_ROUTING_NONE; |
| 256 #endif | 259 #endif |
| 257 } | 260 } |
| 258 | 261 |
| 259 void GpuChannel::OnDestroyCommandBuffer(int32 route_id) { | 262 void GpuChannel::OnDestroyCommandBuffer(int32 route_id) { |
| 260 #if defined(ENABLE_GPU) | 263 #if defined(ENABLE_GPU) |
| 264 TRACE_EVENT1("gpu", "GpuChannel::OnDestroyCommandBuffer", |
| 265 "route_id", route_id); |
| 261 if (router_.ResolveRoute(route_id)) { | 266 if (router_.ResolveRoute(route_id)) { |
| 267 GpuCommandBufferStub* stub = stubs_.Lookup(route_id); |
| 268 // In case the renderer is currently blocked waiting for a sync reply from |
| 269 // the stub, allow the stub to clean up and unblock pending messages here: |
| 270 if (stub != NULL) |
| 271 stub->CommandBufferWasDestroyed(); |
| 262 router_.RemoveRoute(route_id); | 272 router_.RemoveRoute(route_id); |
| 263 stubs_.Remove(route_id); | 273 stubs_.Remove(route_id); |
| 264 } | 274 } |
| 265 #endif | 275 #endif |
| 266 } | 276 } |
| 267 | 277 |
| 268 void GpuChannel::OnCreateOffscreenSurface(const gfx::Size& size, | 278 void GpuChannel::OnCreateOffscreenSurface(const gfx::Size& size, |
| 269 int* route_id) { | 279 int* route_id) { |
| 270 *route_id = MSG_ROUTING_NONE; | 280 *route_id = MSG_ROUTING_NONE; |
| 271 | 281 |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 | 378 |
| 369 #if defined(OS_POSIX) | 379 #if defined(OS_POSIX) |
| 370 int GpuChannel::GetRendererFileDescriptor() { | 380 int GpuChannel::GetRendererFileDescriptor() { |
| 371 int fd = -1; | 381 int fd = -1; |
| 372 if (channel_.get()) { | 382 if (channel_.get()) { |
| 373 fd = channel_->GetClientFileDescriptor(); | 383 fd = channel_->GetClientFileDescriptor(); |
| 374 } | 384 } |
| 375 return fd; | 385 return fd; |
| 376 } | 386 } |
| 377 #endif // defined(OS_POSIX) | 387 #endif // defined(OS_POSIX) |
| OLD | NEW |