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

Commit ecfeebeb authored by Derek Sollenberger's avatar Derek Sollenberger Committed by Android (Google) Code Review
Browse files

Merge "Add a runtime switch between Raster and Ganesh rendering modes."

parents a6675435 1d335f30
Loading
Loading
Loading
Loading
+21 −0
Original line number Diff line number Diff line
@@ -179,6 +179,7 @@ public class WebSettings {
    private boolean         mBlockNetworkImage = false;
    private boolean         mBlockNetworkLoads;
    private boolean         mJavaScriptEnabled = false;
    private boolean         mHardwareAccelSkia = false;
    private boolean         mShowVisualIndicator = false;
    private PluginState     mPluginState = PluginState.OFF;
    private boolean         mJavaScriptCanOpenWindowsAutomatically = false;
@@ -1242,6 +1243,26 @@ public class WebSettings {
        }
    }

    /**
     * Tell the WebView to use Skia's hardware accelerated rendering path
     * @param flag True if the WebView should use Skia's hw-accel path
     * @hide
     */
    public synchronized void setHardwareAccelSkiaEnabled(boolean flag) {
        if (mHardwareAccelSkia != flag) {
            mHardwareAccelSkia = flag;
            postSync();
        }
    }

    /**
     * @return True if the WebView is using hardware accelerated skia
     * @hide
     */
    public synchronized boolean getHardwareAccelSkiaEnabled() {
        return mHardwareAccelSkia;
    }

    /**
     * Tell the WebView to show the visual indicator
     * @param flag True if the WebView should show the visual indicator
+11 −1
Original line number Diff line number Diff line
@@ -625,6 +625,9 @@ public class WebView extends AbsoluteLayout
    // If we are using a set picture, don't send view updates to webkit
    private boolean mBlockWebkitViewMessages = false;

    // cached value used to determine if we need to switch drawing models
    private boolean mHardwareAccelSkia = false;

    /*
     * Private message ids
     */
@@ -4394,6 +4397,12 @@ public class WebView extends AbsoluteLayout
            int functor = nativeGetDrawGLFunction(mGLViewportEmpty ? null : mGLRectViewport,
                    mGLViewportEmpty ? null : mViewRectViewport, getScale(), extras);
            ((HardwareCanvas) canvas).callDrawGLFunction(functor);

            if (mHardwareAccelSkia != getSettings().getHardwareAccelSkiaEnabled()) {
                mHardwareAccelSkia = getSettings().getHardwareAccelSkiaEnabled();
                nativeUseHardwareAccelSkia(mHardwareAccelSkia);
            }

        } else {
            DrawFilter df = null;
            if (mZoomManager.isZoomAnimating() || UIAnimationsRunning) {
@@ -9253,6 +9262,7 @@ public class WebView extends AbsoluteLayout
    native int nativeGetBlockLeftEdge(int x, int y, float scale);

    private native void     nativeSetExpandedTileBounds(boolean enabled);
    private native void     nativeUseHardwareAccelSkia(boolean enabled);

    // Returns a pointer to the scrollable LayerAndroid at the given point.
    private native int      nativeScrollableLayer(int x, int y, Rect scrollRect,