Loading core/java/android/webkit/WebView.java +4 −0 Original line number Diff line number Diff line Loading @@ -3734,6 +3734,10 @@ public class WebView extends AbsoluteLayout return; } if (canvas.isHardwareAccelerated()) { mZoomManager.setHardwareAccelerated(); } int saveCount = canvas.save(); if (mInOverScrollMode && !getSettings() .getUseWebViewBackgroundForOverscrollBackground()) { Loading core/java/android/webkit/ZoomManager.java +26 −3 Original line number Diff line number Diff line Loading @@ -183,6 +183,9 @@ class ZoomManager { private ScaleGestureDetector mScaleDetector; private boolean mPinchToZoomAnimating = false; private boolean mHardwareAccelerated = false; private boolean mInHWAcceleratedZoom = false; public ZoomManager(WebView webView, CallbackProxy callbackProxy) { mWebView = webView; mCallbackProxy = callbackProxy; Loading Loading @@ -384,6 +387,10 @@ class ZoomManager { scale = getReadingLevelScale(); } if (mHardwareAccelerated) { mInHWAcceleratedZoom = true; } setZoomScale(scale, reflowText); if (oldScale != mActualScale) { Loading Loading @@ -447,9 +454,19 @@ class ZoomManager { - titleHeight, mWebView.getViewHeight(), Math.round(mWebView.getContentHeight() * zoomScale)) + titleHeight) + mWebView.getScrollY(); if (mHardwareAccelerated) { mWebView.updateScrollCoordinates(mWebView.getScrollX() - tx, mWebView.getScrollY() - ty); setZoomScale(zoomScale, false); if (mZoomScale == 0) { // We've reached the end of the zoom animation. mInHWAcceleratedZoom = false; } } else { canvas.translate(tx, ty); canvas.scale(zoomScale, zoomScale); } } public boolean isZoomAnimating() { return isFixedLengthAnimationInProgress() || mPinchToZoomAnimating; Loading Loading @@ -493,12 +510,14 @@ class ZoomManager { mActualScale = scale; mInvActualScale = 1 / scale; if (!mWebView.drawHistory()) { if (!mWebView.drawHistory() && !mInHWAcceleratedZoom) { // If history Picture is drawn, don't update scroll. They will // be updated when we get out of that mode. // update our scroll so we don't appear to jump // i.e. keep the center of the doc in the center of the view // If this is part of a zoom on a HW accelerated canvas, we // have already updated the scroll so don't do it again. int oldX = mWebView.getScrollX(); int oldY = mWebView.getScrollY(); float ratio = scale * oldInvScale; Loading Loading @@ -1020,4 +1039,8 @@ class ZoomManager { return null; } } public void setHardwareAccelerated() { mHardwareAccelerated = true; } } Loading
core/java/android/webkit/WebView.java +4 −0 Original line number Diff line number Diff line Loading @@ -3734,6 +3734,10 @@ public class WebView extends AbsoluteLayout return; } if (canvas.isHardwareAccelerated()) { mZoomManager.setHardwareAccelerated(); } int saveCount = canvas.save(); if (mInOverScrollMode && !getSettings() .getUseWebViewBackgroundForOverscrollBackground()) { Loading
core/java/android/webkit/ZoomManager.java +26 −3 Original line number Diff line number Diff line Loading @@ -183,6 +183,9 @@ class ZoomManager { private ScaleGestureDetector mScaleDetector; private boolean mPinchToZoomAnimating = false; private boolean mHardwareAccelerated = false; private boolean mInHWAcceleratedZoom = false; public ZoomManager(WebView webView, CallbackProxy callbackProxy) { mWebView = webView; mCallbackProxy = callbackProxy; Loading Loading @@ -384,6 +387,10 @@ class ZoomManager { scale = getReadingLevelScale(); } if (mHardwareAccelerated) { mInHWAcceleratedZoom = true; } setZoomScale(scale, reflowText); if (oldScale != mActualScale) { Loading Loading @@ -447,9 +454,19 @@ class ZoomManager { - titleHeight, mWebView.getViewHeight(), Math.round(mWebView.getContentHeight() * zoomScale)) + titleHeight) + mWebView.getScrollY(); if (mHardwareAccelerated) { mWebView.updateScrollCoordinates(mWebView.getScrollX() - tx, mWebView.getScrollY() - ty); setZoomScale(zoomScale, false); if (mZoomScale == 0) { // We've reached the end of the zoom animation. mInHWAcceleratedZoom = false; } } else { canvas.translate(tx, ty); canvas.scale(zoomScale, zoomScale); } } public boolean isZoomAnimating() { return isFixedLengthAnimationInProgress() || mPinchToZoomAnimating; Loading Loading @@ -493,12 +510,14 @@ class ZoomManager { mActualScale = scale; mInvActualScale = 1 / scale; if (!mWebView.drawHistory()) { if (!mWebView.drawHistory() && !mInHWAcceleratedZoom) { // If history Picture is drawn, don't update scroll. They will // be updated when we get out of that mode. // update our scroll so we don't appear to jump // i.e. keep the center of the doc in the center of the view // If this is part of a zoom on a HW accelerated canvas, we // have already updated the scroll so don't do it again. int oldX = mWebView.getScrollX(); int oldY = mWebView.getScrollY(); float ratio = scale * oldInvScale; Loading Loading @@ -1020,4 +1039,8 @@ class ZoomManager { return null; } } public void setHardwareAccelerated() { mHardwareAccelerated = true; } }