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

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

Issue 435383002: adds WARP support to Chromium, for Metro mode only, on Windows 8 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: first round of tryfixes Created 6 years, 4 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_data_manager_impl_private.cc
diff --git a/content/browser/gpu/gpu_data_manager_impl_private.cc b/content/browser/gpu/gpu_data_manager_impl_private.cc
index bbf7231c954858ff4828b1745ea994a9b177050f..3ca5d6d34b92588c3696cc4b690a37bc994b4afb 100644
--- a/content/browser/gpu/gpu_data_manager_impl_private.cc
+++ b/content/browser/gpu/gpu_data_manager_impl_private.cc
@@ -271,7 +271,7 @@ bool GpuDataManagerImplPrivate::IsFeatureBlacklisted(int feature) const {
return true;
}
#endif // OS_CHROMEOS
- if (use_swiftshader_) {
+ if (use_swiftshader_ || gpu_info_.use_warp) {
// Skia's software rendering is probably more efficient than going through
// software emulation of the GPU, so use that.
if (feature == gpu::GPU_FEATURE_TYPE_ACCELERATED_2D_CANVAS)
@@ -287,7 +287,7 @@ bool GpuDataManagerImplPrivate::IsDriverBugWorkaroundActive(int feature) const {
}
size_t GpuDataManagerImplPrivate::GetBlacklistedFeatureCount() const {
- if (use_swiftshader_)
+ if (use_swiftshader_ || gpu_info_.use_warp)
return 1;
return blacklisted_features_.size();
}
@@ -311,7 +311,7 @@ void GpuDataManagerImplPrivate::GetGpuProcessHandles(
bool GpuDataManagerImplPrivate::GpuAccessAllowed(
std::string* reason) const {
- if (use_swiftshader_)
+ if (use_swiftshader_ || gpu_info_.use_warp)
return true;
if (!gpu_process_accessible_) {
@@ -471,6 +471,18 @@ void GpuDataManagerImplPrivate::GetGLStrings(std::string* gl_vendor,
*gl_version = gpu_info_.gl_version;
}
+void GpuDataManagerImplPrivate::SetShouldUseWarp(bool use_warp) {
+ gpu_info_.use_warp = use_warp;
Zhenyao Mo 2014/08/20 21:02:09 This is incorrect. gpu_info_ could be updated mul
luken 2014/08/27 20:43:46 Deprecated code.
+ // Let the observers know, particularly the GpuPrefManager, so it can update
+ // its persistent state about using warp or not.
+ NotifyGpuInfoUpdate();
+}
+
+bool GpuDataManagerImplPrivate::ShouldUseWarp() const {
+ return gpu_info_.use_warp ||
+ base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseWarp);
+}
+
void GpuDataManagerImplPrivate::Initialize() {
TRACE_EVENT0("startup", "GpuDataManagerImpl::Initialize");
if (finalized_) {
@@ -545,7 +557,7 @@ void GpuDataManagerImplPrivate::UpdateGpuInfoHelper() {
void GpuDataManagerImplPrivate::UpdateGpuInfo(const gpu::GPUInfo& gpu_info) {
// No further update of gpu_info if falling back to SwiftShader.
- if (use_swiftshader_)
+ if (use_swiftshader_ || gpu_info_.use_warp)
return;
gpu::MergeGPUInfo(&gpu_info_, gpu_info);
@@ -645,6 +657,9 @@ void GpuDataManagerImplPrivate::AppendGpuCommandLine(
gpu_info_.driver_vendor);
command_line->AppendSwitchASCII(switches::kGpuDriverVersion,
gpu_info_.driver_version);
+
+ if (ShouldUseWarp())
+ command_line->AppendSwitch(switches::kUseWarp);
}
void GpuDataManagerImplPrivate::AppendPluginCommandLine(
@@ -819,6 +834,8 @@ bool GpuDataManagerImplPrivate::UpdateActiveGpu(
}
bool GpuDataManagerImplPrivate::CanUseGpuBrowserCompositor() const {
+ if (gpu_info_.use_warp)
Zhenyao Mo 2014/08/20 21:02:09 You should use ShouldUseWarp() here to be consiste
luken 2014/08/27 20:43:46 Done.
+ return true;
if (ShouldUseSwiftShader())
return false;
if (IsFeatureBlacklisted(gpu::GPU_FEATURE_TYPE_GPU_COMPOSITING))

Powered by Google App Engine
This is Rietveld 408576698