mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1111786 - Cherry-pick the skia 6f90475632b0ff8e9e83916ee6373d3c26cc9284 commit; r=upstream
Rewrite NaN checks in terms of SkScalarIsNaN() We are trying to replace Skia's NaN checker with our own in Mozilla, so it would be nice to have to patch a single place by making sure these NaN checks used SkScalarIsNaN().
This commit is contained in:
parent
4d9c16b696
commit
2eef0c8c09
@ -348,11 +348,11 @@ struct SK_API SkPoint {
|
||||
accum *= fY;
|
||||
|
||||
// accum is either NaN or it is finite (zero).
|
||||
SkASSERT(0 == accum || !(accum == accum));
|
||||
SkASSERT(0 == accum || SkScalarIsNaN(accum));
|
||||
|
||||
// value==value will be true iff value is not NaN
|
||||
// TODO: is it faster to say !accum or accum==accum?
|
||||
return accum == accum;
|
||||
return !SkScalarIsNaN(accum);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -457,11 +457,11 @@ struct SK_API SkRect {
|
||||
accum *= fBottom;
|
||||
|
||||
// accum is either NaN or it is finite (zero).
|
||||
SkASSERT(0 == accum || !(accum == accum));
|
||||
SkASSERT(0 == accum || SkScalarIsNaN(accum));
|
||||
|
||||
// value==value will be true iff value is not NaN
|
||||
// TODO: is it faster to say !accum or accum==accum?
|
||||
return accum == accum;
|
||||
return !SkScalarIsNaN(accum);
|
||||
}
|
||||
|
||||
SkScalar x() const { return fLeft; }
|
||||
|
@ -49,7 +49,7 @@ static inline bool SkScalarIsFinite(float x) {
|
||||
float prod = x * 0;
|
||||
// At this point, prod will either be NaN or 0
|
||||
// Therefore we can return (prod == prod) or (0 == prod).
|
||||
return prod == prod;
|
||||
return !SkScalarIsNaN(prod);
|
||||
}
|
||||
|
||||
/** SkIntToScalar(n) returns its integer argument as an SkScalar
|
||||
|
Loading…
Reference in New Issue
Block a user