diff options
author | Chris Craik <ccraik@google.com> | 2012-05-02 11:44:36 -0700 |
---|---|---|
committer | Chris Craik <ccraik@google.com> | 2012-05-02 11:44:36 -0700 |
commit | efb1906816d97165a353b40f65ea0b057f6c8fe0 (patch) | |
tree | 962556a1c5d4a4db2f72a69faf1f94b43a1a8193 | |
parent | 3c1b0d2c8aafda4e7dc136c27f28cf2e95dc9125 (diff) | |
download | external_webkit-efb1906816d97165a353b40f65ea0b057f6c8fe0.zip external_webkit-efb1906816d97165a353b40f65ea0b057f6c8fe0.tar.gz external_webkit-efb1906816d97165a353b40f65ea0b057f6c8fe0.tar.bz2 |
Don't create a new functor if old one exists
bug:6405861
Change-Id: Ife0dcc6416b18bbd50b4d244e6464f423f651de6
-rw-r--r-- | Source/WebKit/android/nav/WebView.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/Source/WebKit/android/nav/WebView.cpp b/Source/WebKit/android/nav/WebView.cpp index 92fbef6..0caa624 100644 --- a/Source/WebKit/android/nav/WebView.cpp +++ b/Source/WebKit/android/nav/WebView.cpp @@ -755,6 +755,9 @@ class GLDrawFunctor : Functor { void updateScale(float _scale) { scale = _scale; } + void updateExtras(jint _extras) { + extras = _extras; + } private: WebView* wvInstance; int (WebView::*funcPtr)(WebCore::IntRect&, WebCore::IntRect*, @@ -817,9 +820,16 @@ static jint nativeCreateDrawGLFunction(JNIEnv *env, jobject obj, jint nativeView SkRect visibleRect = jrectf_to_rect(env, jvisiblerect); wvInstance->setVisibleRect(visibleRect); - GLDrawFunctor* functor = new GLDrawFunctor(wvInstance, - &android::WebView::drawGL, viewRect, scale, extras); - wvInstance->setFunctor((Functor*) functor); + GLDrawFunctor* functor = (GLDrawFunctor*) wvInstance->getFunctor(); + if (!functor) { + functor = new GLDrawFunctor(wvInstance, &android::WebView::drawGL, + viewRect, scale, extras); + wvInstance->setFunctor((Functor*) functor); + } else { + functor->updateRect(viewRect); + functor->updateScale(scale); + functor->updateExtras(extras); + } WebCore::IntRect webViewRect = jrect_to_webrect(env, jviewrect); functor->updateViewRect(webViewRect); |