summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Roard <nicolas@android.com>2010-03-31 23:18:51 +0100
committerNicolas Roard <nicolas@android.com>2010-05-21 18:29:47 -0700
commitbad8b91f026f7b63252113590bab4c73a7092214 (patch)
treed09ed442230ae40886fa054576c5051b8c8eef9e
parent571024554692d67ee9f4c6390e18dc41a38e7251 (diff)
downloadexternal_webkit-bad8b91f026f7b63252113590bab4c73a7092214.zip
external_webkit-bad8b91f026f7b63252113590bab4c73a7092214.tar.gz
external_webkit-bad8b91f026f7b63252113590bab4c73a7092214.tar.bz2
Remove the use of a timer to delay painting, instead use a flag and check it
in RecordContent. Change-Id: I2a7c11d0cb9697bbc415b2b91ee96a188bf45bf3
-rw-r--r--WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp10
-rw-r--r--WebKit/android/WebCoreSupport/ChromeClientAndroid.h8
-rw-r--r--WebKit/android/jni/WebViewCore.cpp6
3 files changed, 16 insertions, 8 deletions
diff --git a/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp b/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp
index b59689d..ead81e0 100644
--- a/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp
+++ b/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp
@@ -57,11 +57,16 @@ static unsigned long long tryToReclaimDatabaseQuota(SecurityOrigin* originNeedin
#if USE(ACCELERATED_COMPOSITING)
-void ChromeClientAndroid::syncTimerFired(Timer<ChromeClientAndroid>* client)
+void ChromeClientAndroid::layersSync()
{
if (!m_rootGraphicsLayer)
return;
+ if (!m_needsLayerSync)
+ return;
+
+ m_needsLayerSync = false;
+
if (m_webFrame) {
FrameView* frameView = m_webFrame->page()->mainFrame()->view();
if (frameView && frameView->syncCompositingStateRecursive()) {
@@ -77,8 +82,7 @@ void ChromeClientAndroid::syncTimerFired(Timer<ChromeClientAndroid>* client)
void ChromeClientAndroid::scheduleCompositingLayerSync()
{
- if (!m_syncTimer.isActive())
- m_syncTimer.startOneShot(0);
+ m_needsLayerSync = true;
}
void ChromeClientAndroid::setNeedsOneShotDrawingSynchronization()
diff --git a/WebKit/android/WebCoreSupport/ChromeClientAndroid.h b/WebKit/android/WebCoreSupport/ChromeClientAndroid.h
index 902d84c..28f2546 100644
--- a/WebKit/android/WebCoreSupport/ChromeClientAndroid.h
+++ b/WebKit/android/WebCoreSupport/ChromeClientAndroid.h
@@ -46,8 +46,7 @@ namespace android {
ChromeClientAndroid() : m_webFrame(0), m_geolocationPermissions(0)
#if USE(ACCELERATED_COMPOSITING)
, m_rootGraphicsLayer(0)
- , m_askToDrawAgain(false)
- , m_syncTimer(this, &ChromeClientAndroid::syncTimerFired)
+ , m_needsLayerSync(false)
#endif
, m_triedToReclaimDBQuota(false)
{ }
@@ -170,7 +169,7 @@ namespace android {
virtual void attachRootGraphicsLayer(WebCore::Frame*, WebCore::GraphicsLayer* g);
virtual void setNeedsOneShotDrawingSynchronization();
virtual void scheduleCompositingLayerSync();
- void syncTimerFired(Timer<ChromeClientAndroid>*);
+ void layersSync();
#endif
private:
@@ -179,8 +178,7 @@ namespace android {
OwnPtr<GeolocationPermissions> m_geolocationPermissions;
#if USE(ACCELERATED_COMPOSITING)
WebCore::GraphicsLayer* m_rootGraphicsLayer;
- bool m_askToDrawAgain;
- Timer<ChromeClientAndroid> m_syncTimer;
+ bool m_needsLayerSync;
#endif
WTF::ThreadCondition m_quotaThreadCondition;
WTF::Mutex m_quotaThreadLock;
diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp
index 19d616c..45356f8 100644
--- a/WebKit/android/jni/WebViewCore.cpp
+++ b/WebKit/android/jni/WebViewCore.cpp
@@ -884,6 +884,12 @@ bool WebViewCore::recordContent(SkRegion* region, SkIPoint* point)
region->getBounds().fTop, region->getBounds().fRight,
region->getBounds().fBottom);
DBG_SET_LOG("end");
+
+#if USE(ACCELERATED_COMPOSITING)
+ // We update the layers
+ ChromeClientAndroid* chromeC = static_cast<ChromeClientAndroid*>(m_mainFrame->page()->chrome()->client());
+ chromeC->layersSync();
+#endif
return true;
}