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/shared_memory.h" | 10 #include "base/shared_memory.h" |
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 !surface_id(), | 500 !surface_id(), |
501 initial_size_, | 501 initial_size_, |
502 disallowed_features_, | 502 disallowed_features_, |
503 allowed_extensions_.c_str(), | 503 allowed_extensions_.c_str(), |
504 requested_attribs_)) { | 504 requested_attribs_)) { |
505 DLOG(ERROR) << "Failed to initialize decoder."; | 505 DLOG(ERROR) << "Failed to initialize decoder."; |
506 OnInitializeFailed(reply_message); | 506 OnInitializeFailed(reply_message); |
507 return; | 507 return; |
508 } | 508 } |
509 | 509 |
510 // TODO(epenner): If we can initialize the feature-info earlier, | |
511 // this code can be removed and done only during surface creation. | |
512 // This code is only needed for the very first surface, which is | |
513 // created before the ContextGroup is initialized. | |
514 if (context_group_->feature_info()->workarounds() | |
515 .makecurrent_recreates_surfaces) { | |
516 // This only works with virtual contexts! | |
517 DCHECK(CommandLine::ForCurrentProcess()->HasSwitch( | |
518 switches::kEnableVirtualGLContexts)); | |
519 surface_->SetRecreateOnMakeCurrent(true); | |
520 } | |
521 | |
522 if (CommandLine::ForCurrentProcess()->HasSwitch( | 510 if (CommandLine::ForCurrentProcess()->HasSwitch( |
523 switches::kEnableGPUServiceLogging)) { | 511 switches::kEnableGPUServiceLogging)) { |
524 decoder_->set_log_commands(true); | 512 decoder_->set_log_commands(true); |
525 } | 513 } |
526 | 514 |
527 decoder_->GetLogger()->SetMsgCallback( | 515 decoder_->GetLogger()->SetMsgCallback( |
528 base::Bind(&GpuCommandBufferStub::SendConsoleMessage, | 516 base::Bind(&GpuCommandBufferStub::SendConsoleMessage, |
529 base::Unretained(this))); | 517 base::Unretained(this))); |
530 decoder_->SetShaderCacheCallback( | 518 decoder_->SetShaderCacheCallback( |
531 base::Bind(&GpuCommandBufferStub::SendCachedShader, | 519 base::Bind(&GpuCommandBufferStub::SendCachedShader, |
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
945 if (surface_ && MakeCurrent()) | 933 if (surface_ && MakeCurrent()) |
946 surface_->SetFrontbufferAllocation( | 934 surface_->SetFrontbufferAllocation( |
947 allocation.browser_allocation.suggest_have_frontbuffer); | 935 allocation.browser_allocation.suggest_have_frontbuffer); |
948 } | 936 } |
949 | 937 |
950 last_memory_allocation_valid_ = true; | 938 last_memory_allocation_valid_ = true; |
951 last_memory_allocation_ = allocation; | 939 last_memory_allocation_ = allocation; |
952 } | 940 } |
953 | 941 |
954 } // namespace content | 942 } // namespace content |
OLD | NEW |