summaryrefslogtreecommitdiffstats
path: root/WebKit/android/nav
diff options
context:
space:
mode:
authorLeon Scroggins <scroggo@google.com>2010-03-11 16:53:18 -0500
committerLeon Scroggins <scroggo@google.com>2010-03-11 17:18:40 -0500
commit782baf4eeaee6dd4d221ed4e42567390fbca9486 (patch)
tree11b4cb04c7e78c724f6f6535e28890e5cc362370 /WebKit/android/nav
parentaa699fff907b14728bd8e515e3ae498620ed9afe (diff)
downloadexternal_webkit-782baf4eeaee6dd4d221ed4e42567390fbca9486.zip
external_webkit-782baf4eeaee6dd4d221ed4e42567390fbca9486.tar.gz
external_webkit-782baf4eeaee6dd4d221ed4e42567390fbca9486.tar.bz2
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
Diffstat (limited to 'WebKit/android/nav')
-rw-r--r--WebKit/android/nav/FindCanvas.cpp8
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