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

Side by Side Diff: chrome/browser/ui/libgtk2ui/gtk2_ui.cc

Issue 1581883003: Use float literals to decide when to blacklist low scaling factors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« 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