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/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
9 #include "base/hash.h" | 9 #include "base/hash.h" |
10 #include "base/memory/shared_memory.h" | 10 #include "base/memory/shared_memory.h" |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 | 387 |
388 void GpuCommandBufferStub::OnInitialize( | 388 void GpuCommandBufferStub::OnInitialize( |
389 base::SharedMemoryHandle shared_state_handle, | 389 base::SharedMemoryHandle shared_state_handle, |
390 IPC::Message* reply_message) { | 390 IPC::Message* reply_message) { |
391 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnInitialize"); | 391 TRACE_EVENT0("gpu", "GpuCommandBufferStub::OnInitialize"); |
392 DCHECK(!command_buffer_.get()); | 392 DCHECK(!command_buffer_.get()); |
393 | 393 |
394 scoped_ptr<base::SharedMemory> shared_state_shm( | 394 scoped_ptr<base::SharedMemory> shared_state_shm( |
395 new base::SharedMemory(shared_state_handle, false)); | 395 new base::SharedMemory(shared_state_handle, false)); |
396 | 396 |
397 command_buffer_.reset(new gpu::CommandBufferService( | 397 command_buffer_.reset( |
398 context_group_->transfer_buffer_manager())); | 398 new gpu::CommandBufferService(context_group_->transfer_buffer_manager(), |
| 399 context_group_->image_manager(), |
| 400 NULL)); |
399 | 401 |
400 if (!command_buffer_->Initialize()) { | 402 if (!command_buffer_->Initialize()) { |
401 DLOG(ERROR) << "CommandBufferService failed to initialize.\n"; | 403 DLOG(ERROR) << "CommandBufferService failed to initialize.\n"; |
402 OnInitializeFailed(reply_message); | 404 OnInitializeFailed(reply_message); |
403 return; | 405 return; |
404 } | 406 } |
405 | 407 |
406 decoder_.reset(::gpu::gles2::GLES2Decoder::Create(context_group_.get())); | 408 decoder_.reset(::gpu::gles2::GLES2Decoder::Create(context_group_.get())); |
407 | 409 |
408 scheduler_.reset(new gpu::GpuScheduler(command_buffer_.get(), | 410 scheduler_.reset(new gpu::GpuScheduler(command_buffer_.get(), |
(...skipping 532 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
941 command_buffer_->GetState().error == gpu::error::kLostContext) | 943 command_buffer_->GetState().error == gpu::error::kLostContext) |
942 return; | 944 return; |
943 | 945 |
944 command_buffer_->SetContextLostReason(gpu::error::kUnknown); | 946 command_buffer_->SetContextLostReason(gpu::error::kUnknown); |
945 if (decoder_) | 947 if (decoder_) |
946 decoder_->LoseContext(GL_UNKNOWN_CONTEXT_RESET_ARB); | 948 decoder_->LoseContext(GL_UNKNOWN_CONTEXT_RESET_ARB); |
947 command_buffer_->SetParseError(gpu::error::kLostContext); | 949 command_buffer_->SetParseError(gpu::error::kLostContext); |
948 } | 950 } |
949 | 951 |
950 } // namespace content | 952 } // namespace content |
OLD | NEW |