Merge "Invalidate on new picture if scale/content size changes" into jb-dev
This commit is contained in:
@@ -2939,6 +2939,7 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc
|
||||
|
||||
// premature data from webkit, ignore
|
||||
if ((w | h) == 0) {
|
||||
invalidate();
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -2951,10 +2952,7 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc
|
||||
// updated when we get out of that mode.
|
||||
if (!mDrawHistory) {
|
||||
// repin our scroll, taking into account the new content size
|
||||
if (updateScrollCoordinates(pinLocX(getScrollX()),
|
||||
pinLocY(getScrollY()))) {
|
||||
invalidate();
|
||||
}
|
||||
updateScrollCoordinates(pinLocX(getScrollX()), pinLocY(getScrollY()));
|
||||
if (!mScroller.isFinished()) {
|
||||
// We are in the middle of a scroll. Repin the final scroll
|
||||
// position.
|
||||
@@ -2962,6 +2960,7 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc
|
||||
mScroller.setFinalY(pinLocY(mScroller.getFinalY()));
|
||||
}
|
||||
}
|
||||
invalidate();
|
||||
}
|
||||
contentSizeChanged(updateLayout);
|
||||
}
|
||||
@@ -7956,7 +7955,8 @@ public final class WebViewClassic implements WebViewProvider, WebViewProvider.Sc
|
||||
}
|
||||
|
||||
// update the zoom information based on the new picture
|
||||
mZoomManager.onNewPicture(draw);
|
||||
if (mZoomManager.onNewPicture(draw))
|
||||
invalidate();
|
||||
|
||||
if (isPictureAfterFirstLayout) {
|
||||
mViewManager.postReadyToDrawAll();
|
||||
|
||||
@@ -1008,8 +1008,10 @@ class ZoomManager {
|
||||
/**
|
||||
* Updates zoom values when Webkit produces a new picture. This method
|
||||
* should only be called from the UI thread's message handler.
|
||||
*
|
||||
* @return True if zoom value has changed
|
||||
*/
|
||||
public void onNewPicture(WebViewCore.DrawData drawData) {
|
||||
public boolean onNewPicture(WebViewCore.DrawData drawData) {
|
||||
final int viewWidth = mWebView.getViewWidth();
|
||||
final boolean zoomOverviewWidthChanged = setupZoomOverviewWidth(drawData, viewWidth);
|
||||
final float newZoomOverviewScale = getZoomOverviewScale();
|
||||
@@ -1056,6 +1058,8 @@ class ZoomManager {
|
||||
// so next new picture could be forced into overview mode if it's true.
|
||||
mInitialZoomOverview = mInZoomOverview;
|
||||
}
|
||||
|
||||
return scaleHasDiff;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user