summaryrefslogtreecommitdiffstats
path: root/WebKit/android/nav/FindCanvas.cpp
diff options
context:
space:
mode:
authorCary Clark <cary@android.com>2010-03-05 09:29:34 -0500
committerCary Clark <cary@android.com>2010-03-05 09:35:30 -0500
commitc657c686e52dc255b3967ab8744c2e9cde4a16de (patch)
tree11ef522ae275f74b129c44a68b9ce4139d64ce15 /WebKit/android/nav/FindCanvas.cpp
parente58dffb37ac1ec127575ed17b47adf1ed731cf0a (diff)
downloadexternal_webkit-c657c686e52dc255b3967ab8744c2e9cde4a16de.zip
external_webkit-c657c686e52dc255b3967ab8744c2e9cde4a16de.tar.gz
external_webkit-c657c686e52dc255b3967ab8744c2e9cde4a16de.tar.bz2
fixes with find drawing in layers
Clipping the match picture before drawing prevents layer pictures from drawing outside of their intended bounds. Rearranging the layer picture draw call causes it to restore the canvas matrix, which causes extras like finds and cursor rings to draw correctly. Also, added more layer debugging, and a function to show layer state in the console window. http://b/2488516 http://b/2488509
Diffstat (limited to 'WebKit/android/nav/FindCanvas.cpp')
-rw-r--r--WebKit/android/nav/FindCanvas.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/WebKit/android/nav/FindCanvas.cpp b/WebKit/android/nav/FindCanvas.cpp
index 139bd2c..5f02888 100644
--- a/WebKit/android/nav/FindCanvas.cpp
+++ b/WebKit/android/nav/FindCanvas.cpp
@@ -553,7 +553,12 @@ void FindOnPage::draw(SkCanvas* canvas, LayerAndroid* layer) {
if (matchInfo.layerId() == layerId) {
drawMatch(currentMatchRegion, canvas, true);
// Now draw the picture, so that it shows up on top of the rectangle
+ int saveCount = canvas->save();
+ SkPath matchPath;
+ currentMatchRegion.getBoundaryPath(&matchPath);
+ canvas->clipPath(matchPath);
canvas->drawPicture(*matchInfo.getPicture());
+ canvas->restoreToCount(saveCount);
}
// Draw the rest
unsigned numberOfMatches = m_matches->size();