| 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 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 | 473 |
| 474 void GpuCommandBufferStub::OnInitializeFailed(IPC::Message* reply_message) { | 474 void GpuCommandBufferStub::OnInitializeFailed(IPC::Message* reply_message) { |
| 475 Destroy(); | 475 Destroy(); |
| 476 GpuCommandBufferMsg_Initialize::WriteReplyParams( | 476 GpuCommandBufferMsg_Initialize::WriteReplyParams( |
| 477 reply_message, false, gpu::Capabilities()); | 477 reply_message, false, gpu::Capabilities()); |
| 478 Send(reply_message); | 478 Send(reply_message); |
| 479 } | 479 } |
| 480 | 480 |
| 481 void GpuCommandBufferStub::OnInitialize( | 481 void GpuCommandBufferStub::OnInitialize( |
| 482 base::SharedMemoryHandle shared_state_handle, | 482 base::SharedMemoryHandle shared_state_handle, |
| 483 uint64_t command_buffer_id, |
| 483 IPC::Message* reply_message) { | 484 IPC::Message* reply_message) { |
| 484 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnInitialize"); | 485 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnInitialize"); |
| 485 DCHECK(!command_buffer_.get()); | 486 DCHECK(!command_buffer_.get()); |
| 486 | 487 |
| 487 scoped_ptr<base::SharedMemory> shared_state_shm( | 488 scoped_ptr<base::SharedMemory> shared_state_shm( |
| 488 new base::SharedMemory(shared_state_handle, false)); | 489 new base::SharedMemory(shared_state_handle, false)); |
| 489 | 490 |
| 490 command_buffer_.reset(new gpu::CommandBufferService( | 491 command_buffer_.reset(new gpu::CommandBufferService( |
| 491 context_group_->transfer_buffer_manager())); | 492 context_group_->transfer_buffer_manager(), |
| 493 gpu::kCommandBufferNamespace_GpuIO, |
| 494 command_buffer_id)); |
| 492 | 495 |
| 493 bool result = command_buffer_->Initialize(); | 496 bool result = command_buffer_->Initialize(); |
| 494 DCHECK(result); | 497 DCHECK(result); |
| 495 | 498 |
| 496 decoder_.reset(::gpu::gles2::GLES2Decoder::Create(context_group_.get())); | 499 decoder_.reset(::gpu::gles2::GLES2Decoder::Create(context_group_.get())); |
| 497 scheduler_.reset(new gpu::GpuScheduler(command_buffer_.get(), | 500 scheduler_.reset(new gpu::GpuScheduler(command_buffer_.get(), |
| 498 decoder_.get(), | 501 decoder_.get(), |
| 499 decoder_.get())); | 502 decoder_.get())); |
| 500 if (preemption_flag_.get()) | 503 if (preemption_flag_.get()) |
| 501 scheduler_->SetPreemptByFlag(preemption_flag_); | 504 scheduler_->SetPreemptByFlag(preemption_flag_); |
| (...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1178 result)); | 1181 result)); |
| 1179 } | 1182 } |
| 1180 | 1183 |
| 1181 void GpuCommandBufferStub::SendUpdateVSyncParameters(base::TimeTicks timebase, | 1184 void GpuCommandBufferStub::SendUpdateVSyncParameters(base::TimeTicks timebase, |
| 1182 base::TimeDelta interval) { | 1185 base::TimeDelta interval) { |
| 1183 Send(new GpuCommandBufferMsg_UpdateVSyncParameters(route_id_, timebase, | 1186 Send(new GpuCommandBufferMsg_UpdateVSyncParameters(route_id_, timebase, |
| 1184 interval)); | 1187 interval)); |
| 1185 } | 1188 } |
| 1186 | 1189 |
| 1187 } // namespace content | 1190 } // namespace content |
| OLD | NEW |