cull edges that are to the right of the clip
BUG=skia:
Review URL: https://codereview.chromium.org/913503002
diff --git a/src/core/SkLineClipper.cpp b/src/core/SkLineClipper.cpp
index 3ff8948..4558430 100644
--- a/src/core/SkLineClipper.cpp
+++ b/src/core/SkLineClipper.cpp
@@ -1,10 +1,10 @@
-
/*
* Copyright 2011 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
+
#include "SkLineClipper.h"
template <typename T> T pin_unsorted(T value, T limit0, T limit1) {
@@ -172,12 +172,8 @@
}
#endif
-int SkLineClipper::ClipLine(const SkPoint pts[], const SkRect& clip,
- SkPoint lines[], bool canClipToTheRight) {
-#if 1
- // Disable this while we investigate layouttest failures
- canClipToTheRight = false;
-#endif
+int SkLineClipper::ClipLine(const SkPoint pts[], const SkRect& clip, SkPoint lines[],
+ bool canCullToTheRight) {
#ifdef SK_DEBUG
{
@@ -246,7 +242,7 @@
result = tmp;
reverse = false;
} else if (tmp[index0].fX >= clip.fRight) { // wholly to the right
- if (canClipToTheRight) {
+ if (canCullToTheRight) {
return 0;
}
tmp[0].fX = tmp[1].fX = clip.fRight;