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

Unified Diff: content/browser/gpu/gpu_util.cc

Issue 10909221: Implement blacklist's force GPU capability in dual GPU machines. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 3 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
Index: content/browser/gpu/gpu_util.cc
===================================================================
--- content/browser/gpu/gpu_util.cc (revision 156326)
+++ content/browser/gpu/gpu_util.cc (working copy)
@@ -13,6 +13,7 @@
#include "base/version.h"
#include "content/browser/gpu/gpu_blacklist.h"
#include "content/public/common/content_switches.h"
+#include "ui/gl/gl_switches.h"
using content::GpuFeatureType;
using content::GpuSwitchingOption;
@@ -30,11 +31,6 @@
const char kGpuFeatureNameAll[] = "all";
const char kGpuFeatureNameUnknown[] = "unknown";
-const char kGpuSwitchingNameAutomatic[] = "automatic";
-const char kGpuSwitchingNameForceIntegrated[] = "force_integrated";
-const char kGpuSwitchingNameForceDiscrete[] = "force_discrete";
-const char kGpuSwitchingNameUnknown[] = "unknown";
-
enum GpuFeatureStatus {
kGpuFeatureEnabled = 0,
kGpuFeatureBlacklisted = 1,
@@ -141,15 +137,28 @@
GpuSwitchingOption StringToGpuSwitchingOption(
const std::string& switching_string) {
- if (switching_string == kGpuSwitchingNameAutomatic)
- return content::GPU_SWITCHING_AUTOMATIC;
- if (switching_string == kGpuSwitchingNameForceIntegrated)
- return content::GPU_SWITCHING_FORCE_INTEGRATED;
- if (switching_string == kGpuSwitchingNameForceDiscrete)
- return content::GPU_SWITCHING_FORCE_DISCRETE;
- return content::GPU_SWITCHING_UNKNOWN;
+ if (switching_string == switches::kGpuSwitchingOptionNameAutomatic)
+ return content::GPU_SWITCHING_OPTION_AUTOMATIC;
+ if (switching_string == switches::kGpuSwitchingOptionNameForceIntegrated)
+ return content::GPU_SWITCHING_OPTION_FORCE_INTEGRATED;
+ if (switching_string == switches::kGpuSwitchingOptionNameForceDiscrete)
+ return content::GPU_SWITCHING_OPTION_FORCE_DISCRETE;
+ return content::GPU_SWITCHING_OPTION_UNKNOWN;
}
+std::string GpuSwitchingOptionToString(GpuSwitchingOption option) {
+ switch (option) {
+ case content::GPU_SWITCHING_OPTION_AUTOMATIC:
+ return switches::kGpuSwitchingOptionNameAutomatic;
+ case content::GPU_SWITCHING_OPTION_FORCE_INTEGRATED:
+ return switches::kGpuSwitchingOptionNameForceIntegrated;
+ case content::GPU_SWITCHING_OPTION_FORCE_DISCRETE:
+ return switches::kGpuSwitchingOptionNameForceDiscrete;
+ default:
+ return "unknown";
+ }
+}
+
void UpdateStats(const GpuBlacklist* blacklist,
uint32 blacklisted_features) {
uint32 max_entry_id = blacklist->max_entry_id();

Powered by Google App Engine
This is Rietveld 408576698