aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkScan_Hairline.cpp
diff options
context:
space:
mode:
authorGravatar Ben Wagner <benjaminwagner@google.com>2017-10-09 12:29:42 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-10-09 16:48:04 +0000
commitb6abb9b4e088abee8b8dfcce9c9f7eb759518198 (patch)
tree0e58348b825658e36b4e60e3f782bf8c1b6d11b6 /src/core/SkScan_Hairline.cpp
parent72818018494372b8692203b77aedfa6b8a87e3bc (diff)
Revert "Fix a couple float-cast-overflow in SkScan*."
This reverts commit 3cd0bef0fd9d062bbcc313c329b4f31925e8ded7. Reason for revert: https://bugs.chromium.org/p/skia/issues/detail?id=7143 Original change's description: > Fix a couple float-cast-overflow in SkScan*. > > Bug: skia:5060 > Change-Id: I60a48993c77631aaad9354bb86b13204dc618bf4 > Reviewed-on: https://skia-review.googlesource.com/47422 > Commit-Queue: Ben Wagner <benjaminwagner@google.com> > Reviewed-by: Mike Reed <reed@google.com> TBR=benjaminwagner@google.com,reed@google.com # Not skipping CQ checks because original CL landed > 1 day ago. Bug: skia:7143 Change-Id: I0f19720a7d8344789a375bbb6b9e28bf4f4e55ae Reviewed-on: https://skia-review.googlesource.com/57240 Commit-Queue: Ben Wagner <benjaminwagner@google.com> Reviewed-by: Ben Wagner <benjaminwagner@google.com>
Diffstat (limited to 'src/core/SkScan_Hairline.cpp')
-rw-r--r--src/core/SkScan_Hairline.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/core/SkScan_Hairline.cpp b/src/core/SkScan_Hairline.cpp
index 9ec38ee747..84278f4182 100644
--- a/src/core/SkScan_Hairline.cpp
+++ b/src/core/SkScan_Hairline.cpp
@@ -143,14 +143,17 @@ void SkScan::HairLineRgn(const SkPoint array[], int arrayCount, const SkRegion*
// we don't just draw 4 lines, 'cause that can leave a gap in the bottom-right
// and double-hit the top-left.
+// TODO: handle huge coordinates on rect (before calling SkScalarToFixed)
void SkScan::HairRect(const SkRect& rect, const SkRasterClip& clip,
SkBlitter* blitter) {
SkAAClipBlitterWrapper wrapper;
- SkBlitterClipper clipper;
- const SkIRect r = SkIRect::MakeLTRB(SkScalarFloorToInt(rect.fLeft),
- SkScalarFloorToInt(rect.fTop),
- SkScalarFloorToInt(rect.fRight) + 1,
- SkScalarFloorToInt(rect.fBottom) + 1);
+ SkBlitterClipper clipper;
+ SkIRect r;
+
+ r.set(SkScalarToFixed(rect.fLeft) >> 16,
+ SkScalarToFixed(rect.fTop) >> 16,
+ (SkScalarToFixed(rect.fRight) >> 16) + 1,
+ (SkScalarToFixed(rect.fBottom) >> 16) + 1);
if (clip.quickReject(r)) {
return;