Commit e36f6702 authored by ccameron@chromium.org's avatar ccameron@chromium.org

Enable GL context virtualization for compositor contexts on Mac.

BUG=180463
NOTRY=true

Review URL: https://chromiumcodereview.appspot.com/13689003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193397 0039d316-1c4b-4281-b951-d872f2087c98
parent 38484df1
...@@ -628,6 +628,14 @@ void GpuChannel::CreateViewCommandBuffer( ...@@ -628,6 +628,14 @@ void GpuChannel::CreateViewCommandBuffer(
GpuCommandBufferStub* share_group = stubs_.Lookup(init_params.share_group_id); GpuCommandBufferStub* share_group = stubs_.Lookup(init_params.share_group_id);
// Virtualize compositor contexts on OS X to prevent performance regressions
// when enabling FCM.
// http://crbug.com/180463
bool use_virtualized_gl_context = false;
#if defined(OS_MACOSX)
use_virtualized_gl_context = true;
#endif
*route_id = GenerateRouteID(); *route_id = GenerateRouteID();
scoped_ptr<GpuCommandBufferStub> stub(new GpuCommandBufferStub( scoped_ptr<GpuCommandBufferStub> stub(new GpuCommandBufferStub(
this, this,
...@@ -640,6 +648,7 @@ void GpuChannel::CreateViewCommandBuffer( ...@@ -640,6 +648,7 @@ void GpuChannel::CreateViewCommandBuffer(
init_params.allowed_extensions, init_params.allowed_extensions,
init_params.attribs, init_params.attribs,
init_params.gpu_preference, init_params.gpu_preference,
use_virtualized_gl_context,
*route_id, *route_id,
surface_id, surface_id,
watchdog_, watchdog_,
...@@ -857,8 +866,10 @@ void GpuChannel::OnCreateOffscreenCommandBuffer( ...@@ -857,8 +866,10 @@ void GpuChannel::OnCreateOffscreenCommandBuffer(
init_params.allowed_extensions, init_params.allowed_extensions,
init_params.attribs, init_params.attribs,
init_params.gpu_preference, init_params.gpu_preference,
false,
*route_id, *route_id,
0, watchdog_, 0,
watchdog_,
software_, software_,
init_params.active_url)); init_params.active_url));
if (preempted_flag_.get()) if (preempted_flag_.get())
......
...@@ -107,6 +107,7 @@ GpuCommandBufferStub::GpuCommandBufferStub( ...@@ -107,6 +107,7 @@ GpuCommandBufferStub::GpuCommandBufferStub(
const std::string& allowed_extensions, const std::string& allowed_extensions,
const std::vector<int32>& attribs, const std::vector<int32>& attribs,
gfx::GpuPreference gpu_preference, gfx::GpuPreference gpu_preference,
bool use_virtualized_gl_context,
int32 route_id, int32 route_id,
int32 surface_id, int32 surface_id,
GpuWatchdog* watchdog, GpuWatchdog* watchdog,
...@@ -119,6 +120,7 @@ GpuCommandBufferStub::GpuCommandBufferStub( ...@@ -119,6 +120,7 @@ GpuCommandBufferStub::GpuCommandBufferStub(
allowed_extensions_(allowed_extensions), allowed_extensions_(allowed_extensions),
requested_attribs_(attribs), requested_attribs_(attribs),
gpu_preference_(gpu_preference), gpu_preference_(gpu_preference),
use_virtualized_gl_context_(use_virtualized_gl_context),
route_id_(route_id), route_id_(route_id),
surface_id_(surface_id), surface_id_(surface_id),
software_(software), software_(software),
...@@ -433,8 +435,9 @@ void GpuCommandBufferStub::OnInitialize( ...@@ -433,8 +435,9 @@ void GpuCommandBufferStub::OnInitialize(
} }
scoped_refptr<gfx::GLContext> context; scoped_refptr<gfx::GLContext> context;
if (CommandLine::ForCurrentProcess()->HasSwitch( if ((CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableVirtualGLContexts) && channel_->share_group()) { switches::kEnableVirtualGLContexts) || use_virtualized_gl_context_) &&
channel_->share_group()) {
context = channel_->share_group()->GetSharedContext(); context = channel_->share_group()->GetSharedContext();
if (!context) { if (!context) {
context = gfx::GLContext::CreateGLContext( context = gfx::GLContext::CreateGLContext(
......
...@@ -69,6 +69,7 @@ class GpuCommandBufferStub ...@@ -69,6 +69,7 @@ class GpuCommandBufferStub
const std::string& allowed_extensions, const std::string& allowed_extensions,
const std::vector<int32>& attribs, const std::vector<int32>& attribs,
gfx::GpuPreference gpu_preference, gfx::GpuPreference gpu_preference,
bool use_virtualized_gl_context,
int32 route_id, int32 route_id,
int32 surface_id, int32 surface_id,
GpuWatchdog* watchdog, GpuWatchdog* watchdog,
...@@ -204,6 +205,7 @@ class GpuCommandBufferStub ...@@ -204,6 +205,7 @@ class GpuCommandBufferStub
std::string allowed_extensions_; std::string allowed_extensions_;
std::vector<int32> requested_attribs_; std::vector<int32> requested_attribs_;
gfx::GpuPreference gpu_preference_; gfx::GpuPreference gpu_preference_;
bool use_virtualized_gl_context_;
int32 route_id_; int32 route_id_;
int32 surface_id_; int32 surface_id_;
bool software_; bool software_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment