diff options
author | sievers@chromium.org <sievers@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-15 00:41:27 +0000 |
---|---|---|
committer | sievers@chromium.org <sievers@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-12-15 00:41:27 +0000 |
commit | f34ffdf264480d3d0c2a15d7a24e55837b08e5c6 (patch) | |
tree | d6dd3bf5f03d2e9d9e37eff374331bb4b8eb858b /content | |
parent | 3c8e1c85d0686125970cda6d6f8e70a6fd256ea7 (diff) | |
download | chromium_src-f34ffdf264480d3d0c2a15d7a24e55837b08e5c6.zip chromium_src-f34ffdf264480d3d0c2a15d7a24e55837b08e5c6.tar.gz chromium_src-f34ffdf264480d3d0c2a15d7a24e55837b08e5c6.tar.bz2 |
Enable virtual context on IMG devices in a different way
Revert "Enable virtual context on IMG devices only."
> Review URL: https://chromiumcodereview.appspot.com/11555010
The flags are only initialized *after* we create the context
and init the decoder (needs a current context for glGetString()).
Instead, append the commandline from gpu_info_collector_android.cc.
BUG=160710,165531
NOTRY=true
Review URL: https://chromiumcodereview.appspot.com/11564027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173245 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r-- | content/common/gpu/gpu_command_buffer_stub.cc | 6 | ||||
-rw-r--r-- | content/gpu/gpu_info_collector_android.cc | 20 |
2 files changed, 21 insertions, 5 deletions
diff --git a/content/common/gpu/gpu_command_buffer_stub.cc b/content/common/gpu/gpu_command_buffer_stub.cc index 2612db2..e6e1e78 100644 --- a/content/common/gpu/gpu_command_buffer_stub.cc +++ b/content/common/gpu/gpu_command_buffer_stub.cc @@ -405,10 +405,8 @@ void GpuCommandBufferStub::OnInitialize( } scoped_refptr<gfx::GLContext> context; - if ((context_group_->feature_info()->feature_flags().enable_virtual_context || - CommandLine::ForCurrentProcess()->HasSwitch( - switches::kEnableVirtualGLContexts)) && - channel_->share_group()) { + if (CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableVirtualGLContexts) && channel_->share_group()) { context = channel_->share_group()->GetSharedContext(); if (!context) { context = gfx::GLContext::CreateGLContext( diff --git a/content/gpu/gpu_info_collector_android.cc b/content/gpu/gpu_info_collector_android.cc index 5b6a3f9..df0a7f2 100644 --- a/content/gpu/gpu_info_collector_android.cc +++ b/content/gpu/gpu_info_collector_android.cc @@ -4,10 +4,13 @@ #include "content/gpu/gpu_info_collector.h" +#include "base/command_line.h" #include "base/logging.h" #include "base/string_number_conversions.h" #include "base/string_piece.h" #include "base/string_split.h" +#include "base/string_util.h" +#include "content/public/common/content_switches.h" namespace { @@ -52,7 +55,22 @@ bool CollectGraphicsInfo(content::GPUInfo* gpu_info) { bool CollectPreliminaryGraphicsInfo(content::GPUInfo* gpu_info) { gpu_info->can_lose_context = false; // Create a short-lived context on the UI thread to collect the GL strings. - return CollectGraphicsInfoGL(gpu_info); + if (!CollectGraphicsInfoGL(gpu_info)) + return false; + + std::string vendor(StringToLowerASCII(gpu_info->gl_vendor)); + std::string renderer(StringToLowerASCII(gpu_info->gl_renderer)); + bool is_img = vendor.find("imagination") != std::string::npos; + bool is_arm = vendor.find("arm") != std::string::npos; + bool is_mali_t604 = is_arm && renderer.find("mali-t604") != std::string::npos; + + // IMG: avoid context switching perf problems, crashes with share groups + // Mali-T604: http://crbug.com/154715 + if (is_img || is_mali_t604) { + CommandLine::ForCurrentProcess()->AppendSwitch( + switches::kEnableVirtualGLContexts); + } + return true; } bool CollectVideoCardInfo(content::GPUInfo* gpu_info) { |