summaryrefslogtreecommitdiffstats
path: root/Source/WebKit/android
diff options
context:
space:
mode:
authorGeorge Mount <mount@google.com>2012-06-12 16:59:05 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-06-12 16:59:05 -0700
commit236f8ddfbd94fc6e0e49c13495c8fe82d3218bc8 (patch)
treeb0f9f674607c55679a8bed6c9007c20962d6fc49 /Source/WebKit/android
parentcf0d6ef9f40a29e045713df527462426197c77c1 (diff)
parent6858906040a8e78210021ba85b62c59a193654de (diff)
downloadexternal_webkit-236f8ddfbd94fc6e0e49c13495c8fe82d3218bc8.zip
external_webkit-236f8ddfbd94fc6e0e49c13495c8fe82d3218bc8.tar.gz
external_webkit-236f8ddfbd94fc6e0e49c13495c8fe82d3218bc8.tar.bz2
Merge "Revert "Revert "Add layer clip check to hide handles when not visible."""
Diffstat (limited to 'Source/WebKit/android')
-rw-r--r--Source/WebKit/android/nav/WebView.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/Source/WebKit/android/nav/WebView.cpp b/Source/WebKit/android/nav/WebView.cpp
index 0e4bf32..8e88131 100644
--- a/Source/WebKit/android/nav/WebView.cpp
+++ b/Source/WebKit/android/nav/WebView.cpp
@@ -740,6 +740,20 @@ bool isHandleLeft(SelectText::HandleId handleId)
return (selectText->getHandleType(handleId) == SelectText::LeftHandle);
}
+bool isPointVisible(int layerId, int contentX, int contentY)
+{
+ bool isVisible = true;
+ const TransformationMatrix* transform = getLayerTransform(layerId);
+ if (transform) {
+ // layer is guaranteed to be non-NULL because of getLayerTransform
+ LayerAndroid* layer = m_baseLayer->findById(layerId);
+ IntRect rect = layer->visibleContentArea();
+ rect = transform->mapRect(rect);
+ isVisible = rect.contains(contentX, contentY);
+ }
+ return isVisible;
+}
+
private: // local state for WebView
bool m_isDrawingPaused;
// private to getFrameCache(); other functions operate in a different thread
@@ -1304,6 +1318,13 @@ static bool nativeIsHandleLeft(JNIEnv *env, jobject obj, jint nativeView,
return webview->isHandleLeft(static_cast<SelectText::HandleId>(handleId));
}
+static bool nativeIsPointVisible(JNIEnv *env, jobject obj, jint nativeView,
+ jint layerId, jint contentX, jint contentY)
+{
+ WebView* webview = reinterpret_cast<WebView*>(nativeView);
+ return webview->isPointVisible(layerId, contentX, contentY);
+}
+
/*
* JNI registration
*/
@@ -1384,6 +1405,8 @@ static JNINativeMethod gJavaWebViewMethods[] = {
(void*) nativeFindMaxVisibleRect },
{ "nativeIsHandleLeft", "(II)Z",
(void*) nativeIsHandleLeft },
+ { "nativeIsPointVisible", "(IIII)Z",
+ (void*) nativeIsPointVisible },
};
int registerWebView(JNIEnv* env)