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

Unified Diff: services/ui/display/platform_screen_ozone.cc

Issue 2539843002: mustash: Fix scale factor for bad physical_size. (Closed)
Patch Set: Comment. Created 4 years, 1 month 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/ui/display/platform_screen_ozone.cc
diff --git a/services/ui/display/platform_screen_ozone.cc b/services/ui/display/platform_screen_ozone.cc
index 5d6eea13b6cf51bb15dc4494feaad4f45fb6bddd..6ffb7aad482f0db2714044c4062b736bad9d5983 100644
--- a/services/ui/display/platform_screen_ozone.cc
+++ b/services/ui/display/platform_screen_ozone.cc
@@ -28,7 +28,13 @@ const float kInchInMm = 25.4f;
float ComputeDisplayDPI(const gfx::Size& pixel_size,
const gfx::Size& physical_size) {
- DCHECK(!physical_size.IsEmpty());
+ // The physical_size is broken for some devices, return standard DPI. See
+ // crbug.com/669554.
+ if (physical_size.IsEmpty()) {
+ LOG(ERROR) << "Display has empty phsical_size";
+ return 96.0f;
+ }
+
return (pixel_size.width() / static_cast<float>(physical_size.width())) *
kInchInMm;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698