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

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

Issue 11564027: Enable virtual context on IMG devices in a different way (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add t604 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | content/gpu/gpu_info_collector_android.cc » ('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 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 if (!surface_.get()) { 398 if (!surface_.get()) {
399 // Ensure the decoder is not destroyed if it is not initialized. 399 // Ensure the decoder is not destroyed if it is not initialized.
400 decoder_.reset(); 400 decoder_.reset();
401 401
402 DLOG(ERROR) << "Failed to create surface.\n"; 402 DLOG(ERROR) << "Failed to create surface.\n";
403 OnInitializeFailed(reply_message); 403 OnInitializeFailed(reply_message);
404 return; 404 return;
405 } 405 }
406 406
407 scoped_refptr<gfx::GLContext> context; 407 scoped_refptr<gfx::GLContext> context;
408 if ((context_group_->feature_info()->feature_flags().enable_virtual_context || 408 if (CommandLine::ForCurrentProcess()->HasSwitch(
409 CommandLine::ForCurrentProcess()->HasSwitch( 409 switches::kEnableVirtualGLContexts) && channel_->share_group()) {
410 switches::kEnableVirtualGLContexts)) &&
411 channel_->share_group()) {
412 context = channel_->share_group()->GetSharedContext(); 410 context = channel_->share_group()->GetSharedContext();
413 if (!context) { 411 if (!context) {
414 context = gfx::GLContext::CreateGLContext( 412 context = gfx::GLContext::CreateGLContext(
415 channel_->share_group(), 413 channel_->share_group(),
416 channel_->gpu_channel_manager()->GetDefaultOffscreenSurface(), 414 channel_->gpu_channel_manager()->GetDefaultOffscreenSurface(),
417 gpu_preference_); 415 gpu_preference_);
418 channel_->share_group()->SetSharedContext(context); 416 channel_->share_group()->SetSharedContext(context);
419 } 417 }
420 // This should be a non-virtual GL context. 418 // This should be a non-virtual GL context.
421 DCHECK(context->GetHandle()); 419 DCHECK(context->GetHandle());
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after
915 // made current before calling methods on the surface. 913 // made current before calling methods on the surface.
916 if (!surface_ || !MakeCurrent()) 914 if (!surface_ || !MakeCurrent())
917 return; 915 return;
918 surface_->SetFrontbufferAllocation( 916 surface_->SetFrontbufferAllocation(
919 allocation.browser_allocation.suggest_have_frontbuffer); 917 allocation.browser_allocation.suggest_have_frontbuffer);
920 } 918 }
921 919
922 } // namespace content 920 } // namespace content
923 921
924 #endif // defined(ENABLE_GPU) 922 #endif // defined(ENABLE_GPU)
OLDNEW
« no previous file with comments | « no previous file | content/gpu/gpu_info_collector_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698