diff options
author | John Reck <jreck@google.com> | 2012-05-16 11:07:31 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-05-16 11:07:31 -0700 |
commit | f0acbad2f51b0bd62dbc427b4f2fdc97e233edb9 (patch) | |
tree | e61cdf672e06f3fda650698c3644f47eb6167d1a /Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp | |
parent | 9710142abfa1dd8dcedad50cc35b49c9e7c6cc57 (diff) | |
parent | ff7c397b7e18be2ae819c4ffba438b738593ca20 (diff) | |
download | external_webkit-f0acbad2f51b0bd62dbc427b4f2fdc97e233edb9.zip external_webkit-f0acbad2f51b0bd62dbc427b4f2fdc97e233edb9.tar.gz external_webkit-f0acbad2f51b0bd62dbc427b4f2fdc97e233edb9.tar.bz2 |
Merge "Revert "Allow more layers to be merged."" into jb-dev
Diffstat (limited to 'Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp')
-rw-r--r-- | Source/WebCore/platform/graphics/android/layers/LayerAndroid.cpp | 28 |
1 files changed, 17 insertions, 11 deletions
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--; |