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

Unified Diff: webkit/plugins/npapi/webplugin_delegate_impl_mac.mm

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
« ui/gfx/gl/gl_context_mac.cc ('K') | « webkit/plugins/npapi/webplugin.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/plugins/npapi/webplugin_delegate_impl_mac.mm
===================================================================
--- webkit/plugins/npapi/webplugin_delegate_impl_mac.mm (revision 105158)
+++ webkit/plugins/npapi/webplugin_delegate_impl_mac.mm (working copy)
@@ -384,8 +384,20 @@
redraw_timer_.reset(new base::RepeatingTimer<WebPluginDelegateImpl>);
}
layer_ = layer;
- surface_ = plugin_->GetAcceleratedSurface();
+ gfx::GpuPreference gpu_preference = gfx::PreferDiscreteGpu;
+ // On dual GPU systems, force the use of the discrete GPU for
+ // the CARenderer underlying our Core Animation backend for
+ // all plugins except Flash. For some reason Unity3D's output
+ // doesn't show up if the integrated GPU is used. Safari keeps
+ // even Flash 11 with Stage3D on the integrated GPU, so mirror
+ // that behavior here.
+ const WebPluginInfo& plugin_info =
+ instance_->plugin_lib()->plugin_info();
+ if (plugin_info.name.find(ASCIIToUTF16("Flash")) != string16::npos)
+ gpu_preference = gfx::PreferIntegratedGpu;
+ surface_ = plugin_->GetAcceleratedSurface(gpu_preference);
+
// If surface initialization fails for some reason, just continue
// without any drawing; returning false would be a more confusing user
// experience (since it triggers a missing plugin placeholder).
« ui/gfx/gl/gl_context_mac.cc ('K') | « webkit/plugins/npapi/webplugin.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698