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

Unified Diff: content/common/gpu/gpu_command_buffer_stub.cc

Issue 8233027: Support dynamic switching between integrated and discrete GPUs on Mac OS X. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/gpu/gpu_command_buffer_stub.h ('k') | content/common/gpu/gpu_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/gpu_command_buffer_stub.cc
===================================================================
--- content/common/gpu/gpu_command_buffer_stub.cc (revision 105357)
+++ content/common/gpu/gpu_command_buffer_stub.cc (working copy)
@@ -29,6 +29,7 @@
const gpu::gles2::DisallowedFeatures& disallowed_features,
const std::string& allowed_extensions,
const std::vector<int32>& attribs,
+ gfx::GpuPreference gpu_preference,
int32 route_id,
int32 renderer_id,
int32 render_view_id,
@@ -40,6 +41,7 @@
disallowed_features_(disallowed_features),
allowed_extensions_(allowed_extensions),
requested_attribs_(attribs),
+ gpu_preference_(gpu_preference),
route_id_(route_id),
software_(software),
last_flush_count_(0),
@@ -203,8 +205,14 @@
return;
}
- context_ = gfx::GLContext::CreateGLContext(channel_->share_group(),
- surface_.get());
+ gfx::GpuPreference gpu_preference =
+ channel_->ShouldPreferDiscreteGpu() ?
+ gfx::PreferDiscreteGpu : gpu_preference_;
+
+ context_ = gfx::GLContext::CreateGLContext(
+ channel_->share_group(),
+ surface_.get(),
+ gpu_preference);
if (!context_.get()) {
LOG(ERROR) << "Failed to create context.\n";
OnInitializeFailed(reply_message);
« no previous file with comments | « content/common/gpu/gpu_command_buffer_stub.h ('k') | content/common/gpu/gpu_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698