summaryrefslogtreecommitdiffstats
path: root/third_party
diff options
context:
space:
mode:
authorchrishtr <chrishtr@chromium.org>2016-02-25 20:24:42 -0800
committerCommit bot <commit-bot@chromium.org>2016-02-26 04:27:00 +0000
commit795c2b4f3b932ff8420f2d33a0e8848cc3952eea (patch)
treed7450850047f6e3593400f373d34f195a04b8d23 /third_party
parentf60cdf229c6ff7c86b67c36f72f8cfada85bd352 (diff)
downloadchromium_src-795c2b4f3b932ff8420f2d33a0e8848cc3952eea.zip
chromium_src-795c2b4f3b932ff8420f2d33a0e8848cc3952eea.tar.gz
chromium_src-795c2b4f3b932ff8420f2d33a0e8848cc3952eea.tar.bz2
Invalidate the new backing of newly unsquashed layers which are also not self-composited.
BUG=587537 Review URL: https://codereview.chromium.org/1737903003 Cr-Commit-Position: refs/heads/master@{#377810}
Diffstat (limited to 'third_party')
-rw-r--r--third_party/WebKit/LayoutTests/compositing/squashing/invalidate-new-backing-of-second-unsquashed-layer-expected.html18
-rw-r--r--third_party/WebKit/LayoutTests/compositing/squashing/invalidate-new-backing-of-second-unsquashed-layer.html37
-rw-r--r--third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp3
-rw-r--r--third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.h2
-rw-r--r--third_party/WebKit/Source/core/layout/compositing/CompositingLayerAssigner.cpp9
-rw-r--r--third_party/WebKit/Source/core/layout/compositing/CompositingLayerAssigner.h2
6 files changed, 64 insertions, 7 deletions
diff --git a/third_party/WebKit/LayoutTests/compositing/squashing/invalidate-new-backing-of-second-unsquashed-layer-expected.html b/third_party/WebKit/LayoutTests/compositing/squashing/invalidate-new-backing-of-second-unsquashed-layer-expected.html
new file mode 100644
index 0000000..f0ee4b84
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/compositing/squashing/invalidate-new-backing-of-second-unsquashed-layer-expected.html
@@ -0,0 +1,18 @@
+<!doctype HTML>
+<div style="height: 16px; position: relative; width: 16px; z-index: 0;">
+ <div style="transform: scale(3); height: 16px; position: relative; width: 16px; z-index: -1; animation: animate .7s infinite">
+ </div>
+ <div id="target" style="position: absolute; transition: transform ease .01s; transform: scale(0); width: 18px; height: 16px"></div>
+ </div>
+</div>
+<div id="squashtarget" style="display: inline-block; height: 16px; position: relative; width: 16px; z-index: 0; margin-top: 20px">
+ <div style=" transform: scale(3); height: 16px; position: relative; width: 16px; z-index: -1"></div>
+</div>
+<div id="squash1" style="display: inline-block; position: relative; width: 16px; z-index: 0; margin-left: 15px">
+ <div style="transform: scale(3); position: relative; width: 16px; z-index: -1">
+ </div>
+</div>
+<div id="squash2" style="overflow: hidden; position: relative;margin-top: 30px; border">
+ I should not disappear!
+</div>
+
diff --git a/third_party/WebKit/LayoutTests/compositing/squashing/invalidate-new-backing-of-second-unsquashed-layer.html b/third_party/WebKit/LayoutTests/compositing/squashing/invalidate-new-backing-of-second-unsquashed-layer.html
new file mode 100644
index 0000000..3b1ee51
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/compositing/squashing/invalidate-new-backing-of-second-unsquashed-layer.html
@@ -0,0 +1,37 @@
+<!doctype HTML>
+<!--
+ This tests a corner case of invalidation of squashed layers. It passes if the element "I should not disappear!" does not disappear.
+
+ The corner case is:
+
+ Frame 1: the elements with ids "squash1" and "squash2" squash into "squashtarget"
+ Frame 2 (on end of transform animation): both elements stop squashing, but there is now an intermediate paint layer that paints
+ after squash1 but before squash2. Since multiple layers can squash together only if they are sequential, squash2 stops squashing,
+ and so we need to invalidate the area in the document squash2 *now* paints into (for frame 3).
+ Frame 3: draw squash1 and squash2 into the root frame.
+
+-->
+<style>
+@keyframes animate{0%{opacity:0}to{opacity:1}}
+</style>
+<div style="height: 16px; position: relative; width: 16px; z-index: 0;">
+ <div style="transform: scale(3); height: 16px; position: relative; width: 16px; z-index: -1; animation: animate .7s infinite">
+ </div>
+ <div id="target" style="position: absolute; transition: transform ease .01s; transform: scale(0); width: 18px; height: 16px"></div>
+ </div>
+</div>
+<div id="squashtarget" style="display: inline-block; height: 16px; position: relative; width: 16px; z-index: 0; margin-top: 20px">
+ <div style=" transform: scale(3); height: 16px; position: relative; width: 16px; z-index: -1"></div>
+</div>
+<div id="squash1" style="display: inline-block; position: relative; width: 16px; z-index: 0; margin-left: 15px">
+ <div style="transform: scale(3); position: relative; width: 16px; z-index: -1">
+ </div>
+</div>
+<div id="squash2" style="overflow: hidden; position: relative;margin-top: 30px; border">
+ I should not disappear!
+</div>
+<script>
+onload = function() {
+ target.style.transform = "scale(1)";
+}
+</script>
diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
index 7652017..eaa3866 100644
--- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
@@ -2498,7 +2498,7 @@ bool CompositedLayerMapping::verifyLayerInSquashingVector(const PaintLayer* laye
}
#endif
-void CompositedLayerMapping::finishAccumulatingSquashingLayers(size_t nextSquashedLayerIndex)
+void CompositedLayerMapping::finishAccumulatingSquashingLayers(size_t nextSquashedLayerIndex, Vector<PaintLayer*>& layersNeedingPaintInvalidation)
{
if (nextSquashedLayerIndex < m_squashedLayers.size()) {
// Any additional squashed Layers in the array no longer belong here, but they might have been
@@ -2507,6 +2507,7 @@ void CompositedLayerMapping::finishAccumulatingSquashingLayers(size_t nextSquash
for (size_t i = nextSquashedLayerIndex; i < m_squashedLayers.size(); ++i) {
if (invalidateLayerIfNoPrecedingEntry(i))
m_squashedLayers[i].paintLayer->setGroupedMapping(nullptr, PaintLayer::DoNotInvalidateLayerAndRemoveFromMapping);
+ layersNeedingPaintInvalidation.append(m_squashedLayers[i].paintLayer);
}
m_squashedLayers.remove(nextSquashedLayerIndex, m_squashedLayers.size() - nextSquashedLayerIndex);
diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.h b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.h
index 30193b8..6c35c33 100644
--- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.h
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.h
@@ -146,7 +146,7 @@ public:
bool verifyLayerInSquashingVector(const PaintLayer*);
#endif
- void finishAccumulatingSquashingLayers(size_t nextSquashedLayerIndex);
+ void finishAccumulatingSquashingLayers(size_t nextSquashedLayerIndex, Vector<PaintLayer*>& layersNeedingPaintInvalidation);
void updateRenderingContext();
void updateShouldFlattenTransform();
void updateElementIdAndCompositorMutableProperties();
diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositingLayerAssigner.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositingLayerAssigner.cpp
index b63a27f..00275e9 100644
--- a/third_party/WebKit/Source/core/layout/compositing/CompositingLayerAssigner.cpp
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositingLayerAssigner.cpp
@@ -56,14 +56,15 @@ void CompositingLayerAssigner::assign(PaintLayer* updateRoot, Vector<PaintLayer*
SquashingState squashingState;
assignLayersToBackingsInternal(updateRoot, squashingState, layersNeedingPaintInvalidation);
if (squashingState.hasMostRecentMapping)
- squashingState.mostRecentMapping->finishAccumulatingSquashingLayers(squashingState.nextSquashedLayerIndex);
+ squashingState.mostRecentMapping->finishAccumulatingSquashingLayers(squashingState.nextSquashedLayerIndex, layersNeedingPaintInvalidation);
}
-void CompositingLayerAssigner::SquashingState::updateSquashingStateForNewMapping(CompositedLayerMapping* newCompositedLayerMapping, bool hasNewCompositedLayerMapping)
+void CompositingLayerAssigner::SquashingState::updateSquashingStateForNewMapping(CompositedLayerMapping* newCompositedLayerMapping, bool hasNewCompositedLayerMapping,
+ Vector<PaintLayer*>& layersNeedingPaintInvalidation)
{
// The most recent backing is done accumulating any more squashing layers.
if (hasMostRecentMapping)
- mostRecentMapping->finishAccumulatingSquashingLayers(nextSquashedLayerIndex);
+ mostRecentMapping->finishAccumulatingSquashingLayers(nextSquashedLayerIndex, layersNeedingPaintInvalidation);
nextSquashedLayerIndex = 0;
boundingRect = IntRect();
@@ -294,7 +295,7 @@ void CompositingLayerAssigner::assignLayersToBackingsInternal(PaintLayer* layer,
// At this point, if the layer is to be separately composited, then its backing becomes the most recent in paint-order.
if (layer->compositingState() == PaintsIntoOwnBacking) {
ASSERT(!requiresSquashing(layer->compositingReasons()));
- squashingState.updateSquashingStateForNewMapping(layer->compositedLayerMapping(), layer->hasCompositedLayerMapping());
+ squashingState.updateSquashingStateForNewMapping(layer->compositedLayerMapping(), layer->hasCompositedLayerMapping(), layersNeedingPaintInvalidation);
}
if (layer->scrollParent())
diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositingLayerAssigner.h b/third_party/WebKit/Source/core/layout/compositing/CompositingLayerAssigner.h
index a064eb2..eea7ee7 100644
--- a/third_party/WebKit/Source/core/layout/compositing/CompositingLayerAssigner.h
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositingLayerAssigner.h
@@ -61,7 +61,7 @@ private:
, nextSquashedLayerIndex(0)
, totalAreaOfSquashedRects(0) { }
- void updateSquashingStateForNewMapping(CompositedLayerMapping*, bool hasNewCompositedPaintLayerMapping);
+ void updateSquashingStateForNewMapping(CompositedLayerMapping*, bool hasNewCompositedPaintLayerMapping, Vector<PaintLayer*>& layersNeedingPaintInvalidation);
// The most recent composited backing that the layer should squash onto if needed.
CompositedLayerMapping* mostRecentMapping;