summaryrefslogtreecommitdiffstats
path: root/WebKit/android/WebCoreSupport
diff options
context:
space:
mode:
authorNicolas Roard <nicolas@android.com>2010-02-24 18:09:11 +0000
committerNicolas Roard <nicolas@android.com>2010-02-24 19:21:17 +0000
commit4175d59b46f96005f0c64978b1a94e3fe60f1e8e (patch)
tree9efdec20c3a8c4bfedbe8f0f470dc618f4d578cd /WebKit/android/WebCoreSupport
parent08d3adc3529e10dc9843cdfee20b4937f38301bd (diff)
downloadexternal_webkit-4175d59b46f96005f0c64978b1a94e3fe60f1e8e.zip
external_webkit-4175d59b46f96005f0c64978b1a94e3fe60f1e8e.tar.gz
external_webkit-4175d59b46f96005f0c64978b1a94e3fe60f1e8e.tar.bz2
Simplify the layer code:
* Rename setRootLayer to setUIRootLayer * Fixed some logs in GraphicsLayerAndroid * Added back the diagonal drawing debug code in LayerAndroid * Simplified ChromeClientAndroid, removed compositingLayerSync()
Diffstat (limited to 'WebKit/android/WebCoreSupport')
-rw-r--r--WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp28
-rw-r--r--WebKit/android/WebCoreSupport/ChromeClientAndroid.h1
-rw-r--r--WebKit/android/WebCoreSupport/PlatformBridge.cpp8
3 files changed, 11 insertions, 26 deletions
diff --git a/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp b/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp
index e9e77e9..8187871 100644
--- a/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp
+++ b/WebKit/android/WebCoreSupport/ChromeClientAndroid.cpp
@@ -58,41 +58,26 @@ static unsigned long long tryToReclaimDatabaseQuota(SecurityOrigin* originNeedin
void ChromeClientAndroid::syncTimerFired(Timer<ChromeClientAndroid>* client)
{
- m_syncTimer.stop();
- compositingLayerSync();
-}
-
-void ChromeClientAndroid::compositingLayerSync()
-{
- if (!m_rootGraphicsLayer) {
+ if (!m_rootGraphicsLayer)
return;
- }
if (m_webFrame) {
FrameView* frameView = m_webFrame->page()->mainFrame()->view();
- if (frameView && !frameView->layoutPending() && !frameView->needsLayout()) {
- frameView->syncCompositingStateRecursive();
+ if (frameView && frameView->syncCompositingStateRecursive()) {
GraphicsLayerAndroid* androidGraphicsLayer =
static_cast<GraphicsLayerAndroid*>(m_rootGraphicsLayer);
if (androidGraphicsLayer) {
androidGraphicsLayer->sendImmediateRepaint();
androidGraphicsLayer->notifyClientAnimationStarted();
}
- return;
}
}
- if (m_askToDrawAgain) {
- m_askToDrawAgain = false;
- scheduleCompositingLayerSync();
- }
}
void ChromeClientAndroid::scheduleCompositingLayerSync()
{
if (!m_syncTimer.isActive())
m_syncTimer.startOneShot(0.001); // 1ms
- else
- m_askToDrawAgain = true;
}
void ChromeClientAndroid::setNeedsOneShotDrawingSynchronization()
@@ -104,15 +89,12 @@ void ChromeClientAndroid::attachRootGraphicsLayer(WebCore::Frame* frame, WebCore
{
m_rootGraphicsLayer = layer;
if (!layer) {
- WebViewCore::getWebViewCore(frame->view())->setRootLayer(0);
+ WebViewCore::getWebViewCore(frame->view())->setUIRootLayer(0);
return;
}
WebCore::GraphicsLayerAndroid* androidGraphicsLayer = static_cast<GraphicsLayerAndroid*>(layer);
- if (frame && frame->view() && androidGraphicsLayer) {
- androidGraphicsLayer->setFrame(frame);
- WebCore::LayerAndroid* androidLayer = new LayerAndroid(androidGraphicsLayer->contentLayer());
- WebViewCore::getWebViewCore(frame->view())->setRootLayer((int)androidLayer);
- }
+ androidGraphicsLayer->setFrame(frame);
+ scheduleCompositingLayerSync();
}
#endif
diff --git a/WebKit/android/WebCoreSupport/ChromeClientAndroid.h b/WebKit/android/WebCoreSupport/ChromeClientAndroid.h
index 2c061b2..68cac24 100644
--- a/WebKit/android/WebCoreSupport/ChromeClientAndroid.h
+++ b/WebKit/android/WebCoreSupport/ChromeClientAndroid.h
@@ -166,7 +166,6 @@ namespace android {
virtual void attachRootGraphicsLayer(WebCore::Frame*, WebCore::GraphicsLayer* g);
virtual void setNeedsOneShotDrawingSynchronization();
virtual void scheduleCompositingLayerSync();
- void compositingLayerSync();
void syncTimerFired(Timer<ChromeClientAndroid>*);
#endif
diff --git a/WebKit/android/WebCoreSupport/PlatformBridge.cpp b/WebKit/android/WebCoreSupport/PlatformBridge.cpp
index c04600d..b8bee7b 100644
--- a/WebKit/android/WebCoreSupport/PlatformBridge.cpp
+++ b/WebKit/android/WebCoreSupport/PlatformBridge.cpp
@@ -35,16 +35,20 @@
#include <wtf/android/AndroidThreading.h>
#include <wtf/MainThread.h>
+#if USE(ACCELERATED_COMPOSITING)
+#include "LayerAndroid.h"
+#endif
+
using namespace android;
namespace WebCore {
#if USE(ACCELERATED_COMPOSITING)
-void PlatformBridge::setRootLayer(const WebCore::FrameView* view, int layer)
+void PlatformBridge::setUIRootLayer(const WebCore::FrameView* view, const LayerAndroid* layer)
{
android::WebViewCore* core = android::WebViewCore::getWebViewCore(view);
- core->setRootLayer(layer);
+ core->setUIRootLayer(layer);
}
void PlatformBridge::immediateRepaint(const WebCore::FrameView* view)