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

Issue 1581883003: Use float literals to decide when to blacklist low scaling factors (Closed)

Created:
4 years, 11 months ago by mario.endlessm
Modified:
4 years, 11 months ago
Reviewers:
oshima, Evan Stade
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Use float literals to decide when to blacklist low scaling factors The comparison to decide whether to blacklist rounded scaling factors less than 1.3 is comparing a float (the 'rounded' variable) with a double (the '1.3' literal) which won't yield the intended results when 'rounded' is set to the 1.3 float value. So, we need to use the '1.3f' literal here to make sure it's a float, otherwise the comparison will effectively work as 'rounded < 1.4f'. Also, we do the comparison before rounding the scaling factor, so that we use the original value to decide whether to blacklist it or not, otherwise it would misbehave for values between 1.25 - 1.29, as they would get rounded up to 1.3 before the check. BUG=484400 R=oshima@chromium.org, estade@chromium.org Committed: https://crrev.com/e2ff3e6efc9f9d58ba0520b12e313e46be3abef8 Cr-Commit-Position: refs/heads/master@{#370248}

Patch Set 1 #

Total comments: 2

Patch Set 2 : Compare against the original scaling factor, not the rounded one #

Unified diffs Side-by-side diffs Delta from patch set Stats (+4 lines, -4 lines) Patch
M chrome/browser/ui/libgtk2ui/gtk2_ui.cc View 1 1 chunk +4 lines, -4 lines 0 comments Download

Messages

Total messages: 17 (6 generated)
mario.endlessm
The following patch implements the fix proposed in https://codereview.chromium.org/1324513002/#msg11. Please review, thanks.
4 years, 11 months ago (2016-01-13 09:58:02 UTC) #1
oshima
https://codereview.chromium.org/1581883003/diff/1/chrome/browser/ui/libgtk2ui/gtk2_ui.cc File chrome/browser/ui/libgtk2ui/gtk2_ui.cc (right): https://codereview.chromium.org/1581883003/diff/1/chrome/browser/ui/libgtk2ui/gtk2_ui.cc#newcode1358 chrome/browser/ui/libgtk2ui/gtk2_ui.cc:1358: return rounded < 1.3f ? 1.0f : rounded; I ...
4 years, 11 months ago (2016-01-13 23:39:44 UTC) #2
mario.endlessm
https://codereview.chromium.org/1581883003/diff/1/chrome/browser/ui/libgtk2ui/gtk2_ui.cc File chrome/browser/ui/libgtk2ui/gtk2_ui.cc (right): https://codereview.chromium.org/1581883003/diff/1/chrome/browser/ui/libgtk2ui/gtk2_ui.cc#newcode1358 chrome/browser/ui/libgtk2ui/gtk2_ui.cc:1358: return rounded < 1.3f ? 1.0f : rounded; On ...
4 years, 11 months ago (2016-01-14 10:43:02 UTC) #3
oshima
lgtm
4 years, 11 months ago (2016-01-14 16:01:59 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1581883003/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1581883003/20001
4 years, 11 months ago (2016-01-14 16:04:13 UTC) #7
commit-bot: I haz the power
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presubmit/builds/135566)
4 years, 11 months ago (2016-01-14 16:11:17 UTC) #9
mario.endlessm
On 2016/01/14 16:11:17, commit-bot: I haz the power wrote: > Try jobs failed on following ...
4 years, 11 months ago (2016-01-14 16:22:31 UTC) #10
Evan Stade
lgtm
4 years, 11 months ago (2016-01-19 19:27:49 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1581883003/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1581883003/20001
4 years, 11 months ago (2016-01-19 23:38:17 UTC) #13
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 11 months ago (2016-01-20 01:08:48 UTC) #15
commit-bot: I haz the power
4 years, 11 months ago (2016-01-20 01:10:03 UTC) #17
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/e2ff3e6efc9f9d58ba0520b12e313e46be3abef8
Cr-Commit-Position: refs/heads/master@{#370248}

Powered by Google App Engine
This is Rietveld 408576698