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 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 requested_attribs_)) { | 502 requested_attribs_)) { |
503 DLOG(ERROR) << "Failed to initialize decoder."; | 503 DLOG(ERROR) << "Failed to initialize decoder."; |
504 OnInitializeFailed(reply_message); | 504 OnInitializeFailed(reply_message); |
505 return; | 505 return; |
506 } | 506 } |
507 | 507 |
508 gpu_control_.reset( | 508 gpu_control_.reset( |
509 new gpu::GpuControlService(context_group_->image_manager(), | 509 new gpu::GpuControlService(context_group_->image_manager(), |
510 NULL, | 510 NULL, |
511 context_group_->mailbox_manager(), | 511 context_group_->mailbox_manager(), |
512 NULL, | 512 NULL)); |
513 decoder_->GetCapabilities())); | |
514 | 513 |
515 if (CommandLine::ForCurrentProcess()->HasSwitch( | 514 if (CommandLine::ForCurrentProcess()->HasSwitch( |
516 switches::kEnableGPUServiceLogging)) { | 515 switches::kEnableGPUServiceLogging)) { |
517 decoder_->set_log_commands(true); | 516 decoder_->set_log_commands(true); |
518 } | 517 } |
519 | 518 |
520 decoder_->GetLogger()->SetMsgCallback( | 519 decoder_->GetLogger()->SetMsgCallback( |
521 base::Bind(&GpuCommandBufferStub::SendConsoleMessage, | 520 base::Bind(&GpuCommandBufferStub::SendConsoleMessage, |
522 base::Unretained(this))); | 521 base::Unretained(this))); |
523 decoder_->SetShaderCacheCallback( | 522 decoder_->SetShaderCacheCallback( |
(...skipping 20 matching lines...) Expand all Loading... |
544 base::Unretained(this))); | 543 base::Unretained(this))); |
545 } | 544 } |
546 | 545 |
547 if (!command_buffer_->SetSharedStateBuffer(shared_state_shm.Pass())) { | 546 if (!command_buffer_->SetSharedStateBuffer(shared_state_shm.Pass())) { |
548 DLOG(ERROR) << "Failed to map shared stae buffer."; | 547 DLOG(ERROR) << "Failed to map shared stae buffer."; |
549 OnInitializeFailed(reply_message); | 548 OnInitializeFailed(reply_message); |
550 return; | 549 return; |
551 } | 550 } |
552 | 551 |
553 GpuCommandBufferMsg_Initialize::WriteReplyParams( | 552 GpuCommandBufferMsg_Initialize::WriteReplyParams( |
554 reply_message, true, gpu_control_->GetCapabilities()); | 553 reply_message, true, decoder_->GetCapabilities()); |
555 Send(reply_message); | 554 Send(reply_message); |
556 | 555 |
557 if (handle_.is_null() && !active_url_.is_empty()) { | 556 if (handle_.is_null() && !active_url_.is_empty()) { |
558 GpuChannelManager* gpu_channel_manager = channel_->gpu_channel_manager(); | 557 GpuChannelManager* gpu_channel_manager = channel_->gpu_channel_manager(); |
559 gpu_channel_manager->Send(new GpuHostMsg_DidCreateOffscreenContext( | 558 gpu_channel_manager->Send(new GpuHostMsg_DidCreateOffscreenContext( |
560 active_url_)); | 559 active_url_)); |
561 } | 560 } |
562 } | 561 } |
563 | 562 |
564 void GpuCommandBufferStub::OnSetLatencyInfo( | 563 void GpuCommandBufferStub::OnSetLatencyInfo( |
(...skipping 411 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
976 if (decoder_) | 975 if (decoder_) |
977 decoder_->LoseContext(GL_UNKNOWN_CONTEXT_RESET_ARB); | 976 decoder_->LoseContext(GL_UNKNOWN_CONTEXT_RESET_ARB); |
978 command_buffer_->SetParseError(gpu::error::kLostContext); | 977 command_buffer_->SetParseError(gpu::error::kLostContext); |
979 } | 978 } |
980 | 979 |
981 uint64 GpuCommandBufferStub::GetMemoryUsage() const { | 980 uint64 GpuCommandBufferStub::GetMemoryUsage() const { |
982 return GetMemoryManager()->GetClientMemoryUsage(this); | 981 return GetMemoryManager()->GetClientMemoryUsage(this); |
983 } | 982 } |
984 | 983 |
985 } // namespace content | 984 } // namespace content |
OLD | NEW |