Chromium Code Reviews| 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 "chrome/browser/ui/libgtk2ui/gtk2_ui.h" | 5 #include "chrome/browser/ui/libgtk2ui/gtk2_ui.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 #include <pango/pango.h> | 8 #include <pango/pango.h> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 1337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1348 } | 1348 } |
| 1349 | 1349 |
| 1350 float Gtk2UI::GetDeviceScaleFactor() const { | 1350 float Gtk2UI::GetDeviceScaleFactor() const { |
| 1351 if (gfx::Display::HasForceDeviceScaleFactor()) | 1351 if (gfx::Display::HasForceDeviceScaleFactor()) |
| 1352 return gfx::Display::GetForcedDeviceScaleFactor(); | 1352 return gfx::Display::GetForcedDeviceScaleFactor(); |
| 1353 const int kCSSDefaultDPI = 96; | 1353 const int kCSSDefaultDPI = 96; |
| 1354 const float scale = GetDPI() / kCSSDefaultDPI; | 1354 const float scale = GetDPI() / kCSSDefaultDPI; |
| 1355 // Round to 1 decimal, e.g. to 1.4. | 1355 // Round to 1 decimal, e.g. to 1.4. |
| 1356 const float rounded = roundf(scale * 10) / 10; | 1356 const float rounded = roundf(scale * 10) / 10; |
| 1357 // See crbug.com/484400 | 1357 // See crbug.com/484400 |
| 1358 return rounded < 1.3 ? 1.0 : rounded; | 1358 return rounded < 1.3f ? 1.0f : rounded; |
|
oshima
2016/01/13 23:39:44
I think it's better to be
return scale < 1.3f ? 1
mario.endlessm
2016/01/14 10:43:02
Agreed. I just did not change it now because that
| |
| 1359 } | 1359 } |
| 1360 | 1360 |
| 1361 } // namespace libgtk2ui | 1361 } // namespace libgtk2ui |
| 1362 | 1362 |
| 1363 views::LinuxUI* BuildGtk2UI() { | 1363 views::LinuxUI* BuildGtk2UI() { |
| 1364 return new libgtk2ui::Gtk2UI; | 1364 return new libgtk2ui::Gtk2UI; |
| 1365 } | 1365 } |
| OLD | NEW |