diff options
| author | John Reck <jreck@google.com> | 2012-05-08 16:28:15 -0700 |
|---|---|---|
| committer | John Reck <jreck@google.com> | 2012-05-08 16:44:20 -0700 |
| commit | 35caaaf726b8b17cec92747a1fe42dba44d6b775 (patch) | |
| tree | db677de6efc417f232ff8ca6f4c60049f08fec50 /Source/WebKit/android/nav | |
| parent | 828c3a7d6b11b21de7ddfbe200eb62b3a0ef0c41 (diff) | |
| download | external_webkit-35caaaf726b8b17cec92747a1fe42dba44d6b775.zip external_webkit-35caaaf726b8b17cec92747a1fe42dba44d6b775.tar.gz external_webkit-35caaaf726b8b17cec92747a1fe42dba44d6b775.tar.bz2 | |
Disable prerenders if we aren't focused
Bug: 6448418
Change-Id: I624d78a2b674cbd91ebe70008c70967101fbb12a
Diffstat (limited to 'Source/WebKit/android/nav')
| -rw-r--r-- | Source/WebKit/android/nav/WebView.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/Source/WebKit/android/nav/WebView.cpp b/Source/WebKit/android/nav/WebView.cpp index 3822239..1e84a12 100644 --- a/Source/WebKit/android/nav/WebView.cpp +++ b/Source/WebKit/android/nav/WebView.cpp @@ -259,6 +259,9 @@ int drawGL(WebCore::IntRect& invScreenRect, WebCore::IntRect* invalRect, if (!m_baseLayer) return 0; + if (m_viewImpl) + m_viewImpl->setPrerenderingEnabled(!m_isDrawingPaused); + if (!m_glWebViewState) { TilesManager::instance()->setHighEndGfx(m_isHighEndGfx); m_glWebViewState = new GLWebViewState(); @@ -648,8 +651,15 @@ int setHwAccelerated(bool hwAccelerated) { return 0; } - bool m_isDrawingPaused; +void setDrawingPaused(bool isPaused) +{ + m_isDrawingPaused = isPaused; + if (m_viewImpl) + m_viewImpl->setPrerenderingEnabled(!isPaused); +} + private: // local state for WebView + bool m_isDrawingPaused; // private to getFrameCache(); other functions operate in a different thread WebViewCore* m_viewImpl; int m_generation; // associate unique ID with sent kit focus to match with ui @@ -1167,7 +1177,7 @@ static int nativeGetBackgroundColor(JNIEnv* env, jobject obj, jint nativeView) static void nativeSetPauseDrawing(JNIEnv *env, jobject obj, jint nativeView, jboolean pause) { - reinterpret_cast<WebView*>(nativeView)->m_isDrawingPaused = pause; + reinterpret_cast<WebView*>(nativeView)->setDrawingPaused(pause); } static void nativeSetTextSelection(JNIEnv *env, jobject obj, jint nativeView, |
