Index: content/browser/gpu/gpu_internals_ui.cc |
diff --git a/content/browser/gpu/gpu_internals_ui.cc b/content/browser/gpu/gpu_internals_ui.cc |
index e93c9015202ee9fd528180814c4897c98cb52c15..816fce42b80fbda594b79a81bf3213c6e14e96d0 100644 |
--- a/content/browser/gpu/gpu_internals_ui.cc |
+++ b/content/browser/gpu/gpu_internals_ui.cc |
@@ -6,6 +6,7 @@ |
#include <stddef.h> |
+#include <sstream> |
#include <string> |
#include "base/bind.h" |
@@ -42,6 +43,7 @@ |
#endif |
#if defined(OS_WIN) |
#include "ui/base/win/shell.h" |
+#include "ui/gfx/win/physical_size.h" |
#endif |
#if defined(OS_LINUX) && defined(USE_X11) |
@@ -148,6 +150,24 @@ base::DictionaryValue* GpuInfoAsDictionaryValue() { |
basic_info->Append(NewDescriptionValuePair("Using WARP", |
new base::FundamentalValue(true))); |
} |
+ |
+ std::vector<gfx::DisplaySize> display_sizes; |
+ gfx::GetPhysicalSizeForDisplays(&display_sizes); |
+ for (size_t i = 0; i < display_sizes.size(); ++i) { |
robliao
2016/01/11 18:42:20
Could probably use the C++11 foreach here too.
for
Bret
2016/01/12 00:23:46
Done.
|
+ const gfx::DisplaySize& display_size = display_sizes[i]; |
+ int w = display_size.width_mm; |
+ int h = display_size.height_mm; |
+ double size_mm = sqrt(w * w + h * h); |
+ double size_inches = 0.0393701 * size_mm; |
+ double rounded_size_inches = floor(10.0 * size_inches) / 10.0; |
+ std::ostringstream size_stream; |
scottmg
2016/01/09 01:00:05
I see we've recently changed the style guide to al
Bret
2016/01/12 00:23:46
Done.
|
+ size_stream << rounded_size_inches << "\""; |
+ std::ostringstream description_stream; |
+ description_stream << "Diagonal Monitor Size of " |
+ << display_size.display_name; |
+ basic_info->Append( |
+ NewDescriptionValuePair(description_stream.str(), size_stream.str())); |
+ } |
#endif |
std::string disabled_extensions; |