summaryrefslogtreecommitdiffstats
path: root/Source/WebCore
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2012-05-16 11:14:47 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-05-16 11:14:47 -0700
commitcd9acbf9148d5899fd28381547e5ac961431439b (patch)
tree05d3f1383bcbacaf8f4adc536ab14f95b94fe665 /Source/WebCore
parenta8081f562d712efba4ca1283c6bfc286ad86a965 (diff)
parente6df58a2ee3da14d6260378eed1d716f3b4eacb8 (diff)
downloadexternal_webkit-cd9acbf9148d5899fd28381547e5ac961431439b.zip
external_webkit-cd9acbf9148d5899fd28381547e5ac961431439b.tar.gz
external_webkit-cd9acbf9148d5899fd28381547e5ac961431439b.tar.bz2
am e6df58a2: am f0acbad2: Merge "Revert "Allow more layers to be merged."" into jb-dev
* commit 'e6df58a2ee3da14d6260378eed1d716f3b4eacb8': Revert "Allow more layers to be merged."
Diffstat (limited to 'Source/WebCore')
-rw-r--r--Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp2
-rw-r--r--Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp28
-rw-r--r--Source/WebCore/platform/graphics/android/layers/LayerAndroid.h2
-rw-r--r--Source/WebCore/platform/graphics/android/rendering/Surface.h2
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 2703cfd..4a6bcbe 100644
--- a/Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp
+++ b/Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp
@@ -626,8 +626,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
@@ -640,9 +651,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
@@ -662,26 +670,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
@@ -699,7 +705,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)
{}