Chromium Code Reviews| 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 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 419 DCHECK(context->GetHandle()); | 419 DCHECK(context->GetHandle()); |
| 420 context = new gpu::GLContextVirtual(channel_->share_group(), | 420 context = new gpu::GLContextVirtual(channel_->share_group(), |
| 421 context, | 421 context, |
| 422 decoder_->AsWeakPtr()); | 422 decoder_->AsWeakPtr()); |
| 423 if (!context->Initialize(surface_, gpu_preference_)) { | 423 if (!context->Initialize(surface_, gpu_preference_)) { |
| 424 // TODO(sievers): The real context created above for the default | 424 // TODO(sievers): The real context created above for the default |
| 425 // offscreen surface might not be compatible with this surface. | 425 // offscreen surface might not be compatible with this surface. |
| 426 // Need to adjust at least GLX to be able to create the initial context | 426 // Need to adjust at least GLX to be able to create the initial context |
| 427 // with a config that is compatible with onscreen and offscreen surfaces. | 427 // with a config that is compatible with onscreen and offscreen surfaces. |
| 428 context = NULL; | 428 context = NULL; |
| 429 LOG(FATAL) << "Failed to initialize virtual GL context."; | 429 |
| 430 // Ensure the decoder is not destroyed if it is not initialized. | |
| 431 decoder_.reset(); | |
| 432 | |
| 433 DLOG(ERROR) << "Failed to initialize virtual GL context."; | |
| 434 OnInitializeFailed(reply_message); | |
| 435 return; | |
|
boliu
2013/01/26 01:18:00
Daniel...would this be better? I can't get it to f
no sievers
2013/01/28 19:46:15
I'm surprised the failure here did not go away wit
| |
| 430 } else { | 436 } else { |
| 431 LOG(INFO) << "Created virtual GL context."; | 437 LOG(INFO) << "Created virtual GL context."; |
| 432 } | 438 } |
| 433 } | 439 } |
| 434 if (!context) { | 440 if (!context) { |
| 435 context = gfx::GLContext::CreateGLContext( | 441 context = gfx::GLContext::CreateGLContext( |
| 436 channel_->share_group(), | 442 channel_->share_group(), |
| 437 surface_.get(), | 443 surface_.get(), |
| 438 gpu_preference_); | 444 gpu_preference_); |
| 439 } | 445 } |
| (...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 881 if (surface_ && MakeCurrent()) | 887 if (surface_ && MakeCurrent()) |
| 882 surface_->SetFrontbufferAllocation( | 888 surface_->SetFrontbufferAllocation( |
| 883 allocation.browser_allocation.suggest_have_frontbuffer); | 889 allocation.browser_allocation.suggest_have_frontbuffer); |
| 884 } | 890 } |
| 885 | 891 |
| 886 last_memory_allocation_valid_ = true; | 892 last_memory_allocation_valid_ = true; |
| 887 last_memory_allocation_ = allocation; | 893 last_memory_allocation_ = allocation; |
| 888 } | 894 } |
| 889 | 895 |
| 890 } // namespace content | 896 } // namespace content |
| OLD | NEW |