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
This commit is contained in:
@@ -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,10 +1882,10 @@ final class WebViewCore {
|
||||
|
||||
synchronized (core) {
|
||||
core.mDrawIsPaused = false;
|
||||
if (core.mDrawIsScheduled) {
|
||||
core.mDrawIsScheduled = false;
|
||||
core.contentDraw();
|
||||
}
|
||||
// always redraw on resume to reenable gif animations
|
||||
core.mDrawIsScheduled = false;
|
||||
core.nativeContentInvalidateAll();
|
||||
core.contentDraw();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user