use fast/inline SkRect::set(p0, p1) for 2 points
authorreed <reed@chromium.org>
Mon, 13 Apr 2015 02:07:08 +0000 (19:07 -0700)
committerCommit bot <commit-bot@chromium.org>
Mon, 13 Apr 2015 02:07:08 +0000 (19:07 -0700)
10% speedup for clipped haircubics

BUG=skia:
TBR=
NOTRY=True

Review URL: https://codereview.chromium.org/1079343002

src/core/SkLineClipper.cpp

index 4558430..189f03a 100644 (file)
@@ -78,7 +78,7 @@ bool SkLineClipper::IntersectLine(const SkPoint src[2], const SkRect& clip,
                                   SkPoint dst[2]) {
     SkRect bounds;
 
-    bounds.set(src, 2);
+    bounds.set(src[0], src[1]);
     if (containsNoEmptyCheck(clip, bounds)) {
         if (src != dst) {
             memcpy(dst, src, 2 * sizeof(SkPoint));
@@ -137,7 +137,7 @@ bool SkLineClipper::IntersectLine(const SkPoint src[2], const SkRect& clip,
         tmp[index1].set(clip.fRight, sect_with_vertical(src, clip.fRight));
     }
 #ifdef SK_DEBUG
-    bounds.set(tmp, 2);
+    bounds.set(tmp[0], tmp[1]);
     SkASSERT(containsNoEmptyCheck(clip, bounds));
 #endif
     memcpy(dst, tmp, sizeof(tmp));