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(ENABLE_GPU) | 5 #if defined(ENABLE_GPU) |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
11 #include "base/shared_memory.h" | 11 #include "base/shared_memory.h" |
12 #include "base/time.h" | 12 #include "base/time.h" |
13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
14 #include "content/common/gpu/gpu_channel.h" | 14 #include "content/common/gpu/gpu_channel.h" |
15 #include "content/common/gpu/gpu_channel_manager.h" | 15 #include "content/common/gpu/gpu_channel_manager.h" |
16 #include "content/common/gpu/gpu_command_buffer_stub.h" | 16 #include "content/common/gpu/gpu_command_buffer_stub.h" |
17 #include "content/common/gpu/gpu_memory_manager.h" | 17 #include "content/common/gpu/gpu_memory_manager.h" |
18 #include "content/common/gpu/gpu_messages.h" | 18 #include "content/common/gpu/gpu_messages.h" |
19 #include "content/common/gpu/gpu_watchdog.h" | 19 #include "content/common/gpu/gpu_watchdog.h" |
20 #include "content/common/gpu/image_transport_surface.h" | 20 #include "content/common/gpu/image_transport_surface.h" |
21 #include "gpu/command_buffer/common/constants.h" | 21 #include "gpu/command_buffer/common/constants.h" |
22 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 22 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
23 #include "ui/gfx/gl/gl_bindings.h" | 23 #include "ui/gfx/gl/gl_bindings.h" |
24 #include "ui/gfx/gl/gl_switches.h" | 24 #include "ui/gfx/gl/gl_switches.h" |
25 | 25 |
26 #if defined(OS_WIN) | 26 #if defined(OS_WIN) |
27 #include "content/common/sandbox_policy.h" | 27 #include "content/public/common/sandbox_init.h" |
28 #endif | 28 #endif |
29 | 29 |
30 GpuCommandBufferStub::SurfaceState::SurfaceState(int32 surface_id, | 30 GpuCommandBufferStub::SurfaceState::SurfaceState(int32 surface_id, |
31 bool visible, | 31 bool visible, |
32 base::TimeTicks last_used_time) | 32 base::TimeTicks last_used_time) |
33 : surface_id(surface_id), | 33 : surface_id(surface_id), |
34 visible(visible), | 34 visible(visible), |
35 last_used_time(last_used_time) { | 35 last_used_time(last_used_time) { |
36 } | 36 } |
37 | 37 |
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
501 int32 id, | 501 int32 id, |
502 IPC::Message* reply_message) { | 502 IPC::Message* reply_message) { |
503 if (command_buffer_.get()) { | 503 if (command_buffer_.get()) { |
504 base::SharedMemoryHandle transfer_buffer = base::SharedMemoryHandle(); | 504 base::SharedMemoryHandle transfer_buffer = base::SharedMemoryHandle(); |
505 uint32 size = 0; | 505 uint32 size = 0; |
506 | 506 |
507 gpu::Buffer buffer = command_buffer_->GetTransferBuffer(id); | 507 gpu::Buffer buffer = command_buffer_->GetTransferBuffer(id); |
508 if (buffer.shared_memory) { | 508 if (buffer.shared_memory) { |
509 #if defined(OS_WIN) | 509 #if defined(OS_WIN) |
510 transfer_buffer = NULL; | 510 transfer_buffer = NULL; |
511 sandbox::BrokerDuplicateHandle(buffer.shared_memory->handle(), | 511 content::BrokerDuplicateHandle(buffer.shared_memory->handle(), |
512 channel_->renderer_pid(), &transfer_buffer, FILE_MAP_READ | | 512 channel_->renderer_pid(), &transfer_buffer, FILE_MAP_READ | |
513 FILE_MAP_WRITE, 0); | 513 FILE_MAP_WRITE, 0); |
514 CHECK(transfer_buffer != NULL); | 514 CHECK(transfer_buffer != NULL); |
515 #else | 515 #else |
516 buffer.shared_memory->ShareToProcess(channel_->renderer_pid(), | 516 buffer.shared_memory->ShareToProcess(channel_->renderer_pid(), |
517 &transfer_buffer); | 517 &transfer_buffer); |
518 #endif | 518 #endif |
519 size = buffer.size; | 519 size = buffer.size; |
520 } | 520 } |
521 | 521 |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
631 } | 631 } |
632 | 632 |
633 void GpuCommandBufferStub::SetMemoryAllocation( | 633 void GpuCommandBufferStub::SetMemoryAllocation( |
634 const GpuMemoryAllocation& allocation) { | 634 const GpuMemoryAllocation& allocation) { |
635 allocation_ = allocation; | 635 allocation_ = allocation; |
636 | 636 |
637 SendMemoryAllocationToProxy(allocation); | 637 SendMemoryAllocationToProxy(allocation); |
638 } | 638 } |
639 | 639 |
640 #endif // defined(ENABLE_GPU) | 640 #endif // defined(ENABLE_GPU) |
OLD | NEW |