Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(539)

Side by Side Diff: content/common/gpu/gpu_command_buffer_stub.cc

Issue 11555010: Enable virtual context on IMG devices only. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | gpu/command_buffer/service/feature_info.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #if defined(ENABLE_GPU) 5 #if defined(ENABLE_GPU)
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 if (!surface_.get()) { 396 if (!surface_.get()) {
397 // Ensure the decoder is not destroyed if it is not initialized. 397 // Ensure the decoder is not destroyed if it is not initialized.
398 decoder_.reset(); 398 decoder_.reset();
399 399
400 DLOG(ERROR) << "Failed to create surface.\n"; 400 DLOG(ERROR) << "Failed to create surface.\n";
401 OnInitializeFailed(reply_message); 401 OnInitializeFailed(reply_message);
402 return; 402 return;
403 } 403 }
404 404
405 scoped_refptr<gfx::GLContext> context; 405 scoped_refptr<gfx::GLContext> context;
406 if (CommandLine::ForCurrentProcess()->HasSwitch( 406 if ((context_group_->feature_info()->feature_flags().enable_virtual_context ||
407 switches::kEnableVirtualGLContexts) && channel_->share_group()) { 407 CommandLine::ForCurrentProcess()->HasSwitch(
408 switches::kEnableVirtualGLContexts)) &&
409 channel_->share_group()) {
408 context = channel_->share_group()->GetSharedContext(); 410 context = channel_->share_group()->GetSharedContext();
409 if (!context) { 411 if (!context) {
410 context = gfx::GLContext::CreateGLContext( 412 context = gfx::GLContext::CreateGLContext(
411 channel_->share_group(), 413 channel_->share_group(),
412 channel_->gpu_channel_manager()->GetDefaultOffscreenSurface(), 414 channel_->gpu_channel_manager()->GetDefaultOffscreenSurface(),
413 gpu_preference_); 415 gpu_preference_);
414 channel_->share_group()->SetSharedContext(context); 416 channel_->share_group()->SetSharedContext(context);
415 } 417 }
416 // This should be a non-virtual GL context. 418 // This should be a non-virtual GL context.
417 DCHECK(context->GetHandle()); 419 DCHECK(context->GetHandle());
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
911 // made current before calling methods on the surface. 913 // made current before calling methods on the surface.
912 if (!surface_ || !MakeCurrent()) 914 if (!surface_ || !MakeCurrent())
913 return; 915 return;
914 surface_->SetFrontbufferAllocation( 916 surface_->SetFrontbufferAllocation(
915 allocation.browser_allocation.suggest_have_frontbuffer); 917 allocation.browser_allocation.suggest_have_frontbuffer);
916 } 918 }
917 919
918 } // namespace content 920 } // namespace content
919 921
920 #endif // defined(ENABLE_GPU) 922 #endif // defined(ENABLE_GPU)
OLDNEW
« no previous file with comments | « no previous file | gpu/command_buffer/service/feature_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698