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

Unified Diff: content/gpu/gpu_info_collector_android.cc

Issue 11564027: Enable virtual context on IMG devices in a different way (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add t604 Created 8 years 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.cc ('k') | gpu/command_buffer/service/feature_info.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/gpu/gpu_info_collector_android.cc
diff --git a/content/gpu/gpu_info_collector_android.cc b/content/gpu/gpu_info_collector_android.cc
index 5b6a3f97f562db5e1c64251b136f67c702372ad1..df0a7f20ea98439aa6f8085fca4a3cb2b86bd4c6 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) {
« no previous file with comments | « content/common/gpu/gpu_command_buffer_stub.cc ('k') | gpu/command_buffer/service/feature_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698