| 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 |
| 400 std::string GpuDataManager::GetBlacklistVersion() const { | 404 std::string GpuDataManager::GetBlacklistVersion() const { |
| 401 GpuBlacklist* blacklist = GetGpuBlacklist(); | 405 GpuBlacklist* blacklist = GetGpuBlacklist(); |
| 402 if (blacklist != NULL) { | 406 if (blacklist != NULL) { |
| 403 uint16 version_major, version_minor; | 407 uint16 version_major, version_minor; |
| 404 if (blacklist->GetVersion(&version_major, &version_minor)) { | 408 if (blacklist->GetVersion(&version_major, &version_minor)) { |
| 405 std::string version_string = | 409 std::string version_string = |
| 406 base::UintToString(static_cast<unsigned>(version_major)) + | 410 base::UintToString(static_cast<unsigned>(version_major)) + |
| 407 "." + | 411 "." + |
| 408 base::UintToString(static_cast<unsigned>(version_minor)); | 412 base::UintToString(static_cast<unsigned>(version_minor)); |
| 409 return version_string; | 413 return version_string; |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 gpu_info().gl_renderer)); | 558 gpu_info().gl_renderer)); |
| 555 basic_info->Append(NewDescriptionValuePair("GL_VERSION", | 559 basic_info->Append(NewDescriptionValuePair("GL_VERSION", |
| 556 gpu_info().gl_version_string)); | 560 gpu_info().gl_version_string)); |
| 557 basic_info->Append(NewDescriptionValuePair("GL_EXTENSIONS", | 561 basic_info->Append(NewDescriptionValuePair("GL_EXTENSIONS", |
| 558 gpu_info().gl_extensions)); | 562 gpu_info().gl_extensions)); |
| 559 | 563 |
| 560 DictionaryValue* info = new DictionaryValue(); | 564 DictionaryValue* info = new DictionaryValue(); |
| 561 info->Set("basic_info", basic_info); | 565 info->Set("basic_info", basic_info); |
| 562 | 566 |
| 563 #if defined(OS_WIN) | 567 #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 | |
| 576 Value* dx_info; | 568 Value* dx_info; |
| 577 if (gpu_info().dx_diagnostics.children.size()) | 569 if (gpu_info().dx_diagnostics.children.size()) |
| 578 dx_info = DxDiagNodeToList(gpu_info().dx_diagnostics); | 570 dx_info = DxDiagNodeToList(gpu_info().dx_diagnostics); |
| 579 else | 571 else |
| 580 dx_info = Value::CreateNullValue(); | 572 dx_info = Value::CreateNullValue(); |
| 581 info->Set("diagnostics", dx_info); | 573 info->Set("diagnostics", dx_info); |
| 582 #endif | 574 #endif |
| 583 | 575 |
| 584 return info; | 576 return info; |
| 585 } | 577 } |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 792 bool GpuDataManager::supportsAccelerated2dCanvas() const { | 784 bool GpuDataManager::supportsAccelerated2dCanvas() const { |
| 793 if (gpu_info_.can_lose_context) | 785 if (gpu_info_.can_lose_context) |
| 794 return false; | 786 return false; |
| 795 #if defined(USE_SKIA) | 787 #if defined(USE_SKIA) |
| 796 return true; | 788 return true; |
| 797 #else | 789 #else |
| 798 return false; | 790 return false; |
| 799 #endif | 791 #endif |
| 800 } | 792 } |
| 801 | 793 |
| OLD | NEW |