diff options
author | Chris Craik <ccraik@google.com> | 2011-11-29 16:55:47 -0800 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-11-29 16:55:47 -0800 |
commit | f296ee697409b4b55bef17d534edbc24a4619f0f (patch) | |
tree | 55ca514f85b0667483198cd81402a5de7838bb7f /core | |
parent | 1808f214b0cd7a62628b273b93a1ea688f262565 (diff) | |
parent | d0051c06c2585398ca4ae54efb673d4a2d24aa5d (diff) | |
download | frameworks_base-f296ee697409b4b55bef17d534edbc24a4619f0f.zip frameworks_base-f296ee697409b4b55bef17d534edbc24a4619f0f.tar.gz frameworks_base-f296ee697409b4b55bef17d534edbc24a4619f0f.tar.bz2 |
Merge "Send animation start notification back to webkit from ui thread" into ics-mr1
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/webkit/WebView.java | 12 | ||||
-rw-r--r-- | core/java/android/webkit/WebViewCore.java | 15 |
2 files changed, 21 insertions, 6 deletions
diff --git a/core/java/android/webkit/WebView.java b/core/java/android/webkit/WebView.java index 2af6e3b..7155159 100644 --- a/core/java/android/webkit/WebView.java +++ b/core/java/android/webkit/WebView.java @@ -4604,14 +4604,15 @@ public class WebView extends AbsoluteLayout boolean UIAnimationsRunning = false; // Currently for each draw we compute the animation values; // We may in the future decide to do that independently. - if (mNativeClass != 0 && nativeEvaluateLayersAnimations(mNativeClass)) { + if (mNativeClass != 0 && !canvas.isHardwareAccelerated() + && nativeEvaluateLayersAnimations(mNativeClass)) { UIAnimationsRunning = true; // If we have unfinished (or unstarted) animations, // we ask for a repaint. We only need to do this in software // rendering (with hardware rendering we already have a different // method of requesting a repaint) - if (!canvas.isHardwareAccelerated()) - invalidate(); + mWebViewCore.sendMessage(EventHub.NOTIFY_ANIMATION_STARTED); + invalidate(); } // decide which adornments to draw @@ -8796,10 +8797,13 @@ public class WebView extends AbsoluteLayout /** @hide Called by JNI when pages are swapped (only occurs with hardware * acceleration) */ - protected void pageSwapCallback() { + protected void pageSwapCallback(boolean notifyAnimationStarted) { if (inEditingMode()) { didUpdateWebTextViewDimensions(ANYWHERE); } + if (notifyAnimationStarted) { + mWebViewCore.sendMessage(EventHub.NOTIFY_ANIMATION_STARTED); + } } void setNewPicture(final WebViewCore.DrawData draw, boolean updateBaseLayer) { diff --git a/core/java/android/webkit/WebViewCore.java b/core/java/android/webkit/WebViewCore.java index 2ad866b..d136004 100644 --- a/core/java/android/webkit/WebViewCore.java +++ b/core/java/android/webkit/WebViewCore.java @@ -519,7 +519,12 @@ public final class WebViewCore { /** * Update the layers' content */ - private native boolean nativeUpdateLayers(int baseLayer); + private native boolean nativeUpdateLayers(int nativeClass, int baseLayer); + + /** + * Notify webkit that animations have begun (on the hardware accelerated content) + */ + private native void nativeNotifyAnimationStarted(int nativeClass); private native boolean nativeFocusBoundsChanged(); @@ -1035,6 +1040,8 @@ public final class WebViewCore { static final int PLUGIN_SURFACE_READY = 195; + static final int NOTIFY_ANIMATION_STARTED = 196; + // private message ids private static final int DESTROY = 200; @@ -1594,6 +1601,10 @@ public final class WebViewCore { nativePluginSurfaceReady(); break; + case NOTIFY_ANIMATION_STARTED: + nativeNotifyAnimationStarted(mNativeClass); + break; + case ADD_PACKAGE_NAMES: if (BrowserFrame.sJavaBridge == null) { throw new IllegalStateException("No WebView " + @@ -2015,7 +2026,7 @@ public final class WebViewCore { return; } // Directly update the layers we last passed to the UI side - if (nativeUpdateLayers(mLastDrawData.mBaseLayer)) { + if (nativeUpdateLayers(mNativeClass, mLastDrawData.mBaseLayer)) { // If anything more complex than position has been touched, let's do a full draw webkitDraw(); } |