|
|
Created:
4 years, 11 months ago by mario.endlessm Modified:
4 years, 11 months ago CC:
chromium-reviews Base URL:
https://chromium.googlesource.com/chromium/src.git@master Target Ref:
refs/pending/heads/master Project:
chromium Visibility:
Public. |
DescriptionUse 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 #Messages
Total messages: 17 (6 generated)
The following patch implements the fix proposed in https://codereview.chromium.org/1324513002/#msg11. Please review, thanks.
https://codereview.chromium.org/1581883003/diff/1/chrome/browser/ui/libgtk2ui... File chrome/browser/ui/libgtk2ui/gtk2_ui.cc (right): https://codereview.chromium.org/1581883003/diff/1/chrome/browser/ui/libgtk2ui... chrome/browser/ui/libgtk2ui/gtk2_ui.cc:1358: return rounded < 1.3f ? 1.0f : rounded; I think it's better to be return scale < 1.3f ? 1.0f : roundf(scale * 10) / 10;
https://codereview.chromium.org/1581883003/diff/1/chrome/browser/ui/libgtk2ui... File chrome/browser/ui/libgtk2ui/gtk2_ui.cc (right): https://codereview.chromium.org/1581883003/diff/1/chrome/browser/ui/libgtk2ui... chrome/browser/ui/libgtk2ui/gtk2_ui.cc:1358: return rounded < 1.3f ? 1.0f : rounded; On 2016/01/13 23:39:44, oshima wrote: > I think it's better to be > > return scale < 1.3f ? 1.0f : roundf(scale * 10) / 10; Agreed. I just did not change it now because that changes the semantics a bit, although they seem to change them for the better (or at least to be consistent with the description of the initial patch), so I'll update the patch. Thanks
Description was changed from ========== 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'. BUG=484400 R=oshima@chromium.org, estade@chromium.org ========== to ========== 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 ==========
lgtm
The CQ bit was checked by mario@endlessm.com
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
The CQ bit was unchecked by commit-bot@chromium.org
Try jobs failed on following builders: chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...)
On 2016/01/14 16:11:17, commit-bot: I haz the power wrote: > Try jobs failed on following builders: > chromium_presubmit on tryserver.chromium.linux (JOB_FAILED, > http://build.chromium.org/p/tryserver.chromium.linux/builders/chromium_presub...) This failed due to a missing approval from an OWNER. @estade, please take a look when you have a chance, thanks!
lgtm
The CQ bit was checked by mario@endlessm.com
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
Message was sent while issue was closed.
Description was changed from ========== 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 ========== to ========== 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 ==========
Message was sent while issue was closed.
Committed patchset #2 (id:20001)
Message was sent while issue was closed.
Description was changed from ========== 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 ========== to ========== 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} ==========
Message was sent while issue was closed.
Patchset 2 (id:??) landed as https://crrev.com/e2ff3e6efc9f9d58ba0520b12e313e46be3abef8 Cr-Commit-Position: refs/heads/master@{#370248} |