| OLD | NEW |
| 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 "content/browser/gpu/gpu_data_manager.h" | 5 #include "content/browser/gpu/gpu_data_manager.h" |
| 6 | 6 |
| 7 #if defined(OS_MACOSX) | 7 #if defined(OS_MACOSX) |
| 8 #include <CoreGraphics/CGDisplayConfiguration.h> | 8 #include <CoreGraphics/CGDisplayConfiguration.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 GpuBlacklist* blacklist = GetGpuBlacklist(); | 390 GpuBlacklist* blacklist = GetGpuBlacklist(); |
| 391 if (blacklist) | 391 if (blacklist) |
| 392 blacklist->GetBlacklistReasons(problem_list); | 392 blacklist->GetBlacklistReasons(problem_list); |
| 393 | 393 |
| 394 status->Set("problems", problem_list); | 394 status->Set("problems", problem_list); |
| 395 } | 395 } |
| 396 | 396 |
| 397 return status; | 397 return status; |
| 398 } | 398 } |
| 399 | 399 |
| 400 GpuPerformanceStats GpuDataManager::GetPerformanceStats() const { | |
| 401 return GpuPerformanceStats::RetrieveGpuPerformanceStats(); | |
| 402 } | |
| 403 | |
| 404 std::string GpuDataManager::GetBlacklistVersion() const { | 400 std::string GpuDataManager::GetBlacklistVersion() const { |
| 405 GpuBlacklist* blacklist = GetGpuBlacklist(); | 401 GpuBlacklist* blacklist = GetGpuBlacklist(); |
| 406 if (blacklist != NULL) { | 402 if (blacklist != NULL) { |
| 407 uint16 version_major, version_minor; | 403 uint16 version_major, version_minor; |
| 408 if (blacklist->GetVersion(&version_major, &version_minor)) { | 404 if (blacklist->GetVersion(&version_major, &version_minor)) { |
| 409 std::string version_string = | 405 std::string version_string = |
| 410 base::UintToString(static_cast<unsigned>(version_major)) + | 406 base::UintToString(static_cast<unsigned>(version_major)) + |
| 411 "." + | 407 "." + |
| 412 base::UintToString(static_cast<unsigned>(version_minor)); | 408 base::UintToString(static_cast<unsigned>(version_minor)); |
| 413 return version_string; | 409 return version_string; |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 558 gpu_info().gl_renderer)); | 554 gpu_info().gl_renderer)); |
| 559 basic_info->Append(NewDescriptionValuePair("GL_VERSION", | 555 basic_info->Append(NewDescriptionValuePair("GL_VERSION", |
| 560 gpu_info().gl_version_string)); | 556 gpu_info().gl_version_string)); |
| 561 basic_info->Append(NewDescriptionValuePair("GL_EXTENSIONS", | 557 basic_info->Append(NewDescriptionValuePair("GL_EXTENSIONS", |
| 562 gpu_info().gl_extensions)); | 558 gpu_info().gl_extensions)); |
| 563 | 559 |
| 564 DictionaryValue* info = new DictionaryValue(); | 560 DictionaryValue* info = new DictionaryValue(); |
| 565 info->Set("basic_info", basic_info); | 561 info->Set("basic_info", basic_info); |
| 566 | 562 |
| 567 #if defined(OS_WIN) | 563 #if defined(OS_WIN) |
| 564 ListValue* perf_info = new ListValue(); |
| 565 perf_info->Append(NewDescriptionValuePair( |
| 566 "Graphics", |
| 567 base::StringPrintf("%.1f", gpu_info.performance_stats.graphics))); |
| 568 perf_info->Append(NewDescriptionValuePair( |
| 569 "Gaming", |
| 570 base::StringPrintf("%.1f", gpu_info.performance_stats.gaming))); |
| 571 perf_info->Append(NewDescriptionValuePair( |
| 572 "Overall", |
| 573 base::StringPrintf("%.1f", gpu_info.performance_stats.overall))); |
| 574 info->Set("performance_info", perf_info); |
| 575 |
| 568 Value* dx_info; | 576 Value* dx_info; |
| 569 if (gpu_info().dx_diagnostics.children.size()) | 577 if (gpu_info().dx_diagnostics.children.size()) |
| 570 dx_info = DxDiagNodeToList(gpu_info().dx_diagnostics); | 578 dx_info = DxDiagNodeToList(gpu_info().dx_diagnostics); |
| 571 else | 579 else |
| 572 dx_info = Value::CreateNullValue(); | 580 dx_info = Value::CreateNullValue(); |
| 573 info->Set("diagnostics", dx_info); | 581 info->Set("diagnostics", dx_info); |
| 574 #endif | 582 #endif |
| 575 | 583 |
| 576 return info; | 584 return info; |
| 577 } | 585 } |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 784 bool GpuDataManager::supportsAccelerated2dCanvas() const { | 792 bool GpuDataManager::supportsAccelerated2dCanvas() const { |
| 785 if (gpu_info_.can_lose_context) | 793 if (gpu_info_.can_lose_context) |
| 786 return false; | 794 return false; |
| 787 #if defined(USE_SKIA) | 795 #if defined(USE_SKIA) |
| 788 return true; | 796 return true; |
| 789 #else | 797 #else |
| 790 return false; | 798 return false; |
| 791 #endif | 799 #endif |
| 792 } | 800 } |
| 793 | 801 |
| OLD | NEW |