From 016ea440f1b61a966483fc809a078dd28b784e46 Mon Sep 17 00:00:00 2001 From: Cary Clark Date: Tue, 24 Aug 2010 10:52:43 -0400 Subject: 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 frameworks/base Change-Id: I78846214048b038cd8d0401dad103d451cd5a269 http://b/2621902 --- WebCore/platform/android/ScrollViewAndroid.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'WebCore/platform/android/ScrollViewAndroid.cpp') diff --git a/WebCore/platform/android/ScrollViewAndroid.cpp b/WebCore/platform/android/ScrollViewAndroid.cpp index dec3183..aefa64a 100644 --- a/WebCore/platform/android/ScrollViewAndroid.cpp +++ b/WebCore/platform/android/ScrollViewAndroid.cpp @@ -141,4 +141,12 @@ void ScrollView::platformOffscreenContentRectangle(const IntRect& vis, const Int } #endif +bool ScrollView::platformIsOffscreen() const +{ + /* other platforms override platformIsOffscreen when the browser + window is no longer on screen. We override it to prevent gif + animations from queuing up subsequent frames during dragging. */ + return android::WebViewCore::getWebViewCore(this)->drawIsPaused(); +} + } // namespace WebCore -- cgit v1.1