diff options
author | rmistry@google.com <rmistry@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-08-23 18:09:54 +0000 |
---|---|---|
committer | rmistry@google.com <rmistry@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-08-23 18:09:54 +0000 |
commit | fbfcd5602128ec010c82cb733c9cdc0a3254f9f3 (patch) | |
tree | d8b4815d15946c32ee9d254e932411e93be942bb /src/core/SkLineClipper.cpp | |
parent | 2abed834789bb64c7da740df4c47efc142b7311a (diff) |
Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/)
This CL is part I of IV (I broke down the 1280 files into 4 CLs).
Review URL: https://codereview.appspot.com/6485054
git-svn-id: http://skia.googlecode.com/svn/trunk@5262 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core/SkLineClipper.cpp')
-rw-r--r-- | src/core/SkLineClipper.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/core/SkLineClipper.cpp b/src/core/SkLineClipper.cpp index b2560d69b3..7b7746f76f 100644 --- a/src/core/SkLineClipper.cpp +++ b/src/core/SkLineClipper.cpp @@ -36,7 +36,7 @@ static SkScalar sect_with_horizontal(const SkPoint src[2], SkScalar Y) { double X1 = src[1].fX; double Y1 = src[1].fY; double result = X0 + ((double)Y - Y0) * (X1 - X0) / (Y1 - Y0); - + // The computed X value might still exceed [X0..X1] due to quantum flux // when the doubles were added and subtracted, so we have to pin the // answer :( @@ -87,7 +87,7 @@ static inline bool containsNoEmptyCheck(const SkRect& outer, bool SkLineClipper::IntersectLine(const SkPoint src[2], const SkRect& clip, SkPoint dst[2]) { SkRect bounds; - + bounds.set(src, 2); if (containsNoEmptyCheck(clip, bounds)) { if (src != dst) { @@ -105,7 +105,7 @@ bool SkLineClipper::IntersectLine(const SkPoint src[2], const SkRect& clip, } int index0, index1; - + if (src[0].fY < src[1].fY) { index0 = 0; index1 = 1; @@ -124,7 +124,7 @@ bool SkLineClipper::IntersectLine(const SkPoint src[2], const SkRect& clip, if (tmp[index1].fY > clip.fBottom) { tmp[index1].set(sect_with_horizontal(src, clip.fBottom), clip.fBottom); } - + if (tmp[0].fX < tmp[1].fX) { index0 = 0; index1 = 1; @@ -174,7 +174,7 @@ static bool is_between_unsorted(SkScalar value, // static void sect_with_horizontal_test_for_pin_results() { const SkPoint pts[] = { - { -540000, -720000 }, + { -540000, -720000 }, { SkFloatToScalar(-9.10000017e-05f), SkFloatToScalar(9.99999996e-13f) } }; float x = sect_with_horizontal(pts, 0); @@ -214,7 +214,7 @@ int SkLineClipper::ClipLine(const SkPoint pts[], const SkRect& clip, if (pts[index0].fY >= clip.fBottom) { // we're below the clip return 0; } - + // Chop in Y to produce a single segment, stored in tmp[0..1] SkPoint tmp[2]; @@ -259,7 +259,7 @@ int SkLineClipper::ClipLine(const SkPoint pts[], const SkRect& clip, } else { result = resultStorage; SkPoint* r = result; - + if (tmp[index0].fX < clip.fLeft) { r->set(clip.fLeft, tmp[index0].fY); r += 1; |