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

Issue 2143133005: Guard SkMatrix::get*Scale[s]() against negative nearly-zero values. (Closed)

Created:
4 years, 5 months ago by Krzysztof Olczyk
Modified:
4 years, 5 months ago
Reviewers:
jvanverth1, reed, bsalomon, reed1
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@master
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

Guard SkMatrix::get*Scale[s]() against negative nearly-zero values. BUG=skia:4718 GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2143133005 Committed: https://skia.googlesource.com/skia/+/cea22ae2349502334312bd1d9e10ffa894f70e05

Patch Set 1 #

Patch Set 2 : guard against inf too, update the condition to better suit negative nearly-zeros and added unit tes… #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+16 lines, -4 lines) Patch
M src/core/SkMatrix.cpp View 1 1 chunk +8 lines, -2 lines 2 comments Download
M tests/MatrixTest.cpp View 1 1 chunk +8 lines, -2 lines 0 comments Download

Messages

Total messages: 26 (11 generated)
Krzysztof Olczyk
Hi reed, bsalomon, please take a look at this change addressing another hit of skia:4718 ...
4 years, 5 months ago (2016-07-14 06:28:26 UTC) #3
reed1
The referenced bug talks initially about infinities. - Should we use the same bug for ...
4 years, 5 months ago (2016-07-14 14:10:00 UTC) #5
Krzysztof Olczyk
On 2016/07/14 at 14:10:00, reed wrote: > The referenced bug talks initially about infinities. As ...
4 years, 5 months ago (2016-07-15 05:30:08 UTC) #6
Krzysztof Olczyk
I've uploaded the unit test with one of the matrices I was getting failure on. ...
4 years, 5 months ago (2016-07-15 08:28:22 UTC) #8
bsalomon
lgtm
4 years, 5 months ago (2016-07-15 13:43:41 UTC) #13
jvanverth1
https://codereview.chromium.org/2143133005/diff/20001/src/core/SkMatrix.cpp File src/core/SkMatrix.cpp (right): https://codereview.chromium.org/2143133005/diff/20001/src/core/SkMatrix.cpp#newcode1574 src/core/SkMatrix.cpp:1574: if (results[0] < 0 && results[0] > -SK_ScalarNearlyZero) { ...
4 years, 5 months ago (2016-07-15 13:49:05 UTC) #14
bsalomon
On 2016/07/15 13:49:05, jvanverth1 wrote: > https://codereview.chromium.org/2143133005/diff/20001/src/core/SkMatrix.cpp > File src/core/SkMatrix.cpp (right): > > https://codereview.chromium.org/2143133005/diff/20001/src/core/SkMatrix.cpp#newcode1574 > ...
4 years, 5 months ago (2016-07-15 13:50:53 UTC) #15
jvanverth1
On 2016/07/15 13:50:53, bsalomon wrote: > On 2016/07/15 13:49:05, jvanverth1 wrote: > > https://codereview.chromium.org/2143133005/diff/20001/src/core/SkMatrix.cpp > ...
4 years, 5 months ago (2016-07-15 14:05:19 UTC) #16
bsalomon
On 2016/07/15 14:05:19, jvanverth1 wrote: > On 2016/07/15 13:50:53, bsalomon wrote: > > On 2016/07/15 ...
4 years, 5 months ago (2016-07-15 14:10:57 UTC) #17
jvanverth1
On 2016/07/15 14:10:57, bsalomon wrote: > On 2016/07/15 14:05:19, jvanverth1 wrote: > > On 2016/07/15 ...
4 years, 5 months ago (2016-07-15 14:41:14 UTC) #18
Krzysztof Olczyk
On 2016/07/15 at 14:05:19, jvanverth wrote: > On 2016/07/15 13:50:53, bsalomon wrote: > > On ...
4 years, 5 months ago (2016-07-16 18:34:51 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2143133005/20001
4 years, 5 months ago (2016-07-16 18:35:22 UTC) #21
commit-bot: I haz the power
Committed patchset #2 (id:20001) as https://skia.googlesource.com/skia/+/cea22ae2349502334312bd1d9e10ffa894f70e05
4 years, 5 months ago (2016-07-16 18:52:41 UTC) #23
reed1
https://codereview.chromium.org/2143133005/diff/20001/src/core/SkMatrix.cpp File src/core/SkMatrix.cpp (right): https://codereview.chromium.org/2143133005/diff/20001/src/core/SkMatrix.cpp#newcode1574 src/core/SkMatrix.cpp:1574: if (results[0] < 0 && results[0] > -SK_ScalarNearlyZero) { ...
4 years, 5 months ago (2016-07-17 00:15:17 UTC) #25
Krzysztof Olczyk
4 years, 5 months ago (2016-07-18 05:28:15 UTC) #26
Message was sent while issue was closed.
On 2016/07/17 at 00:15:17, reed wrote:
> https://codereview.chromium.org/2143133005/diff/20001/src/core/SkMatrix.cpp
> File src/core/SkMatrix.cpp (right):
> 
>
https://codereview.chromium.org/2143133005/diff/20001/src/core/SkMatrix.cpp#n...
> src/core/SkMatrix.cpp:1574: if (results[0] < 0 && results[0] >
-SK_ScalarNearlyZero) {
> On 2016/07/15 13:49:05, jvanverth1 wrote:
> > I missed something here -- why was this changed to only clamp negative
nearly
> > zero values? This seems asymmetric.
> 
> Agreed. This reads oddly -- we clamp nearly-zero-negative values, and then
assert that we're never negative. Why not add whatever assert you want ahead of
time, and then clamp all negative values?

Ah, I see what you mean here now. Sorry for having it landed already, I
understood you were fine with this after bsalomon's clarifications. I will send
a fixup CL soon.

Powered by Google App Engine
This is Rietveld 408576698