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

Commit 75796bbe authored by Cary Clark's avatar Cary Clark
Browse files

communicate drawing pause to webkit to pause gif animation

Gif frames continue even if the webkit changes aren't drawn.
When we suspend drawing, suspend the gif animation as well.
This is accomplished by fooling webkit into thinking the
browser window is offscreen. When the webkit drawing is
resumed, invalidate the entire content so the gif animations
start up once more.

requires companion change in external/webkit

http://b/2621902

Change-Id: I1814aa41630820872d62752b75ae94383fdcc5fc
parent 970e33e6
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -441,6 +441,8 @@ final class WebViewCore {
     */
    private native void nativeClearContent();

    private native void nativeContentInvalidateAll();

    /**
     * Redraw a portion of the picture set. The Point wh returns the
     * width and height of the overall picture.
@@ -1880,13 +1882,13 @@ final class WebViewCore {

            synchronized (core) {
                core.mDrawIsPaused = false;
                if (core.mDrawIsScheduled) {
                // always redraw on resume to reenable gif animations
                core.mDrawIsScheduled = false;
                core.nativeContentInvalidateAll();
                core.contentDraw();
            }
        }
    }
    }

    //////////////////////////////////////////////////////////////////////////