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 #include "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/bind_helpers.h" | 6 #include "base/bind_helpers.h" |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/hash.h" | 8 #include "base/hash.h" |
9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
10 #include "base/memory/shared_memory.h" | 10 #include "base/memory/shared_memory.h" |
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 void GpuCommandBufferStub::OnInitialize( | 481 void GpuCommandBufferStub::OnInitialize( |
482 base::SharedMemoryHandle shared_state_handle, | 482 base::SharedMemoryHandle shared_state_handle, |
483 IPC::Message* reply_message) { | 483 IPC::Message* reply_message) { |
484 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnInitialize"); | 484 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnInitialize"); |
485 DCHECK(!command_buffer_.get()); | 485 DCHECK(!command_buffer_.get()); |
486 | 486 |
487 scoped_ptr<base::SharedMemory> shared_state_shm( | 487 scoped_ptr<base::SharedMemory> shared_state_shm( |
488 new base::SharedMemory(shared_state_handle, false)); | 488 new base::SharedMemory(shared_state_handle, false)); |
489 | 489 |
490 command_buffer_.reset(new gpu::CommandBufferService( | 490 command_buffer_.reset(new gpu::CommandBufferService( |
491 context_group_->transfer_buffer_manager())); | 491 context_group_->transfer_buffer_manager(), |
| 492 gpu::kCommandBufferNamespace_GpuIO, |
| 493 (static_cast<uint64_t>(channel_->client_id()) << 32) | route_id_)); |
492 | 494 |
493 bool result = command_buffer_->Initialize(); | 495 bool result = command_buffer_->Initialize(); |
494 DCHECK(result); | 496 DCHECK(result); |
495 | 497 |
496 decoder_.reset(::gpu::gles2::GLES2Decoder::Create(context_group_.get())); | 498 decoder_.reset(::gpu::gles2::GLES2Decoder::Create(context_group_.get())); |
497 scheduler_.reset(new gpu::GpuScheduler(command_buffer_.get(), | 499 scheduler_.reset(new gpu::GpuScheduler(command_buffer_.get(), |
498 decoder_.get(), | 500 decoder_.get(), |
499 decoder_.get())); | 501 decoder_.get())); |
500 if (preemption_flag_.get()) | 502 if (preemption_flag_.get()) |
501 scheduler_->SetPreemptByFlag(preemption_flag_); | 503 scheduler_->SetPreemptByFlag(preemption_flag_); |
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1178 result)); | 1180 result)); |
1179 } | 1181 } |
1180 | 1182 |
1181 void GpuCommandBufferStub::SendUpdateVSyncParameters(base::TimeTicks timebase, | 1183 void GpuCommandBufferStub::SendUpdateVSyncParameters(base::TimeTicks timebase, |
1182 base::TimeDelta interval) { | 1184 base::TimeDelta interval) { |
1183 Send(new GpuCommandBufferMsg_UpdateVSyncParameters(route_id_, timebase, | 1185 Send(new GpuCommandBufferMsg_UpdateVSyncParameters(route_id_, timebase, |
1184 interval)); | 1186 interval)); |
1185 } | 1187 } |
1186 | 1188 |
1187 } // namespace content | 1189 } // namespace content |
OLD | NEW |