Revert of Remove SkClipStack's manual rounding of BW clip rects (patchset #3 id:80001 of https://codereview.chromium.org/1033453003/)
Reason for revert:
Reverting due to performance regression: https://code.google.com/p/skia/issues/detail?id=3597
Original issue's description:
> Remove SkClipStack's manual rounding of BW clip rects
>
> The full fix for this bug is nudging the image in device space. That is going to be a large change. This CL should address the immediate problem.
>
> This CL will alter the following GMs:
> clipdrawdraw
> convex_poly_clip
> complexclip_bw_*
> filltypespersp
> complexclip3_simple
>
>
>
> BUG=423834
>
> Committed: https://skia.googlesource.com/skia/+/e523d4f90c3368c555282a98b41ca5ee2045103e
TBR=bsalomon@google.com,joshualitt@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=423834
Review URL: https://codereview.chromium.org/1045853002
diff --git a/src/core/SkClipStack.cpp b/src/core/SkClipStack.cpp
index a51185e..e0c3db0 100644
--- a/src/core/SkClipStack.cpp
+++ b/src/core/SkClipStack.cpp
@@ -419,6 +419,13 @@
break;
}
+ if (!fDoAA) {
+ fFiniteBound.set(SkScalarFloorToScalar(fFiniteBound.fLeft+0.45f),
+ SkScalarRoundToScalar(fFiniteBound.fTop),
+ SkScalarRoundToScalar(fFiniteBound.fRight),
+ SkScalarRoundToScalar(fFiniteBound.fBottom));
+ }
+
// Now determine the previous Element's bound information taking into
// account that there may be no previous clip
SkRect prevFinite;