summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--content/common/gpu/gpu_command_buffer_stub.cc6
-rw-r--r--content/gpu/gpu_info_collector_android.cc20
-rw-r--r--gpu/command_buffer/service/feature_info.cc21
-rw-r--r--gpu/command_buffer/service/feature_info.h1
4 files changed, 26 insertions, 22 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) {
diff --git a/gpu/command_buffer/service/feature_info.cc b/gpu/command_buffer/service/feature_info.cc
index d447022..2a738b8 100644
--- a/gpu/command_buffer/service/feature_info.cc
+++ b/gpu/command_buffer/service/feature_info.cc
@@ -82,8 +82,7 @@ FeatureInfo::FeatureFlags::FeatureFlags()
use_arb_occlusion_query_for_occlusion_query_boolean(false),
native_vertex_array_object(false),
disable_workarounds(false),
- enable_shader_name_hashing(false),
- enable_virtual_context(false) {
+ enable_shader_name_hashing(false) {
}
FeatureInfo::Workarounds::Workarounds()
@@ -208,12 +207,9 @@ void FeatureInfo::AddFeatures(const char* desired_features) {
GL_RENDERER,
};
bool is_intel = false;
- bool is_nvidia_desktop = false;
+ bool is_nvidia = false;
bool is_amd = false;
bool is_mesa = false;
- bool is_nvidia_tegra = false;
- bool is_img = false;
- bool is_arm = false;
bool is_qualcomm = false;
for (size_t ii = 0; ii < arraysize(string_ids); ++ii) {
const char* str = reinterpret_cast<const char*>(
@@ -222,15 +218,9 @@ void FeatureInfo::AddFeatures(const char* desired_features) {
std::string lstr(StringToLowerASCII(std::string(str)));
StringSet string_set(lstr);
is_intel |= string_set.Contains("intel");
- is_nvidia_desktop |= string_set.Contains("nvidia");
+ is_nvidia |= string_set.Contains("nvidia");
is_amd |= string_set.Contains("amd") || string_set.Contains("ati");
is_mesa |= string_set.Contains("mesa");
-
- is_nvidia_tegra |= string_set.Contains("tegra");
- if (is_nvidia_tegra)
- is_nvidia_desktop = false;
- is_img |= string_set.Contains("imagination");
- is_arm |= string_set.Contains("arm");
is_qualcomm |= string_set.Contains("qualcomm");
}
}
@@ -243,7 +233,6 @@ void FeatureInfo::AddFeatures(const char* desired_features) {
CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableShaderNameHashing);
- feature_flags_.enable_virtual_context = is_img;
bool npot_ok = false;
@@ -677,12 +666,12 @@ void FeatureInfo::AddFeatures(const char* desired_features) {
workarounds_.set_texture_filter_before_generating_mipmap = true;
workarounds_.clear_alpha_in_readpixels = true;
- if (is_nvidia_desktop) {
+ if (is_nvidia) {
workarounds_.use_current_program_after_successful_link = true;
}
#if defined(OS_MACOSX)
- workarounds_.needs_offscreen_buffer_workaround = is_nvidia_desktop;
+ workarounds_.needs_offscreen_buffer_workaround = is_nvidia;
workarounds_.needs_glsl_built_in_function_emulation = is_amd;
if ((is_amd || is_intel) &&
diff --git a/gpu/command_buffer/service/feature_info.h b/gpu/command_buffer/service/feature_info.h
index a9fb832..ec03789 100644
--- a/gpu/command_buffer/service/feature_info.h
+++ b/gpu/command_buffer/service/feature_info.h
@@ -42,7 +42,6 @@ class GPU_EXPORT FeatureInfo : public base::RefCounted<FeatureInfo> {
bool native_vertex_array_object;
bool disable_workarounds;
bool enable_shader_name_hashing;
- bool enable_virtual_context;
};
struct Workarounds {