summaryrefslogtreecommitdiffstats
path: root/Source/WebKit/android
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2012-05-14 17:04:09 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-05-14 17:04:09 -0700
commit4ef88beceb0e8d5b2df5bd4e30360ffcb8c2a65d (patch)
tree371f2377181b13034f88c56269dd2775c4e60816 /Source/WebKit/android
parent248cd27071497cb61def0b07d4fd2dc23af657dd (diff)
parent4f91e5abbd847c4dee4740d3116f23b73bf02ee5 (diff)
downloadexternal_webkit-4ef88beceb0e8d5b2df5bd4e30360ffcb8c2a65d.zip
external_webkit-4ef88beceb0e8d5b2df5bd4e30360ffcb8c2a65d.tar.gz
external_webkit-4ef88beceb0e8d5b2df5bd4e30360ffcb8c2a65d.tar.bz2
Merge "Update bounds calculation to use draw transform" into jb-dev
Diffstat (limited to 'Source/WebKit/android')
-rw-r--r--Source/WebKit/android/nav/WebView.cpp35
1 files changed, 5 insertions, 30 deletions
diff --git a/Source/WebKit/android/nav/WebView.cpp b/Source/WebKit/android/nav/WebView.cpp
index 09e808b..473efdb 100644
--- a/Source/WebKit/android/nav/WebView.cpp
+++ b/Source/WebKit/android/nav/WebView.cpp
@@ -370,22 +370,18 @@ void updateRectsForGL()
#if USE(ACCELERATED_COMPOSITING)
static const ScrollableLayerAndroid* findScrollableLayer(
const LayerAndroid* parent, int x, int y, SkIRect* foundBounds) {
- SkRect bounds;
- parent->bounds(&bounds);
+ IntRect bounds = enclosingIntRect(parent->fullContentAreaMapped());
+
// Check the parent bounds first; this will clip to within a masking layer's
// bounds.
if (parent->masksToBounds() && !bounds.contains(x, y))
return 0;
- // Move the hit test local to parent.
- x -= bounds.fLeft;
- y -= bounds.fTop;
+
int count = parent->countChildren();
while (count--) {
const LayerAndroid* child = parent->getChild(count);
- const ScrollableLayerAndroid* result = findScrollableLayer(child, x, y,
- foundBounds);
+ const ScrollableLayerAndroid* result = findScrollableLayer(child, x, y, foundBounds);
if (result) {
- foundBounds->offset(bounds.fLeft, bounds.fTop);
if (parent->masksToBounds()) {
if (bounds.width() < foundBounds->width())
foundBounds->fRight = foundBounds->fLeft + bounds.width();
@@ -396,7 +392,7 @@ static const ScrollableLayerAndroid* findScrollableLayer(
}
}
if (parent->contentIsScrollable()) {
- foundBounds->set(0, 0, bounds.width(), bounds.height());
+ foundBounds->set(bounds.x(), bounds.y(), bounds.width(), bounds.height());
return static_cast<const ScrollableLayerAndroid*>(parent);
}
return 0;
@@ -898,25 +894,6 @@ static bool nativeHasContent(JNIEnv *env, jobject obj)
return GET_NATIVE_VIEW(env, obj)->hasContent();
}
-static jobject nativeLayerBounds(JNIEnv* env, jobject obj, jint jlayer)
-{
- SkRect r;
-#if USE(ACCELERATED_COMPOSITING)
- LayerAndroid* layer = (LayerAndroid*) jlayer;
- r = layer->bounds();
-#else
- r.setEmpty();
-#endif
- SkIRect irect;
- r.round(&irect);
- jclass rectClass = env->FindClass("android/graphics/Rect");
- jmethodID init = env->GetMethodID(rectClass, "<init>", "(IIII)V");
- jobject rect = env->NewObject(rectClass, init, irect.fLeft, irect.fTop,
- irect.fRight, irect.fBottom);
- env->DeleteLocalRef(rectClass);
- return rect;
-}
-
static void nativeSetHeightCanMeasure(JNIEnv *env, jobject obj, bool measure)
{
WebView* view = GET_NATIVE_VIEW(env, obj);
@@ -1238,8 +1215,6 @@ static JNINativeMethod gJavaWebViewMethods[] = {
(void*) nativeEvaluateLayersAnimations },
{ "nativeGetSelection", "()Ljava/lang/String;",
(void*) nativeGetSelection },
- { "nativeLayerBounds", "(I)Landroid/graphics/Rect;",
- (void*) nativeLayerBounds },
{ "nativeSetHeightCanMeasure", "(Z)V",
(void*) nativeSetHeightCanMeasure },
{ "nativeSetBaseLayer", "(IIZZ)Z",