simplify round_down_to_int by using ceil instead of floor
authorLee Salzman <lsalzman@mozilla.com>
Fri, 13 Jan 2017 17:03:24 +0000 (12:03 -0500)
committerSkia Commit-Bot <skia-commit-bot@chromium.org>
Fri, 13 Jan 2017 18:38:22 +0000 (18:38 +0000)
BUG=skia:

Change-Id: I465d98d6b0d97e1ede82670c663f9695b5a0a1de
Reviewed-on: https://skia-review.googlesource.com/7041
Reviewed-by: Cary Clark <caryclark@google.com>
Commit-Queue: Cary Clark <caryclark@google.com>

src/core/SkScan_Path.cpp

index ec0fe06b66f7a3d4e584485a3e93cee0e5a18391..6d28f4b1aeb39307d4f960b27099fca474d143bf 100644 (file)
@@ -604,9 +604,8 @@ static bool clip_to_limit(const SkRegion& orig, SkRegion* reduced) {
   */
 static inline int round_down_to_int(SkScalar x) {
     double xx = x;
-    xx += 0.5;
-    double floorXX = floor(xx);
-    return (int)floorXX - (xx == floorXX);
+    xx -= 0.5;
+    return (int)ceil(xx);
 }
 
 /**