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

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

Issue 1563183008: Added capability on Windows to get the physical dimensions of your attached monitors. Also added th… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix gn build and applied guid brace warning fix Created 4 years, 11 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
« no previous file with comments | « no previous file | ui/gfx/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c32b27e11238ad882401a88cc8d2a3599dc1f7bc 100644
--- a/content/browser/gpu/gpu_internals_ui.cc
+++ b/content/browser/gpu/gpu_internals_ui.cc
@@ -42,6 +42,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 +149,21 @@ base::DictionaryValue* GpuInfoAsDictionaryValue() {
basic_info->Append(NewDescriptionValuePair("Using WARP",
new base::FundamentalValue(true)));
}
+
+ std::vector<gfx::PhysicalDisplaySize> display_sizes =
+ gfx::GetPhysicalSizeForDisplays();
+ for (const auto& display_size : display_sizes) {
+ const int w = display_size.width_mm;
+ const int h = display_size.height_mm;
+ const double size_mm = sqrt(w * w + h * h);
+ const double size_inches = 0.0393701 * size_mm;
+ const double rounded_size_inches = floor(10.0 * size_inches) / 10.0;
+ std::string size_string = base::StringPrintf("%.1f\"", rounded_size_inches);
+ std::string description_string = base::StringPrintf(
+ "Diagonal Monitor Size of %s", display_size.display_name.c_str());
+ basic_info->Append(
+ NewDescriptionValuePair(description_string, size_string));
+ }
#endif
std::string disabled_extensions;
« no previous file with comments | « no previous file | ui/gfx/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698