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

Side by Side Diff: chrome/browser/ui/webui/gpu_internals_ui.cc

Issue 10915219: Add capability for GPU blacklist to manage GPU switching. (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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/webui/gpu_internals_ui.h" 5 #include "chrome/browser/ui/webui/gpu_internals_ui.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 if (kGpuFeatureInfo[i].name == "css_animation") { 333 if (kGpuFeatureInfo[i].name == "css_animation") {
334 if (has_thread) 334 if (has_thread)
335 status = "accelerated_threaded"; 335 status = "accelerated_threaded";
336 else 336 else
337 status = "accelerated"; 337 status = "accelerated";
338 } 338 }
339 } 339 }
340 feature_status_list->Append( 340 feature_status_list->Append(
341 NewStatusValue(kGpuFeatureInfo[i].name.c_str(), status.c_str())); 341 NewStatusValue(kGpuFeatureInfo[i].name.c_str(), status.c_str()));
342 } 342 }
343 343 content::GPUInfo gpu_info = GpuDataManager::GetInstance()->GetGPUInfo();
344 if (gpu_info.secondary_gpus.size() > 0 ||
345 gpu_info.optimus || gpu_info.amd_switchable) {
346 std::string gpu_switching;
347 switch (GpuDataManager::GetInstance()->GetGpuSwitchingOption()) {
348 case content::GPU_SWITCHING_AUTOMATIC:
349 gpu_switching = "gpu_switching_automatic";
350 break;
351 case content::GPU_SWITCHING_FORCE_DISCRETE:
352 gpu_switching = "gpu_switching_force_discrete";
353 break;
354 case content::GPU_SWITCHING_FORCE_INTEGRATED:
355 gpu_switching = "gpu_switching_force_integrated";
356 break;
357 default:
358 break;
359 }
360 feature_status_list->Append(
361 NewStatusValue("gpu_switching", gpu_switching.c_str()));
362 }
344 status->Set("featureStatus", feature_status_list); 363 status->Set("featureStatus", feature_status_list);
345 } 364 }
346 365
347 // Build the problems list. 366 // Build the problems list.
348 { 367 {
349 ListValue* problem_list = 368 ListValue* problem_list =
350 GpuDataManager::GetInstance()->GetBlacklistReasons(); 369 GpuDataManager::GetInstance()->GetBlacklistReasons();
351 370
352 if (gpu_access_blocked) { 371 if (gpu_access_blocked) {
353 DictionaryValue* problem = new DictionaryValue(); 372 DictionaryValue* problem = new DictionaryValue();
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
623 //////////////////////////////////////////////////////////////////////////////// 642 ////////////////////////////////////////////////////////////////////////////////
624 643
625 GpuInternalsUI::GpuInternalsUI(content::WebUI* web_ui) 644 GpuInternalsUI::GpuInternalsUI(content::WebUI* web_ui)
626 : WebUIController(web_ui) { 645 : WebUIController(web_ui) {
627 web_ui->AddMessageHandler(new GpuMessageHandler()); 646 web_ui->AddMessageHandler(new GpuMessageHandler());
628 647
629 // Set up the chrome://gpu-internals/ source. 648 // Set up the chrome://gpu-internals/ source.
630 Profile* profile = Profile::FromWebUI(web_ui); 649 Profile* profile = Profile::FromWebUI(web_ui);
631 ChromeURLDataManager::AddDataSource(profile, CreateGpuHTMLSource()); 650 ChromeURLDataManager::AddDataSource(profile, CreateGpuHTMLSource());
632 } 651 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698