diff options
author | caryclark <caryclark@google.com> | 2016-01-04 14:17:47 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-01-04 14:17:47 -0800 |
commit | 6df611574a3cf8abf2617af0d03a5553bb17360d (patch) | |
tree | 1e5bcb0e8c8048ad8958286ff4a7a37cf4829790 /include/core/SkRect.h | |
parent | 512f3e3b2592097a39bde9331829b38d16c0f85d (diff) |
handle halfway case in scan converter
Scan edges that start at exactly -0.5 aren't trimmed by
clipping or by rounding, triggering a debug assert.
One way to fix this is to round the top and left
down instead of up.
Also, move the path initialization of gm/composeshader.cpp
to make debugging other path problems easier.
R=reed@google.com
BUG=skia:2715
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1544873002
Review URL: https://codereview.chromium.org/1544873002
Diffstat (limited to 'include/core/SkRect.h')
-rw-r--r-- | include/core/SkRect.h | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/include/core/SkRect.h b/include/core/SkRect.h index fe276e6710..4f649b7c73 100644 --- a/include/core/SkRect.h +++ b/include/core/SkRect.h @@ -825,24 +825,6 @@ public: } /** - * Variant of round() that explicitly performs the rounding step (i.e. floor(x + 0.5)) using - * double instead of SkScalar (float). It does this by calling SkDScalarRoundToInt(), which - * may be slower than calling SkScalarRountToInt(), but gives slightly more accurate results. - * - * e.g. - * SkScalar x = 0.49999997f; - * int ix = SkScalarRoundToInt(x); - * SkASSERT(0 == ix); // <--- fails - * ix = SkDScalarRoundToInt(x); - * SkASSERT(0 == ix); // <--- succeeds - */ - void dround(SkIRect* dst) const { - SkASSERT(dst); - dst->set(SkDScalarRoundToInt(fLeft), SkDScalarRoundToInt(fTop), - SkDScalarRoundToInt(fRight), SkDScalarRoundToInt(fBottom)); - } - - /** * Set the dst rectangle by rounding "out" this rectangle, choosing the * SkScalarFloor of top and left, and the SkScalarCeil of right and bottom. */ |