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_context.h" | 22 #include "ui/gfx/gl/gl_context.h" |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 parent_stub, | 248 parent_stub, |
248 size, | 249 size, |
249 disallowed_extensions_, | 250 disallowed_extensions_, |
250 init_params.allowed_extensions, | 251 init_params.allowed_extensions, |
251 init_params.attribs, | 252 init_params.attribs, |
252 parent_texture_id, | 253 parent_texture_id, |
253 *route_id, | 254 *route_id, |
254 0, 0, watchdog_)); | 255 0, 0, watchdog_)); |
255 router_.AddRoute(*route_id, stub.get()); | 256 router_.AddRoute(*route_id, stub.get()); |
256 stubs_.AddWithID(stub.release(), *route_id); | 257 stubs_.AddWithID(stub.release(), *route_id); |
| 258 TRACE_EVENT1("gpu", "GpuChannel::OnCreateOffscreenCommandBuffer", |
| 259 "route_id", route_id); |
257 #else | 260 #else |
258 *route_id = MSG_ROUTING_NONE; | 261 *route_id = MSG_ROUTING_NONE; |
259 #endif | 262 #endif |
260 } | 263 } |
261 | 264 |
262 void GpuChannel::OnDestroyCommandBuffer(int32 route_id) { | 265 void GpuChannel::OnDestroyCommandBuffer(int32 route_id) { |
263 #if defined(ENABLE_GPU) | 266 #if defined(ENABLE_GPU) |
| 267 TRACE_EVENT1("gpu", "GpuChannel::OnDestroyCommandBuffer", |
| 268 "route_id", route_id); |
264 if (router_.ResolveRoute(route_id)) { | 269 if (router_.ResolveRoute(route_id)) { |
| 270 GpuCommandBufferStub* stub = stubs_.Lookup(route_id); |
| 271 // In case the renderer is currently blocked waiting for a sync reply from |
| 272 // the stub, allow the stub to clean up and unblock pending messages here: |
| 273 if (stub != NULL) |
| 274 stub->CommandBufferWasDestroyed(); |
265 router_.RemoveRoute(route_id); | 275 router_.RemoveRoute(route_id); |
266 stubs_.Remove(route_id); | 276 stubs_.Remove(route_id); |
267 } | 277 } |
268 #endif | 278 #endif |
269 } | 279 } |
270 | 280 |
271 void GpuChannel::OnCreateOffscreenSurface(const gfx::Size& size, | 281 void GpuChannel::OnCreateOffscreenSurface(const gfx::Size& size, |
272 int* route_id) { | 282 int* route_id) { |
273 *route_id = MSG_ROUTING_NONE; | 283 *route_id = MSG_ROUTING_NONE; |
274 | 284 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 | 392 |
383 #if defined(OS_POSIX) | 393 #if defined(OS_POSIX) |
384 int GpuChannel::GetRendererFileDescriptor() { | 394 int GpuChannel::GetRendererFileDescriptor() { |
385 int fd = -1; | 395 int fd = -1; |
386 if (channel_.get()) { | 396 if (channel_.get()) { |
387 fd = channel_->GetClientFileDescriptor(); | 397 fd = channel_->GetClientFileDescriptor(); |
388 } | 398 } |
389 return fd; | 399 return fd; |
390 } | 400 } |
391 #endif // defined(OS_POSIX) | 401 #endif // defined(OS_POSIX) |
OLD | NEW |