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 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
512 context, | 512 context, |
513 !surface_id(), | 513 !surface_id(), |
514 initial_size_, | 514 initial_size_, |
515 disallowed_features_, | 515 disallowed_features_, |
516 requested_attribs_)) { | 516 requested_attribs_)) { |
517 DLOG(ERROR) << "Failed to initialize decoder."; | 517 DLOG(ERROR) << "Failed to initialize decoder."; |
518 OnInitializeFailed(reply_message); | 518 OnInitializeFailed(reply_message); |
519 return; | 519 return; |
520 } | 520 } |
521 | 521 |
522 if (CommandLine::ForCurrentProcess()->HasSwitch( | |
523 switches::kEnableGPUServiceLogging)) { | |
524 decoder_->set_log_commands(true); | |
525 } | |
526 | |
527 decoder_->GetLogger()->SetMsgCallback( | 522 decoder_->GetLogger()->SetMsgCallback( |
528 base::Bind(&GpuCommandBufferStub::SendConsoleMessage, | 523 base::Bind(&GpuCommandBufferStub::SendConsoleMessage, |
529 base::Unretained(this))); | 524 base::Unretained(this))); |
530 decoder_->SetShaderCacheCallback( | 525 decoder_->SetShaderCacheCallback( |
531 base::Bind(&GpuCommandBufferStub::SendCachedShader, | 526 base::Bind(&GpuCommandBufferStub::SendCachedShader, |
532 base::Unretained(this))); | 527 base::Unretained(this))); |
533 decoder_->SetWaitSyncPointCallback( | 528 decoder_->SetWaitSyncPointCallback( |
534 base::Bind(&GpuCommandBufferStub::OnWaitSyncPoint, | 529 base::Bind(&GpuCommandBufferStub::OnWaitSyncPoint, |
535 base::Unretained(this))); | 530 base::Unretained(this))); |
536 | 531 |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
984 command_buffer_->GetState().error == gpu::error::kLostContext) | 979 command_buffer_->GetState().error == gpu::error::kLostContext) |
985 return; | 980 return; |
986 | 981 |
987 command_buffer_->SetContextLostReason(gpu::error::kUnknown); | 982 command_buffer_->SetContextLostReason(gpu::error::kUnknown); |
988 if (decoder_) | 983 if (decoder_) |
989 decoder_->LoseContext(GL_UNKNOWN_CONTEXT_RESET_ARB); | 984 decoder_->LoseContext(GL_UNKNOWN_CONTEXT_RESET_ARB); |
990 command_buffer_->SetParseError(gpu::error::kLostContext); | 985 command_buffer_->SetParseError(gpu::error::kLostContext); |
991 } | 986 } |
992 | 987 |
993 } // namespace content | 988 } // namespace content |
OLD | NEW |