From 782baf4eeaee6dd4d221ed4e42567390fbca9486 Mon Sep 17 00:00:00 2001 From: Leon Scroggins Date: Thu, 11 Mar 2010 16:53:18 -0500 Subject: Outset the rectangle containing the match after checking the clip. When considering whether a match is contained by the current clip, do not outset it first. Check to see if it is contained by the clip, and then add the outset so the drawn rectangle is larger. Fix for http://b/issue?id=2507893 Change-Id: I900d92432d412396e8c5b9e9e341085656ed0a2f --- WebKit/android/nav/FindCanvas.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'WebKit/android/nav/FindCanvas.cpp') diff --git a/WebKit/android/nav/FindCanvas.cpp b/WebKit/android/nav/FindCanvas.cpp index e4beb88..1d84822 100644 --- a/WebKit/android/nav/FindCanvas.cpp +++ b/WebKit/android/nav/FindCanvas.cpp @@ -35,6 +35,8 @@ #include +#define INTEGER_OUTSET 2 + namespace android { // MatchInfo methods @@ -125,7 +127,7 @@ FindCanvas::FindCanvas(int width, int height, const UChar* lower, , mNumFound(0) { setBounder(&mBounder); - mOutset = -SkIntToScalar(2); + mOutset = -SkIntToScalar(INTEGER_OUTSET); mMatches = new WTF::Vector(); mWorkingIndex = 0; mWorkingCanvas = 0; @@ -356,13 +358,15 @@ void FindCanvas::findHelper(const void* text, size_t byteLength, const uint16_t* glyphs = chars + matchIndex; SkRect rect = (this->*addMatch)(matchIndex, paint, remaining, glyphs, positions, y); - rect.inset(mOutset, mOutset); // We need an SkIRect for SkRegion operations. SkIRect iRect; rect.roundOut(&iRect); // If the rectangle is partially clipped, assume that the text is // not visible, so skip this match. if (getTotalClip().contains(iRect)) { + // Want to outset the drawn rectangle by the same amount as + // mOutset + iRect.inset(-INTEGER_OUTSET, -INTEGER_OUTSET); SkRegion regionToAdd(iRect); if (!mWorkingRegion.isEmpty()) { // If this is on the same line as our working region, make -- cgit v1.1