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

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

Issue 14146011: Renamed 'software_rendering' to 'swiftshader' to differentiate from (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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_process_host.cc
diff --git a/content/browser/gpu/gpu_process_host.cc b/content/browser/gpu/gpu_process_host.cc
index 2d2a5e2a7aa597a5ff084161c83253f22f1757b4..5267c5e38af257d8386e9d5282667a78e5650475 100644
--- a/content/browser/gpu/gpu_process_host.cc
+++ b/content/browser/gpu/gpu_process_host.cc
@@ -325,13 +325,13 @@ bool GpuProcessHost::ValidateHost(GpuProcessHost* host) {
if (!host)
return false;
- // The Gpu process is invalid if it's not using software, the card is
+ // The Gpu process is invalid if it's not using SwiftShader, the card is
// blacklisted, and we can kill it and start over.
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kSingleProcess) ||
CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessGPU) ||
(host->valid_ &&
- (host->software_rendering() ||
- !GpuDataManagerImpl::GetInstance()->ShouldUseSoftwareRendering()))) {
+ (host->swiftshader_rendering_ ||
+ !GpuDataManagerImpl::GetInstance()->ShouldUseSwiftShader()))) {
return true;
}
@@ -423,7 +423,7 @@ GpuProcessHost::GpuProcessHost(int host_id, GpuProcessKind kind)
: host_id_(host_id),
valid_(true),
in_process_(false),
- software_rendering_(false),
+ swiftshader_rendering_(false),
kind_(kind),
process_launched_(false),
initialized_(false),
@@ -467,20 +467,19 @@ GpuProcessHost::~GpuProcessHost() {
static int gpu_recent_crash_count = 0;
static base::Time last_gpu_crash_time;
static bool crashed_before = false;
- static int gpu_software_crash_count = 0;
+ static int swiftshader_crash_count = 0;
// Ending only acts as a failure if the GPU process was actually started and
// was intended for actual rendering (and not just checking caps or other
// options).
if (process_launched_ && kind_ == GPU_PROCESS_KIND_SANDBOXED) {
- if (software_rendering_) {
- UMA_HISTOGRAM_ENUMERATION("GPU.SoftwareRendererLifetimeEvents",
- DIED_FIRST_TIME + gpu_software_crash_count,
+ if (swiftshader_rendering_) {
+ UMA_HISTOGRAM_ENUMERATION("GPU.SwiftShaderLifetimeEvents",
+ DIED_FIRST_TIME + swiftshader_crash_count,
GPU_PROCESS_LIFETIME_EVENT_MAX);
- if (++gpu_software_crash_count >= kGpuMaxCrashCount) {
- // The software renderer is too unstable to use. Disable it for current
- // session.
+ if (++swiftshader_crash_count >= kGpuMaxCrashCount) {
+ // SwiftShader is too unstable to use. Disable it for current session.
gpu_enabled_ = false;
}
} else {
@@ -1055,10 +1054,6 @@ void GpuProcessHost::OnProcessCrashed(int exit_code) {
process_->GetTerminationStatus(NULL));
}
-bool GpuProcessHost::software_rendering() {
- return software_rendering_;
-}
-
GpuProcessHost::GpuProcessKind GpuProcessHost::kind() {
return kind_;
}
@@ -1084,7 +1079,7 @@ void GpuProcessHost::EndFrameSubscription(int surface_id) {
bool GpuProcessHost::LaunchGpuProcess(const std::string& channel_id) {
if (!(gpu_enabled_ &&
- GpuDataManagerImpl::GetInstance()->ShouldUseSoftwareRendering()) &&
+ GpuDataManagerImpl::GetInstance()->ShouldUseSwiftShader()) &&
!hardware_gpu_enabled_) {
SendOutstandingReplies();
return false;
@@ -1156,11 +1151,12 @@ bool GpuProcessHost::LaunchGpuProcess(const std::string& channel_id) {
GpuDataManagerImpl::GetInstance()->AppendGpuCommandLine(cmd_line);
if (cmd_line->HasSwitch(switches::kUseGL)) {
- software_rendering_ =
+ swiftshader_rendering_ =
(cmd_line->GetSwitchValueASCII(switches::kUseGL) == "swiftshader");
}
- UMA_HISTOGRAM_BOOLEAN("GPU.GPUProcessSoftwareRendering", software_rendering_);
+ UMA_HISTOGRAM_BOOLEAN("GPU.GPUProcessSwiftShaderRendering",
jbauman 2013/04/23 00:17:37 Don't change this. It's clear that it relates only
slavi 2013/04/23 00:38:49 Done.
+ swiftshader_rendering_);
// If specified, prepend a launcher program to the command line.
if (!gpu_launcher.empty())

Powered by Google App Engine
This is Rietveld 408576698