Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7e6bf6ff authored by Derek Sollenberger's avatar Derek Sollenberger
Browse files

Rename some variable to make it clear what data is being stored.

The object that carries drawing data between WebViewCore and WebView
uses ambiguous variable names that do not fully convey the meaning
of the values.  This change updates those names to make it clear to
the reader what the intention of those values is.

Change-Id: I5a403d44881e1fad366f3ec9930ee59134eccd88
parent 04d50204
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -6447,7 +6447,7 @@ public class WebView extends AbsoluteLayout
                    mUserScroll = false;
                    final WebViewCore.DrawData draw = (WebViewCore.DrawData) msg.obj;
                    setBaseLayer(draw.mBaseLayer, draw.mInvalRegion.getBounds());
                    final Point viewSize = draw.mViewPoint;
                    final Point viewSize = draw.mViewSize;
                    WebViewCore.ViewState viewState = draw.mViewState;
                    boolean isPictureAfterFirstLayout = viewState != null;
                    if (isPictureAfterFirstLayout) {
@@ -6470,8 +6470,8 @@ public class WebView extends AbsoluteLayout
                    // received in the fixed dimension.
                    final boolean updateLayout = viewSize.x == mLastWidthSent
                            && viewSize.y == mLastHeightSent;
                    recordNewContentSize(draw.mWidthHeight.x,
                            draw.mWidthHeight.y, updateLayout);
                    recordNewContentSize(draw.mContentSize.x,
                            draw.mContentSize.y, updateLayout);
                    if (DebugFlags.WEB_VIEW) {
                        Rect b = draw.mInvalRegion.getBounds();
                        Log.v(LOGTAG, "NEW_PICTURE_MSG_ID {" +
+6 −7
Original line number Diff line number Diff line
@@ -1826,12 +1826,13 @@ final class WebViewCore {
        DrawData() {
            mBaseLayer = 0;
            mInvalRegion = new Region();
            mWidthHeight = new Point();
            mContentSize = new Point();
        }
        int mBaseLayer;
        Region mInvalRegion;
        Point mViewPoint;
        Point mWidthHeight;
        // view size that was used by webkit during the most recent layout
        Point mViewSize;
        Point mContentSize;
        int mMinPrefWidth;
        // only non-null if it is for the first picture set after the first layout
        ViewState mViewState;
@@ -1842,16 +1843,14 @@ final class WebViewCore {
        mDrawIsScheduled = false;
        DrawData draw = new DrawData();
        if (DebugFlags.WEB_VIEW_CORE) Log.v(LOGTAG, "webkitDraw start");
        draw.mBaseLayer = nativeRecordContent(draw.mInvalRegion, draw.mWidthHeight);
        draw.mBaseLayer = nativeRecordContent(draw.mInvalRegion, draw.mContentSize);
        if (draw.mBaseLayer == 0) {
            if (DebugFlags.WEB_VIEW_CORE) Log.v(LOGTAG, "webkitDraw abort");
            return;
        }
        if (mWebView != null) {
            // Send the native view size that was used during the most recent
            // layout.
            draw.mFocusSizeChanged = nativeFocusBoundsChanged();
            draw.mViewPoint = new Point(mCurrentViewWidth, mCurrentViewHeight);
            draw.mViewSize = new Point(mCurrentViewWidth, mCurrentViewHeight);
            if (mSettings.getUseWideViewPort()) {
                draw.mMinPrefWidth = Math.max(
                        mViewportWidth == -1 ? WebView.DEFAULT_VIEWPORT_WIDTH
+4 −4
Original line number Diff line number Diff line
@@ -793,9 +793,9 @@ class ZoomManager {
                // bound to match the default scale for mobile sites.
                setZoomOverviewWidth(Math.min(WebView.sMaxViewportWidth,
                    Math.max((int) (viewWidth * mInvDefaultScale),
                            Math.max(drawData.mMinPrefWidth, drawData.mViewPoint.x))));
                            Math.max(drawData.mMinPrefWidth, drawData.mViewSize.x))));
            } else {
                final int contentWidth = drawData.mWidthHeight.x;
                final int contentWidth = drawData.mContentSize.x;
                setZoomOverviewWidth(Math.min(WebView.sMaxViewportWidth, contentWidth));
            }
        }
@@ -826,11 +826,11 @@ class ZoomManager {
        assert mWebView.getSettings() != null;

        WebViewCore.ViewState viewState = drawData.mViewState;
        final Point viewSize = drawData.mViewPoint;
        final Point viewSize = drawData.mViewSize;
        updateZoomRange(viewState, viewSize.x, drawData.mMinPrefWidth);
        if (mWebView.getSettings().getUseWideViewPort() &&
            mWebView.getSettings().getUseFixedViewport()) {
            final int contentWidth = drawData.mWidthHeight.x;
            final int contentWidth = drawData.mContentSize.x;
            setZoomOverviewWidth(Math.min(WebView.sMaxViewportWidth, contentWidth));
        }