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

Unified Diff: gpu/config/gpu_util.cc

Issue 2654993004: Move GPU blacklist calculation to GPU proc (Closed)
Patch Set: fix win clang build Created 3 years, 10 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
« no previous file with comments | « gpu/config/gpu_util.h ('k') | gpu/gles2_conform_support/egl/context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/config/gpu_util.cc
diff --git a/gpu/config/gpu_util.cc b/gpu/config/gpu_util.cc
index 49eb25b7f1cfb7d1b66f3d17a7a82245e61d82b3..a305c29698a9baa8e1a72d17c3427712ccf81de0 100644
--- a/gpu/config/gpu_util.cc
+++ b/gpu/config/gpu_util.cc
@@ -12,8 +12,12 @@
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
+#include "base/sys_info.h"
+#include "gpu/config/gpu_blacklist.h"
#include "gpu/config/gpu_control_list_jsons.h"
#include "gpu/config/gpu_driver_bug_list.h"
+#include "gpu/config/gpu_feature_type.h"
+#include "gpu/config/gpu_finch_features.h"
#include "gpu/config/gpu_info_collector.h"
#include "gpu/config/gpu_switches.h"
#include "ui/gl/gl_switches.h"
@@ -59,6 +63,32 @@ void StringToIds(const std::string& str, std::vector<uint32_t>* list) {
}
}
+GpuFeatureStatus GetGpuRasterizationFeatureStatus(
+ const std::set<int>& blacklisted_features,
+ const base::CommandLine& command_line) {
+ if (command_line.HasSwitch(switches::kDisableGpuRasterization))
+ return kGpuFeatureStatusDisabled;
+ else if (command_line.HasSwitch(switches::kEnableGpuRasterization))
+ return kGpuFeatureStatusEnabled;
+
+ if (blacklisted_features.count(GPU_FEATURE_TYPE_GPU_RASTERIZATION))
+ return kGpuFeatureStatusBlacklisted;
+
+#if defined(OS_ANDROID)
+ // We can't use GPU rasterization on low-end devices, because the Ganesh
+ // cache would consume too much memory.
+ if (base::SysInfo::IsLowEndDevice())
+ return kGpuFeatureStatusBlacklisted;
+#endif // defined(OS_ANDROID)
+
+ // Gpu Rasterization on platforms that are not fully enabled is controlled by
+ // a finch experiment.
+ if (!base::FeatureList::IsEnabled(features::kDefaultEnableGpuRasterization))
+ return kGpuFeatureStatusDisabled;
+
+ return kGpuFeatureStatusEnabled;
+}
+
} // namespace anonymous
void ApplyGpuDriverBugWorkarounds(const GPUInfo& gpu_info,
@@ -151,4 +181,22 @@ void InitializeDualGpusIfSupported(
ui::GpuSwitchingManager::GetInstance()->ForceUseOfIntegratedGpu();
}
+GpuFeatureInfo GetGpuFeatureInfo(const GPUInfo& gpu_info,
+ const base::CommandLine& command_line) {
+ GpuFeatureInfo gpu_feature_info;
+ std::set<int> blacklisted_features;
+ if (!command_line.HasSwitch(switches::kIgnoreGpuBlacklist)) {
+ std::unique_ptr<GpuBlacklist> list(GpuBlacklist::Create());
+ list->LoadList(kSoftwareRenderingListJson, GpuControlList::kCurrentOsOnly);
+ blacklisted_features =
+ list->MakeDecision(GpuControlList::kOsAny, std::string(), gpu_info);
+ }
+
+ // Currently only used for GPU rasterization.
+ gpu_feature_info.status_values[GPU_FEATURE_TYPE_GPU_RASTERIZATION] =
+ GetGpuRasterizationFeatureStatus(blacklisted_features, command_line);
+
+ return gpu_feature_info;
+}
+
} // namespace gpu
« no previous file with comments | « gpu/config/gpu_util.h ('k') | gpu/gles2_conform_support/egl/context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698