diff options
author | John Reck <jreck@google.com> | 2012-03-09 15:45:55 -0800 |
---|---|---|
committer | John Reck <jreck@google.com> | 2012-03-09 15:45:55 -0800 |
commit | df1b448056d65c28220fe303d82847094a215838 (patch) | |
tree | 4ea261698d50be630b7e997ab1227389ce2b7784 | |
parent | 1a3ed28020480a9db46e41b02a48db209e3d9560 (diff) | |
download | external_webkit-df1b448056d65c28220fe303d82847094a215838.zip external_webkit-df1b448056d65c28220fe303d82847094a215838.tar.gz external_webkit-df1b448056d65c28220fe303d82847094a215838.tar.bz2 |
Delete nativeSubtractLayers
Bug: 5338388
Change-Id: I2ae12dde6ef2f30e015c052da67c2bafbd59ecd3
-rw-r--r-- | Source/WebCore/platform/graphics/android/LayerAndroid.cpp | 37 | ||||
-rw-r--r-- | Source/WebCore/platform/graphics/android/LayerAndroid.h | 5 | ||||
-rw-r--r-- | Source/WebKit/android/nav/WebView.cpp | 22 |
3 files changed, 0 insertions, 64 deletions
diff --git a/Source/WebCore/platform/graphics/android/LayerAndroid.cpp b/Source/WebCore/platform/graphics/android/LayerAndroid.cpp index f101208..043c9a8 100644 --- a/Source/WebCore/platform/graphics/android/LayerAndroid.cpp +++ b/Source/WebCore/platform/graphics/android/LayerAndroid.cpp @@ -987,43 +987,6 @@ void LayerAndroid::setFixedPosition(FixedPositioning* position) { m_fixedPosition = position; } -SkRect LayerAndroid::subtractLayers(const SkRect& visibleRect) const -{ - SkRect result; - if (m_recordingPicture) { - // FIXME: This seems wrong. localToGlobal() applies the full local transform, - // se surely we should operate globalMatrix on size(), not bounds() with - // the position removed? Perhaps we never noticed the bug because most - // layers don't use a local transform? - // See http://b/5338388 - SkRect globalRect = bounds(); - globalRect.offset(-getPosition()); // localToGlobal adds in position - SkMatrix globalMatrix; - localToGlobal(&globalMatrix); - globalMatrix.mapRect(&globalRect); - SkIRect roundedGlobal; - globalRect.round(&roundedGlobal); - SkIRect iVisibleRect; - visibleRect.round(&iVisibleRect); - SkRegion visRegion(iVisibleRect); - visRegion.op(roundedGlobal, SkRegion::kDifference_Op); - result.set(visRegion.getBounds()); -#if DEBUG_NAV_UI - SkDebugf("%s visibleRect=(%g,%g,r=%g,b=%g) globalRect=(%g,%g,r=%g,b=%g)" - "result=(%g,%g,r=%g,b=%g)", __FUNCTION__, - visibleRect.fLeft, visibleRect.fTop, - visibleRect.fRight, visibleRect.fBottom, - globalRect.fLeft, globalRect.fTop, - globalRect.fRight, globalRect.fBottom, - result.fLeft, result.fTop, result.fRight, result.fBottom); -#endif - } else - result = visibleRect; - for (int i = 0; i < countChildren(); i++) - result = getChild(i)->subtractLayers(result); - return result; -} - void LayerAndroid::dumpLayer(FILE* file, int indentLevel) const { writeHexVal(file, indentLevel + 1, "layer", (int)this); diff --git a/Source/WebCore/platform/graphics/android/LayerAndroid.h b/Source/WebCore/platform/graphics/android/LayerAndroid.h index 7f5d5e2..50c0a33 100644 --- a/Source/WebCore/platform/graphics/android/LayerAndroid.h +++ b/Source/WebCore/platform/graphics/android/LayerAndroid.h @@ -183,11 +183,6 @@ public: SkPicture* picture() const { return m_recordingPicture; } - // Given a rect in global space, subtracts from it the bounds of this layer - // and of all of its children. Returns the bounding rectangle of the result, - // in global space. - SkRect subtractLayers(const SkRect&) const; - virtual void dumpLayer(FILE*, int indentLevel) const; void dumpLayers(FILE*, int indentLevel) const; void dumpToLog() const; diff --git a/Source/WebKit/android/nav/WebView.cpp b/Source/WebKit/android/nav/WebView.cpp index 8b7acc5..c8c5ab0 100644 --- a/Source/WebKit/android/nav/WebView.cpp +++ b/Source/WebKit/android/nav/WebView.cpp @@ -875,26 +875,6 @@ static jobject nativeLayerBounds(JNIEnv* env, jobject obj, jint jlayer) return rect; } -static jobject nativeSubtractLayers(JNIEnv* env, jobject obj, jobject jrect) -{ - SkIRect irect = jrect_to_webrect(env, jrect); -#if USE(ACCELERATED_COMPOSITING) - LayerAndroid* root = GET_NATIVE_VIEW(env, obj)->compositeRoot(); - if (root) { - SkRect rect; - rect.set(irect); - rect = root->subtractLayers(rect); - rect.round(&irect); - } -#endif - 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); @@ -1236,8 +1216,6 @@ static JNINativeMethod gJavaWebViewMethods[] = { (void*) nativeTileProfilingGetFloat }, { "nativeStopGL", "()V", (void*) nativeStopGL }, - { "nativeSubtractLayers", "(Landroid/graphics/Rect;)Landroid/graphics/Rect;", - (void*) nativeSubtractLayers }, { "nativeScrollableLayer", "(IILandroid/graphics/Rect;Landroid/graphics/Rect;)I", (void*) nativeScrollableLayer }, { "nativeScrollLayer", "(III)Z", |