diff options
author | Chris Craik <ccraik@google.com> | 2012-05-16 10:22:32 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-05-16 10:22:32 -0700 |
commit | ff7c397b7e18be2ae819c4ffba438b738593ca20 (patch) | |
tree | d7df9df8e9bd076dea8c1cf39bcd6b8dab15943f /Source/WebCore/platform/graphics/android | |
parent | 0b072353e2ad89087c944dfb4acb1eff87bbac49 (diff) | |
download | external_webkit-ff7c397b7e18be2ae819c4ffba438b738593ca20.zip external_webkit-ff7c397b7e18be2ae819c4ffba438b738593ca20.tar.gz external_webkit-ff7c397b7e18be2ae819c4ffba438b738593ca20.tar.bz2 |
Revert "Allow more layers to be merged."
This was causing content to go missing.
bug:6504906
This reverts commit 0b072353e2ad89087c944dfb4acb1eff87bbac49
Diffstat (limited to 'Source/WebCore/platform/graphics/android')
4 files changed, 19 insertions, 15 deletions
diff --git a/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp b/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp index 3975545..a6bf6af 100644 --- a/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp +++ b/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp @@ -531,8 +531,8 @@ void GraphicsLayerAndroid::updateScrollingLayers() if (layerNeedsOverflow) { ASSERT(!m_foregroundLayer && !m_foregroundClipLayer); m_foregroundLayer = new ScrollableLayerAndroid(layer); - m_foregroundLayer->setIntrinsicallyComposited(true); + // TODO: can clip layer be set to not intrinsically composited? m_foregroundClipLayer = new LayerAndroid(layer); m_foregroundClipLayer->setMasksToBounds(true); m_foregroundClipLayer->addChild(m_foregroundLayer); diff --git a/Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp b/Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp index 49f273d..feb2d99 100644 --- a/Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp +++ b/Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp @@ -620,8 +620,19 @@ bool LayerAndroid::canJoinSurface(Surface* surface) LayerAndroid* lastLayer = surface->getFirstLayer(); + // isolate non-tiled layers + // TODO: remove this check so that multiple tiled layers with a invisible + // one inbetween can be merged + if (!needsTexture() || !lastLayer->needsTexture()) + return false; + + // isolate clipped layers + // TODO: paint correctly with clip when merged + if (m_haveClip || lastLayer->m_haveClip) + return false; + // isolate intrinsically composited layers - if (needsIsolatedSurface() || lastLayer->needsIsolatedSurface()) + if (m_intrinsicallyComposited || lastLayer->m_intrinsicallyComposited) return false; // TODO: investigate potential for combining transformed layers @@ -634,9 +645,6 @@ bool LayerAndroid::canJoinSurface(Surface* surface) if (surface->needsTexture() && needsTexture() && m_content->hasText() != surface->hasText()) return false; - if (m_animations.size()) - return false; - // TODO: compare other layer properties - fixed? overscroll? transformed? return true; #endif @@ -656,26 +664,24 @@ void LayerAndroid::assignSurfaces(LayerMergeState* mergeState) } #ifdef LAYER_MERGING_DEBUG - ALOGD("%*slayer %p(%d) rl %p %s surface %p lvl: %d, fixed %d, anim %d, intCom %d, haveClip %d scroll %d hasText (layer: %d surface: %d) hasContent %d size %.2f x %.2f", + ALOGD("%*slayer %p(%d) rl %p %s surface %p, fixed %d, anim %d, intCom %d, haveClip %d scroll %d", 4*mergeState->depth, "", this, m_uniqueId, m_owningLayer, needNewSurface ? "NEW" : "joins", mergeState->currentSurface, - mergeState->nonMergeNestedLevel, isPositionFixed(), m_animations.size() != 0, m_intrinsicallyComposited, m_haveClip, - contentIsScrollable(), m_content ? m_content->hasText() : -1, - mergeState->currentSurface ? mergeState->currentSurface->hasText() : -1, - needsTexture(), getWidth(), getHeight()); + contentIsScrollable()); #endif mergeState->currentSurface->addLayer(this, m_drawTransform); m_surface = mergeState->currentSurface; - if (contentIsScrollable() || isPositionFixed()) { + if (m_haveClip || contentIsScrollable() || isPositionFixed()) { // disable layer merging within the children of these layer types mergeState->nonMergeNestedLevel++; } + // pass the surface through children in drawing order, so that they may // attach themselves (and paint on it) if possible, or ignore it and create // a new one if not @@ -693,7 +699,7 @@ void LayerAndroid::assignSurfaces(LayerMergeState* mergeState) mergeState->depth--; } - if (contentIsScrollable() || isPositionFixed()) { + if (m_haveClip || contentIsScrollable() || isPositionFixed()) { // re-enable joining mergeState->nonMergeNestedLevel--; diff --git a/Source/WebCore/platform/graphics/android/layers/LayerAndroid.h b/Source/WebCore/platform/graphics/android/layers/LayerAndroid.h index 97da53c..c7c795f 100644 --- a/Source/WebCore/platform/graphics/android/layers/LayerAndroid.h +++ b/Source/WebCore/platform/graphics/android/layers/LayerAndroid.h @@ -281,8 +281,6 @@ public: Surface* surface() { return m_surface; } void setIntrinsicallyComposited(bool intCom) { m_intrinsicallyComposited = intCom; } - bool needsIsolatedSurface() { return (needsTexture() && m_intrinsicallyComposited) - || subclassType() == LayerAndroid::FixedBackgroundLayer; } int setHwAccelerated(bool hwAccelerated); diff --git a/Source/WebCore/platform/graphics/android/rendering/Surface.h b/Source/WebCore/platform/graphics/android/rendering/Surface.h index 7100125..a79a286 100644 --- a/Source/WebCore/platform/graphics/android/rendering/Surface.h +++ b/Source/WebCore/platform/graphics/android/rendering/Surface.h @@ -93,7 +93,7 @@ public: LayerMergeState(Vector<Surface*>* const allGroups) : surfaceList(allGroups) , currentSurface(0) - , nonMergeNestedLevel(0) + , nonMergeNestedLevel(-1) // start at -1 to ignore first LayerAndroid's clipping , depth(0) {} |