Loading core/java/android/webkit/WebSettings.java +4 −4 Original line number Diff line number Diff line Loading @@ -643,10 +643,10 @@ public class WebSettings { /** * Set whether the WebView will enable smooth transition while panning or * zooming. If it is true, WebView will choose a solution to maximize the * performance. e.g. the WebView's content may not be updated during the * transition. If it is false, WebView will keep its fidelity. The default * value is false. * zooming or while the window hosting the WebView does not have focus. * If it is true, WebView will choose a solution to maximize the performance. * e.g. the WebView's content may not be updated during the transition. * If it is false, WebView will keep its fidelity. The default value is false. */ public void setEnableSmoothTransition(boolean enable) { mEnableSmoothTransition = enable; Loading core/java/android/webkit/WebView.java +15 −0 Original line number Diff line number Diff line Loading @@ -908,6 +908,9 @@ public class WebView extends AbsoluteLayout // used for serializing asynchronously handled touch events. private final TouchEventQueue mTouchEventQueue = new TouchEventQueue(); // Used to track whether picture updating was paused due to a window focus change. private boolean mPictureUpdatePausedForFocusChange = false; // Used to notify listeners of a new picture. private PictureListener mPictureListener; /** Loading Loading @@ -5570,8 +5573,20 @@ public class WebView extends AbsoluteLayout setActive(hasWindowFocus); if (hasWindowFocus) { JWebCoreJavaBridge.setActiveWebView(this); if (mPictureUpdatePausedForFocusChange) { WebViewCore.resumeUpdatePicture(mWebViewCore); nativeSetIsScrolling(false); mPictureUpdatePausedForFocusChange = false; } } else { JWebCoreJavaBridge.removeActiveWebView(this); final WebSettings settings = getSettings(); if (settings != null && settings.enableSmoothTransition() && mWebViewCore != null && !WebViewCore.isUpdatePicturePaused(mWebViewCore)) { WebViewCore.pauseUpdatePicture(mWebViewCore); nativeSetIsScrolling(true); mPictureUpdatePausedForFocusChange = true; } } super.onWindowFocusChanged(hasWindowFocus); } Loading core/java/android/webkit/WebViewCore.java +4 −0 Original line number Diff line number Diff line Loading @@ -2107,6 +2107,10 @@ public final class WebViewCore { } } static boolean isUpdatePicturePaused(WebViewCore core) { return core != null ? core.mDrawIsPaused : false; } ////////////////////////////////////////////////////////////////////////// private void restoreState(int index) { Loading Loading
core/java/android/webkit/WebSettings.java +4 −4 Original line number Diff line number Diff line Loading @@ -643,10 +643,10 @@ public class WebSettings { /** * Set whether the WebView will enable smooth transition while panning or * zooming. If it is true, WebView will choose a solution to maximize the * performance. e.g. the WebView's content may not be updated during the * transition. If it is false, WebView will keep its fidelity. The default * value is false. * zooming or while the window hosting the WebView does not have focus. * If it is true, WebView will choose a solution to maximize the performance. * e.g. the WebView's content may not be updated during the transition. * If it is false, WebView will keep its fidelity. The default value is false. */ public void setEnableSmoothTransition(boolean enable) { mEnableSmoothTransition = enable; Loading
core/java/android/webkit/WebView.java +15 −0 Original line number Diff line number Diff line Loading @@ -908,6 +908,9 @@ public class WebView extends AbsoluteLayout // used for serializing asynchronously handled touch events. private final TouchEventQueue mTouchEventQueue = new TouchEventQueue(); // Used to track whether picture updating was paused due to a window focus change. private boolean mPictureUpdatePausedForFocusChange = false; // Used to notify listeners of a new picture. private PictureListener mPictureListener; /** Loading Loading @@ -5570,8 +5573,20 @@ public class WebView extends AbsoluteLayout setActive(hasWindowFocus); if (hasWindowFocus) { JWebCoreJavaBridge.setActiveWebView(this); if (mPictureUpdatePausedForFocusChange) { WebViewCore.resumeUpdatePicture(mWebViewCore); nativeSetIsScrolling(false); mPictureUpdatePausedForFocusChange = false; } } else { JWebCoreJavaBridge.removeActiveWebView(this); final WebSettings settings = getSettings(); if (settings != null && settings.enableSmoothTransition() && mWebViewCore != null && !WebViewCore.isUpdatePicturePaused(mWebViewCore)) { WebViewCore.pauseUpdatePicture(mWebViewCore); nativeSetIsScrolling(true); mPictureUpdatePausedForFocusChange = true; } } super.onWindowFocusChanged(hasWindowFocus); } Loading
core/java/android/webkit/WebViewCore.java +4 −0 Original line number Diff line number Diff line Loading @@ -2107,6 +2107,10 @@ public final class WebViewCore { } } static boolean isUpdatePicturePaused(WebViewCore core) { return core != null ? core.mDrawIsPaused : false; } ////////////////////////////////////////////////////////////////////////// private void restoreState(int index) { Loading