summaryrefslogtreecommitdiffstats
path: root/WebKit/android/nav/CachedRoot.h
diff options
context:
space:
mode:
authorCary Clark <cary@android.com>2010-10-26 10:56:53 -0400
committerCary Clark <cary@android.com>2010-10-27 11:35:46 -0400
commitaf03a3d6830584ef606be2d1c64845815dadb146 (patch)
treeae2edb24d2deaf62097469d8b1e79b9f4c010b7f /WebKit/android/nav/CachedRoot.h
parent43d943757c6b39710fa65034351bc2e84946e8ce (diff)
downloadexternal_webkit-af03a3d6830584ef606be2d1c64845815dadb146.zip
external_webkit-af03a3d6830584ef606be2d1c64845815dadb146.tar.gz
external_webkit-af03a3d6830584ef606be2d1c64845815dadb146.tar.bz2
rewrite select text and others for layers
Layers contain pictures, and draw them offset from the top of the page. Several readers of pictures need to account for this displacement when computing what part of the picture intersects a tap on the screen. The tap may not correspond to the first layer that intersects it, so all layers must be checked to find the best match. The root layer usually draws everywhere, so for a match to correspond to the root, the match must additionally intersect text. Layers may create offscreen bitmaps when drawing to correctly alpha blend the results to the screen, but this causes the items in the bitmap to draw to an unexpected location when the picture is treated as a spatial database. To get around this, call the SkCanvas::save() from the overridden saveLayer() to push and pop the canvas layer state without creating an offscreen. WebCore/platform/graphics/android/LayerAndroid.cpp WebCore/platform/graphics/android/LayerAndroid.h - In find(), iterate through all children, instead of stopping on the first match. - Check to see if the child actually draws at the desired location, and if it draws text there as well. - Specify a slop factor to allow for inaccuracies in touch. - Check the root for text before checking the children. WebKit/android/nav/CachedFrame.cpp WebKit/android/nav/CachedFrame.h - Modify the (x,y) co-ordinate by the layer's offset, when finding the picture corresponding to a point. WebKit/android/nav/CachedLayer.cpp WebKit/android/nav/CachedLayer.h - More plumbing to adjust the point if the picture is contained in an offset layer. WebKit/android/nav/CachedRoot.cpp WebKit/android/nav/CachedRoot.h - Correct the (x,y) locations by the layer offset. - Add some debugging (disabled by default) WebKit/android/nav/ParsedCanvas.h - One stop shopping that calls save() from saveLayer(). - Reset the bounder to null to balance its ref count. WebKit/android/nav/SelectText.cpp WebKit/android/nav/SelectText.h - Rearrange the way pictures are tracked. Record the picture corresponding to the input location when the selection starts, requiring that the picture remain unchanged as the selection extends. - Only draw adornments for when the corresponding picture is drawn. This fixes a Gmail specific problem, where the layers come and go as the page scrolls. - Always use the supplied visible bounds instead of computing it from the canvas. - Correct location points by layer offsets. - Add to the picture ref count so it can't be deleted during selection. WebKit/android/nav/WebView.cpp - Simplify visibleRect code. - Simplify all SelectText interfaces. bug:3114609 Change-Id: I43dc3252fc86c4b6500edcd650126b2559f530e3
Diffstat (limited to 'WebKit/android/nav/CachedRoot.h')
-rw-r--r--WebKit/android/nav/CachedRoot.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/WebKit/android/nav/CachedRoot.h b/WebKit/android/nav/CachedRoot.h
index 8c263f8..18bace3 100644
--- a/WebKit/android/nav/CachedRoot.h
+++ b/WebKit/android/nav/CachedRoot.h
@@ -85,7 +85,7 @@ public:
*/
const CachedNode* nextTextField(const CachedNode* start,
const CachedFrame** framePtr) const;
- SkPicture* pictureAt(int x, int y) const;
+ SkPicture* pictureAt(int* xPtr, int* yPtr) const;
void reset();
CachedHistory* rootHistory() const { return mHistory; }
const WebCore::LayerAndroid* rootLayer() const { return mRootLayer; }