diff options
author | Leon Scroggins <scroggo@google.com> | 2010-03-12 08:09:10 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2010-03-12 08:09:10 -0800 |
commit | 187a2d37109c06693e11c8a993f136210d662d62 (patch) | |
tree | 50c6691d8a50d6ecec86c6a8b5141ec12ec39ffc | |
parent | 12278662c4370bd0cf23b2045a099fcb459a766b (diff) | |
parent | 782baf4eeaee6dd4d221ed4e42567390fbca9486 (diff) | |
download | external_webkit-187a2d37109c06693e11c8a993f136210d662d62.zip external_webkit-187a2d37109c06693e11c8a993f136210d662d62.tar.gz external_webkit-187a2d37109c06693e11c8a993f136210d662d62.tar.bz2 |
Merge "Outset the rectangle containing the match after checking the clip."
-rw-r--r-- | WebKit/android/nav/FindCanvas.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
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 <utils/Log.h> +#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<MatchInfo>(); 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 |