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

Unified Diff: src/core/SkScan_Hairline.cpp

Issue 1683743005: Simple cleanups related to SkFixed. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/core/SkScan_Hairline.cpp
diff --git a/src/core/SkScan_Hairline.cpp b/src/core/SkScan_Hairline.cpp
index 2b2194b0d3d7bf19b911ff6132f1a81a613ffe90..1e3d383ad3b0d7de2210d2cc7aad4cf20605322f 100644
--- a/src/core/SkScan_Hairline.cpp
+++ b/src/core/SkScan_Hairline.cpp
@@ -142,17 +142,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)
+// TODO: handle huge coordinates on rect (before calling SkScalarFloorToInt)
void SkScan::HairRect(const SkRect& rect, const SkRasterClip& clip,
SkBlitter* blitter) {
SkAAClipBlitterWrapper wrapper;
SkBlitterClipper clipper;
SkIRect r;
- r.set(SkScalarToFixed(rect.fLeft) >> 16,
- SkScalarToFixed(rect.fTop) >> 16,
- (SkScalarToFixed(rect.fRight) >> 16) + 1,
- (SkScalarToFixed(rect.fBottom) >> 16) + 1);
+ r.set(SkScalarFloorToInt(rect.fLeft),
+ SkScalarFloorToInt(rect.fTop),
+ SkScalarFloorToInt(rect.fRight) + 1,
+ SkScalarFloorToInt(rect.fBottom) + 1);
if (clip.quickReject(r)) {
return;

Powered by Google App Engine
This is Rietveld 408576698