summaryrefslogtreecommitdiffstats
path: root/Source/WebCore
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore')
-rw-r--r--Source/WebCore/platform/graphics/android/GLWebViewState.cpp8
-rw-r--r--Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp34
-rw-r--r--Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.h2
-rw-r--r--Source/WebCore/platform/graphics/android/TilesManager.cpp2
-rw-r--r--Source/WebCore/rendering/RenderLayerCompositor.cpp14
5 files changed, 56 insertions, 4 deletions
diff --git a/Source/WebCore/platform/graphics/android/GLWebViewState.cpp b/Source/WebCore/platform/graphics/android/GLWebViewState.cpp
index 273c478..3bcda9a 100644
--- a/Source/WebCore/platform/graphics/android/GLWebViewState.cpp
+++ b/Source/WebCore/platform/graphics/android/GLWebViewState.cpp
@@ -130,8 +130,10 @@ void GLWebViewState::setBaseLayer(BaseLayerAndroid* layer, const SkRegion& inval
{
if (!layer || isPictureAfterFirstLayout) {
// TODO: move this into TreeManager
+ m_zoomManager.swapPages(); // reset zoom state
m_tiledPageA->discardTextures();
m_tiledPageB->discardTextures();
+ m_layersRenderingMode = kAllTextures;
}
if (layer) {
XLOG("new base layer %p, (inval region empty %d) with child %p", layer, inval.isEmpty(), layer->getChild(0));
@@ -376,6 +378,12 @@ bool GLWebViewState::setLayersRenderingMode(TexturesResult& nbTexturesNeeded)
int maxTextures = TilesManager::instance()->maxLayerTextureCount();
LayersRenderingMode layersRenderingMode = m_layersRenderingMode;
+ if (m_layersRenderingMode == kSingleSurfaceRendering) {
+ // only switch out of SingleSurface mode, if we have 2x needed textures
+ // to avoid changing too often
+ maxTextures /= 2;
+ }
+
m_layersRenderingMode = kSingleSurfaceRendering;
if (nbTexturesNeeded.fixed < maxTextures)
m_layersRenderingMode = kFixedLayers;
diff --git a/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp b/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp
index 6990503..567b54b 100644
--- a/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp
+++ b/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp
@@ -963,11 +963,31 @@ void GraphicsLayerAndroid::syncMask()
}
}
-void GraphicsLayerAndroid::syncCompositingState()
+void GraphicsLayerAndroid::gatherRootLayers(Vector<const RenderLayer*>& list)
{
- for (unsigned int i = 0; i < m_children.size(); i++)
- m_children[i]->syncCompositingState();
+ RenderLayer* renderLayer = renderLayerFromClient(m_client);
+ if (renderLayer) {
+ const RenderLayer* rootLayer = renderLayer->root();
+ bool found = false;
+ for (unsigned int i = 0; i < list.size(); i++) {
+ const RenderLayer* current = list[i];
+ if (current == rootLayer) {
+ found = true;
+ break;
+ }
+ }
+ if (!found)
+ list.append(rootLayer);
+ }
+ for (unsigned int i = 0; i < m_children.size(); i++) {
+ GraphicsLayerAndroid* layer = static_cast<GraphicsLayerAndroid*>(m_children[i]);
+ layer->gatherRootLayers(list);
+ }
+}
+
+void GraphicsLayerAndroid::syncCompositingStateForThisLayerOnly()
+{
updateScrollingLayers();
updateFixedPosition();
syncChildren();
@@ -977,6 +997,14 @@ void GraphicsLayerAndroid::syncCompositingState()
repaint();
}
+void GraphicsLayerAndroid::syncCompositingState()
+{
+ for (unsigned int i = 0; i < m_children.size(); i++)
+ m_children[i]->syncCompositingState();
+
+ syncCompositingStateForThisLayerOnly();
+}
+
void GraphicsLayerAndroid::notifyClientAnimationStarted()
{
for (unsigned int i = 0; i < m_children.size(); i++)
diff --git a/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.h b/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.h
index 358f674..e6d75b0 100644
--- a/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.h
+++ b/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.h
@@ -116,7 +116,9 @@ public:
virtual void setZPosition(float);
+ void gatherRootLayers(Vector<const RenderLayer*>&);
virtual void syncCompositingState();
+ virtual void syncCompositingStateForThisLayerOnly();
void notifyClientAnimationStarted();
LayerAndroid* contentLayer() { return m_contentLayer; }
diff --git a/Source/WebCore/platform/graphics/android/TilesManager.cpp b/Source/WebCore/platform/graphics/android/TilesManager.cpp
index 30bd8d0..62324d7 100644
--- a/Source/WebCore/platform/graphics/android/TilesManager.cpp
+++ b/Source/WebCore/platform/graphics/android/TilesManager.cpp
@@ -113,7 +113,7 @@ TilesManager::TilesManager()
m_tilesTextures.reserveCapacity(MAX_TEXTURE_ALLOCATION);
m_availableTilesTextures.reserveCapacity(MAX_TEXTURE_ALLOCATION);
m_pixmapsGenerationThread = new TexturesGenerator();
- m_pixmapsGenerationThread->run("TexturesGenerator", android::PRIORITY_BACKGROUND);
+ m_pixmapsGenerationThread->run("TexturesGenerator");
}
void TilesManager::allocateTiles()
diff --git a/Source/WebCore/rendering/RenderLayerCompositor.cpp b/Source/WebCore/rendering/RenderLayerCompositor.cpp
index 1ef3b77..33bf2f7 100644
--- a/Source/WebCore/rendering/RenderLayerCompositor.cpp
+++ b/Source/WebCore/rendering/RenderLayerCompositor.cpp
@@ -1366,7 +1366,21 @@ bool RenderLayerCompositor::needsToBeComposited(const RenderLayer* layer) const
return false;
// The root layer always has a compositing layer, but it may not have backing.
+#if PLATFORM(ANDROID)
+ // If we do not have a root platform layer, don't use the
+ // mustOverlapCompositedLayers() as a cue that this layer needs to be
+ // composited -- the layers tree has been detached.
+ // Otherwise we can end up in a cycle where updateBacking() switches composited
+ // mode on because a layer has mustOverlapCompositedLayers() (by calling
+ // enableCompositingMode()), while computeCompositingRequirements() will
+ // (correctly) say that we do not need to be in composited mode and turns it
+ // off, rince and repeat...
+ return requiresCompositingLayer(layer)
+ || (m_rootPlatformLayer && layer->mustOverlapCompositedLayers())
+ || (inCompositingMode() && layer->isRootLayer());
+#else
return requiresCompositingLayer(layer) || layer->mustOverlapCompositedLayers() || (inCompositingMode() && layer->isRootLayer());
+#endif
}
#if PLATFORM(ANDROID)