summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvollick <vollick@chromium.org>2016-02-24 14:10:42 -0800
committerCommit bot <commit-bot@chromium.org>2016-02-24 22:12:25 +0000
commitbbb70c160f08335db8258fe5319a06a51110f580 (patch)
tree7b2f57ca0b629320c839a9bd9aca5f327aa8020b
parente6dc06532c994f1af6f6f85d4b3ec8412ae47715 (diff)
downloadchromium_src-bbb70c160f08335db8258fe5319a06a51110f580.zip
chromium_src-bbb70c160f08335db8258fe5319a06a51110f580.tar.gz
chromium_src-bbb70c160f08335db8258fe5319a06a51110f580.tar.bz2
Move squash preventing reasons out of compositing reasons
This is a fairly mechanical change. I've replaced all of the squashing-related compositing reasons a with a single reason. I've also added squashing disallowed reasons to capture the information we lost in the melding of compositing reasons. This caused a number of tests to bark, so I've patched them up. I've also ensured that the squashing disallowed reasons are plumbed out through the graphics layer debug info so that they still show up via about:tracing. BUG=589495 Review URL: https://codereview.chromium.org/1730653002 Cr-Commit-Position: refs/heads/master@{#377398}
-rw-r--r--third_party/WebKit/LayoutTests/compositing/squashing/dont-squash-into-animated-layers.html30
-rw-r--r--third_party/WebKit/LayoutTests/compositing/squashing/dont-squash-into-blend-mode.html7
-rw-r--r--third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp6
-rw-r--r--third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.h2
-rw-r--r--third_party/WebKit/Source/core/layout/compositing/CompositingLayerAssigner.cpp42
-rw-r--r--third_party/WebKit/Source/core/layout/compositing/CompositingLayerAssigner.h3
-rw-r--r--third_party/WebKit/Source/core/paint/PaintLayer.cpp10
-rw-r--r--third_party/WebKit/Source/core/paint/PaintLayer.h8
-rw-r--r--third_party/WebKit/Source/platform/blink_platform.gypi22
-rw-r--r--third_party/WebKit/Source/platform/graphics/CompositingReasons.cpp48
-rw-r--r--third_party/WebKit/Source/platform/graphics/CompositingReasons.h96
-rw-r--r--third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp12
-rw-r--r--third_party/WebKit/Source/platform/graphics/GraphicsLayer.h1
-rw-r--r--third_party/WebKit/Source/platform/graphics/GraphicsLayerDebugInfo.cpp13
-rw-r--r--third_party/WebKit/Source/platform/graphics/GraphicsLayerDebugInfo.h6
-rw-r--r--third_party/WebKit/Source/platform/graphics/SquashingDisallowedReasons.cpp61
-rw-r--r--third_party/WebKit/Source/platform/graphics/SquashingDisallowedReasons.h46
17 files changed, 259 insertions, 154 deletions
diff --git a/third_party/WebKit/LayoutTests/compositing/squashing/dont-squash-into-animated-layers.html b/third_party/WebKit/LayoutTests/compositing/squashing/dont-squash-into-animated-layers.html
index 7b2c5d5..006e4ed 100644
--- a/third_party/WebKit/LayoutTests/compositing/squashing/dont-squash-into-animated-layers.html
+++ b/third_party/WebKit/LayoutTests/compositing/squashing/dont-squash-into-animated-layers.html
@@ -1,21 +1,31 @@
<!doctype HTML>
Any errors will show below this line.
-<div id="target" style="position: absolute; width: 200px; height: 200px; will-change: transform; transition: transform 0.1s cubic-bezier(0.23, 1, 0.32, 1); background: lightblue"></div>
+<style>
+@keyframes twiddle {
+ 0% { transform: rotate(0deg); }
+ 100% { transform: rotate(180deg); }
+}
+
+.animated {
+ animation: twiddle 3s alternate infinite linear;
+ width: 100px;
+ height: 100px;
+ background: orange;
+}
+</style>
+<div id="target" class="animated" style="position: absolute; width: 200px; height: 200px; background: lightblue"></div>
<div style="position: absolute; width: 200px; height: 200px; top: 100px; left: 100px; background: lightgray"></div>
<script src="../../resources/testharness.js"></script>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
- testRunner.waitUntilDone();
}
onload = function() {
target.style.transform = "translateX(10px)";
- requestAnimationFrame(function() {
- if (window.internals) {
- var layers = JSON.parse(internals.layerTreeAsText(document, 1));
- assert_true(layers.children[0].children[1].compositingReasons[1] == "Cannot squash into a layer that is animating.");
- }
- testRunner.notifyDone();
- });
+ if (window.internals) {
+ var layers = JSON.parse(internals.layerTreeAsText(document, 1));
+ assert_true(layers.children[0].children[1].compositingReasons[1] == "Layer was separately composited because it could not be squashed.");
+ assert_true(layers.children[0].children[1].squashingDisallowedReasons[0] == "Cannot squash into a layer that is animating.");
+ }
};
-</script> \ No newline at end of file
+</script>
diff --git a/third_party/WebKit/LayoutTests/compositing/squashing/dont-squash-into-blend-mode.html b/third_party/WebKit/LayoutTests/compositing/squashing/dont-squash-into-blend-mode.html
index 1365ce3..27bfd32 100644
--- a/third_party/WebKit/LayoutTests/compositing/squashing/dont-squash-into-blend-mode.html
+++ b/third_party/WebKit/LayoutTests/compositing/squashing/dont-squash-into-blend-mode.html
@@ -8,8 +8,9 @@ if (window.testRunner)
testRunner.dumpAsText();
onload = function() {
if (window.internals) {
- var layers = JSON.parse(internals.layerTreeAsText(document, 1));
- assert_true(layers.children[0].children[0].children[1].compositingReasons[1] == "Squashing a layer with blending is not supported.");
+ var layers = JSON.parse(internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_DEBUG_INFO));
+ assert_true(layers.children[0].children[0].children[1].compositingReasons[1] == "Layer was separately composited because it could not be squashed.");
+ assert_true(layers.children[0].children[0].children[1].squashingDisallowedReasons[0] == "Squashing a layer with blending is not supported.");
}
};
-</script> \ No newline at end of file
+</script>
diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
index 3cacebf..793cda4 100644
--- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
@@ -209,7 +209,7 @@ CompositedLayerMapping::~CompositedLayerMapping()
destroyGraphicsLayers();
}
-PassOwnPtr<GraphicsLayer> CompositedLayerMapping::createGraphicsLayer(CompositingReasons reasons)
+PassOwnPtr<GraphicsLayer> CompositedLayerMapping::createGraphicsLayer(CompositingReasons reasons, SquashingDisallowedReasons squashingDisallowedReasons)
{
GraphicsLayerFactory* graphicsLayerFactory = nullptr;
if (Page* page = layoutObject()->frame()->page())
@@ -218,6 +218,7 @@ PassOwnPtr<GraphicsLayer> CompositedLayerMapping::createGraphicsLayer(Compositin
OwnPtr<GraphicsLayer> graphicsLayer = GraphicsLayer::create(graphicsLayerFactory, this);
graphicsLayer->setCompositingReasons(reasons);
+ graphicsLayer->setSquashingDisallowedReasons(squashingDisallowedReasons);
if (Node* owningNode = m_owningLayer.layoutObject()->generatingNode())
graphicsLayer->setOwnerNodeId(DOMNodeIds::idForNode(owningNode));
@@ -226,7 +227,7 @@ PassOwnPtr<GraphicsLayer> CompositedLayerMapping::createGraphicsLayer(Compositin
void CompositedLayerMapping::createPrimaryGraphicsLayer()
{
- m_graphicsLayer = createGraphicsLayer(m_owningLayer.compositingReasons());
+ m_graphicsLayer = createGraphicsLayer(m_owningLayer.compositingReasons(), m_owningLayer.squashingDisallowedReasons());
updateOpacity(layoutObject()->styleRef());
updateTransform(layoutObject()->styleRef());
@@ -346,6 +347,7 @@ void CompositedLayerMapping::updateCompositingReasons()
// All other layers owned by this mapping will have the same compositing reason
// for their lifetime, so they are initialized only when created.
m_graphicsLayer->setCompositingReasons(m_owningLayer.compositingReasons());
+ m_graphicsLayer->setSquashingDisallowedReasons(m_owningLayer.squashingDisallowedReasons());
}
bool CompositedLayerMapping::owningLayerClippedByLayerNotAboveCompositedAncestor(const PaintLayer* scrollParent)
diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.h b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.h
index c0f063a..30193b8 100644
--- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.h
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.h
@@ -240,7 +240,7 @@ private:
void createPrimaryGraphicsLayer();
void destroyGraphicsLayers();
- PassOwnPtr<GraphicsLayer> createGraphicsLayer(CompositingReasons);
+ PassOwnPtr<GraphicsLayer> createGraphicsLayer(CompositingReasons, SquashingDisallowedReasons = SquashingDisallowedReasonsNone);
bool toggleScrollbarLayerIfNeeded(OwnPtr<GraphicsLayer>&, bool needsLayer, CompositingReasons);
LayoutBoxModelObject* layoutObject() const { return m_owningLayer.layoutObject(); }
diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositingLayerAssigner.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositingLayerAssigner.cpp
index 873ec4b..3bee691 100644
--- a/third_party/WebKit/Source/core/layout/compositing/CompositingLayerAssigner.cpp
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositingLayerAssigner.cpp
@@ -112,10 +112,10 @@ CompositingStateTransitionType CompositingLayerAssigner::computeCompositedLayerU
return update;
}
-CompositingReasons CompositingLayerAssigner::getReasonsPreventingSquashing(const PaintLayer* layer, const CompositingLayerAssigner::SquashingState& squashingState)
+SquashingDisallowedReasons CompositingLayerAssigner::getReasonsPreventingSquashing(const PaintLayer* layer, const CompositingLayerAssigner::SquashingState& squashingState)
{
if (!squashingState.haveAssignedBackingsToEntireSquashingLayerSubtree)
- return CompositingReasonSquashingWouldBreakPaintOrder;
+ return SquashingDisallowedReasonWouldBreakPaintOrder;
ASSERT(squashingState.hasMostRecentMapping);
const PaintLayer& squashingLayer = squashingState.mostRecentMapping->owningLayer();
@@ -128,55 +128,55 @@ CompositingReasons CompositingLayerAssigner::getReasonsPreventingSquashing(const
//
// compositing/video/video-controls-layer-creation.html
if (layer->layoutObject()->isVideo() || squashingLayer.layoutObject()->isVideo())
- return CompositingReasonSquashingVideoIsDisallowed;
+ return SquashingDisallowedReasonSquashingVideoIsDisallowed;
// Don't squash iframes, frames or plugins.
// FIXME: this is only necessary because there is frame code that assumes that composited frames are not squashed.
if (layer->layoutObject()->isLayoutPart() || squashingLayer.layoutObject()->isLayoutPart())
- return CompositingReasonSquashingLayoutPartIsDisallowed;
+ return SquashingDisallowedReasonSquashingLayoutPartIsDisallowed;
if (layer->reflectionInfo())
- return CompositingReasonSquashingReflectionIsDisallowed;
+ return SquashingDisallowedReasonSquashingReflectionIsDisallowed;
if (squashingWouldExceedSparsityTolerance(layer, squashingState))
- return CompositingReasonSquashingSparsityExceeded;
+ return SquashingDisallowedReasonSquashingSparsityExceeded;
if (layer->layoutObject()->style()->hasBlendMode() || squashingLayer.layoutObject()->style()->hasBlendMode())
- return CompositingReasonSquashingBlendingIsDisallowed;
+ return SquashingDisallowedReasonSquashingBlendingIsDisallowed;
// FIXME: this is not efficient, since it walks up the tree. We should store these values on the CompositingInputsCache.
if (layer->clippingContainer() != squashingLayer.clippingContainer() && !squashingLayer.compositedLayerMapping()->containingSquashedLayer(layer->clippingContainer(), squashingState.nextSquashedLayerIndex))
- return CompositingReasonSquashingClippingContainerMismatch;
+ return SquashingDisallowedReasonClippingContainerMismatch;
// Composited descendants need to be clipped by a child containment graphics layer, which would not be available if the layer is
// squashed (and therefore has no CLM nor a child containment graphics layer).
if (m_compositor->clipsCompositingDescendants(layer))
- return CompositingReasonSquashedLayerClipsCompositingDescendants;
+ return SquashingDisallowedReasonSquashedLayerClipsCompositingDescendants;
if (layer->scrollsWithRespectTo(&squashingLayer))
- return CompositingReasonScrollsWithRespectToSquashingLayer;
+ return SquashingDisallowedReasonScrollsWithRespectToSquashingLayer;
if (layer->scrollParent() && layer->hasCompositingDescendant())
- return CompositingReasonScrollChildWithCompositedDescendants;
+ return SquashingDisallowedReasonScrollChildWithCompositedDescendants;
if (layer->opacityAncestor() != squashingLayer.opacityAncestor())
- return CompositingReasonSquashingOpacityAncestorMismatch;
+ return SquashingDisallowedReasonOpacityAncestorMismatch;
if (layer->transformAncestor() != squashingLayer.transformAncestor())
- return CompositingReasonSquashingTransformAncestorMismatch;
+ return SquashingDisallowedReasonTransformAncestorMismatch;
if (layer->hasFilter() || layer->filterAncestor() != squashingLayer.filterAncestor())
- return CompositingReasonSquashingFilterMismatch;
+ return SquashingDisallowedReasonFilterMismatch;
if (layer->nearestFixedPositionLayer() != squashingLayer.nearestFixedPositionLayer())
- return CompositingReasonSquashingNearestFixedPositionMismatch;
+ return SquashingDisallowedReasonNearestFixedPositionMismatch;
ASSERT(layer->layoutObject()->style()->position() != FixedPosition);
if ((squashingLayer.layoutObject()->style()->subtreeWillChangeContents() && squashingLayer.layoutObject()->style()->isRunningAnimationOnCompositor())
|| squashingLayer.layoutObject()->style()->shouldCompositeForCurrentAnimations())
- return CompositingReasonSquashingLayerIsAnimating;
+ return SquashingDisallowedReasonSquashingLayerIsAnimating;
- return CompositingReasonNone;
+ return SquashingDisallowedReasonsNone;
}
void CompositingLayerAssigner::updateSquashingAssignment(PaintLayer* layer, SquashingState& squashingState, const CompositingStateTransitionType compositedLayerUpdate,
@@ -248,9 +248,11 @@ static ScrollingCoordinator* scrollingCoordinatorFromLayer(PaintLayer& layer)
void CompositingLayerAssigner::assignLayersToBackingsInternal(PaintLayer* layer, SquashingState& squashingState, Vector<PaintLayer*>& layersNeedingPaintInvalidation)
{
if (requiresSquashing(layer->compositingReasons())) {
- CompositingReasons reasonsPreventingSquashing = getReasonsPreventingSquashing(layer, squashingState);
- if (reasonsPreventingSquashing)
- layer->setCompositingReasons(layer->compositingReasons() | reasonsPreventingSquashing);
+ SquashingDisallowedReasons reasonsPreventingSquashing = getReasonsPreventingSquashing(layer, squashingState);
+ if (reasonsPreventingSquashing) {
+ layer->setCompositingReasons(layer->compositingReasons() | CompositingReasonSquashingDisallowed);
+ layer->setSquashingDisallowedReasons(reasonsPreventingSquashing);
+ }
}
CompositingStateTransitionType compositedLayerUpdate = computeCompositedLayerUpdate(layer);
diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositingLayerAssigner.h b/third_party/WebKit/Source/core/layout/compositing/CompositingLayerAssigner.h
index 58eae24..a064eb2 100644
--- a/third_party/WebKit/Source/core/layout/compositing/CompositingLayerAssigner.h
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositingLayerAssigner.h
@@ -30,6 +30,7 @@
#include "core/layout/compositing/PaintLayerCompositor.h"
#include "platform/geometry/IntRect.h"
#include "platform/geometry/LayoutPoint.h"
+#include "platform/graphics/SquashingDisallowedReasons.h"
#include "wtf/Allocator.h"
namespace blink {
@@ -84,7 +85,7 @@ private:
void assignLayersToBackingsInternal(PaintLayer*, SquashingState&, Vector<PaintLayer*>& layersNeedingPaintInvalidation);
void assignLayersToBackingsForReflectionLayer(PaintLayer* reflectionLayer, Vector<PaintLayer*>& layersNeedingPaintInvalidation);
- CompositingReasons getReasonsPreventingSquashing(const PaintLayer*, const SquashingState&);
+ SquashingDisallowedReasons getReasonsPreventingSquashing(const PaintLayer*, const SquashingState&);
bool squashingWouldExceedSparsityTolerance(const PaintLayer* candidate, const SquashingState&);
void updateSquashingAssignment(PaintLayer*, SquashingState&, CompositingStateTransitionType, Vector<PaintLayer*>& layersNeedingPaintInvalidation);
bool needsOwnBacking(const PaintLayer*) const;
diff --git a/third_party/WebKit/Source/core/paint/PaintLayer.cpp b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
index 439349d..6c78b42 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayer.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
@@ -124,6 +124,7 @@ PaintLayerRareData::PaintLayerRareData()
: enclosingPaginationLayer(nullptr)
, potentialCompositingReasonsFromStyle(CompositingReasonNone)
, compositingReasons(CompositingReasonNone)
+ , squashingDisallowedReasons(SquashingDisallowedReasonsNone)
, groupedMapping(nullptr)
{
}
@@ -1032,6 +1033,15 @@ void PaintLayer::setCompositingReasons(CompositingReasons reasons, CompositingRe
ensureRareData().compositingReasons = newReasons;
}
+void PaintLayer::setSquashingDisallowedReasons(SquashingDisallowedReasons reasons)
+{
+ SquashingDisallowedReasons oldReasons = m_rareData ? m_rareData->squashingDisallowedReasons : SquashingDisallowedReasonsNone;
+ if (oldReasons == reasons)
+ return;
+ if (m_rareData || reasons != SquashingDisallowedReasonsNone)
+ ensureRareData().squashingDisallowedReasons = reasons;
+}
+
void PaintLayer::setHasCompositingDescendant(bool hasCompositingDescendant)
{
if (m_hasCompositingDescendant == static_cast<unsigned>(hasCompositingDescendant))
diff --git a/third_party/WebKit/Source/core/paint/PaintLayer.h b/third_party/WebKit/Source/core/paint/PaintLayer.h
index 3932a00..473f458 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayer.h
+++ b/third_party/WebKit/Source/core/paint/PaintLayer.h
@@ -57,6 +57,7 @@
#include "core/paint/PaintLayerStackingNode.h"
#include "core/paint/PaintLayerStackingNodeIterator.h"
#include "platform/graphics/CompositingReasons.h"
+#include "platform/graphics/SquashingDisallowedReasons.h"
#include "public/platform/WebBlendMode.h"
#include "wtf/Allocator.h"
#include "wtf/OwnPtr.h"
@@ -117,6 +118,10 @@ struct PaintLayerRareData {
// Once computed, indicates all that a layer needs to become composited using the CompositingReasons enum bitfield.
CompositingReasons compositingReasons;
+ // This captures reasons why a paint layer might be forced to be separately
+ // composited rather than sharing a backing with another layer.
+ SquashingDisallowedReasons squashingDisallowedReasons;
+
// If the layer paints into its own backings, this keeps track of the backings.
// It's nullptr if the layer is not composited or paints into grouped backing.
OwnPtr<CompositedLayerMapping> compositedLayerMapping;
@@ -590,6 +595,9 @@ public:
CompositingReasons compositingReasons() const { ASSERT(isAllowedToQueryCompositingState()); return m_rareData ? m_rareData->compositingReasons : CompositingReasonNone; }
void setCompositingReasons(CompositingReasons, CompositingReasons mask = CompositingReasonAll);
+ SquashingDisallowedReasons squashingDisallowedReasons() const { ASSERT(isAllowedToQueryCompositingState()); return m_rareData ? m_rareData->squashingDisallowedReasons : SquashingDisallowedReasonsNone; }
+ void setSquashingDisallowedReasons(SquashingDisallowedReasons);
+
bool hasCompositingDescendant() const { ASSERT(isAllowedToQueryCompositingState()); return m_hasCompositingDescendant; }
void setHasCompositingDescendant(bool);
diff --git a/third_party/WebKit/Source/platform/blink_platform.gypi b/third_party/WebKit/Source/platform/blink_platform.gypi
index 53b385d..35a2a63 100644
--- a/third_party/WebKit/Source/platform/blink_platform.gypi
+++ b/third_party/WebKit/Source/platform/blink_platform.gypi
@@ -157,29 +157,29 @@
'animation/UnitBezier.h',
'animation/CompositorAnimation.cpp',
'animation/CompositorAnimation.h',
- 'animation/CompositorAnimationCurve.cpp',
- 'animation/CompositorAnimationCurve.h',
+ 'animation/CompositorAnimationCurve.cpp',
+ 'animation/CompositorAnimationCurve.h',
'animation/CompositorAnimationPlayer.cpp',
'animation/CompositorAnimationPlayer.h',
'animation/CompositorAnimationPlayerClient.cpp',
'animation/CompositorAnimationPlayerClient.h',
- 'animation/CompositorAnimationTimeline.cpp',
- 'animation/CompositorAnimationTimeline.h',
+ 'animation/CompositorAnimationTimeline.cpp',
+ 'animation/CompositorAnimationTimeline.h',
'animation/CompositorFilterAnimationCurve.cpp',
'animation/CompositorFilterAnimationCurve.h',
'animation/CompositorFilterKeyframe.cpp',
- 'animation/CompositorFilterKeyframe.h',
+ 'animation/CompositorFilterKeyframe.h',
'animation/CompositorFloatAnimationCurve.cpp',
'animation/CompositorFloatAnimationCurve.h',
'animation/CompositorFloatKeyframe.h',
- 'animation/CompositorScrollOffsetAnimationCurve.cpp',
- 'animation/CompositorScrollOffsetAnimationCurve.h',
+ 'animation/CompositorScrollOffsetAnimationCurve.cpp',
+ 'animation/CompositorScrollOffsetAnimationCurve.h',
'animation/CompositorTransformAnimationCurve.cpp',
'animation/CompositorTransformAnimationCurve.h',
'animation/CompositorTransformKeyframe.cpp',
'animation/CompositorTransformKeyframe.h',
- 'animation/CompositorTransformOperations.cpp',
- 'animation/CompositorTransformOperations.h',
+ 'animation/CompositorTransformOperations.cpp',
+ 'animation/CompositorTransformOperations.h',
'audio/AudioArray.h',
'audio/AudioBus.cpp',
'audio/AudioBus.h',
@@ -560,7 +560,7 @@
'graphics/CompositingReasons.cpp',
'graphics/CompositingReasons.h',
'graphics/CompositorFactory.cpp',
- 'graphics/CompositorFactory.h',
+ 'graphics/CompositorFactory.h',
'graphics/CompositorFilterOperations.cpp',
'graphics/CompositorFilterOperations.h',
'graphics/CompositorMutableState.cpp',
@@ -647,6 +647,8 @@
'graphics/RecordingImageBufferSurface.h',
'graphics/ReplayingCanvas.cpp',
'graphics/ReplayingCanvas.h',
+ 'graphics/SquashingDisallowedReasons.cpp',
+ 'graphics/SquashingDisallowedReasons.h',
'graphics/StaticBitmapImage.cpp',
'graphics/StaticBitmapImage.h',
'graphics/StrokeData.cpp',
diff --git a/third_party/WebKit/Source/platform/graphics/CompositingReasons.cpp b/third_party/WebKit/Source/platform/graphics/CompositingReasons.cpp
index a096b70..5608532 100644
--- a/third_party/WebKit/Source/platform/graphics/CompositingReasons.cpp
+++ b/third_party/WebKit/Source/platform/graphics/CompositingReasons.cpp
@@ -69,51 +69,9 @@ const CompositingReasonStringMap kCompositingReasonStringMap[] = {
{ CompositingReasonNegativeZIndexChildren,
"negativeZIndexChildren",
"Parent with composited negative z-index content" },
- { CompositingReasonScrollsWithRespectToSquashingLayer,
- "scrollsWithRespectToSquashingLayer",
- "Cannot be squashed since this layer scrolls with respect to the squashing layer" },
- { CompositingReasonSquashingSparsityExceeded,
- "squashingSparsityExceeded",
- "Cannot be squashed as the squashing layer would become too sparse" },
- { CompositingReasonSquashingClippingContainerMismatch,
- "squashingClippingContainerMismatch",
- "Cannot be squashed because this layer has a different clipping container than the squashing layer" },
- { CompositingReasonSquashingOpacityAncestorMismatch,
- "squashingOpacityAncestorMismatch",
- "Cannot be squashed because this layer has a different opacity ancestor than the squashing layer" },
- { CompositingReasonSquashingTransformAncestorMismatch,
- "squashingTransformAncestorMismatch",
- "Cannot be squashed because this layer has a different transform ancestor than the squashing layer" },
- { CompositingReasonSquashingFilterMismatch,
- "squashingFilterAncestorMismatch",
- "Cannot be squashed because this layer has a different filter ancestor than the squashing layer, or this layer has a filter" },
- { CompositingReasonSquashingWouldBreakPaintOrder,
- "squashingWouldBreakPaintOrder",
- "Cannot be squashed without breaking paint order" },
- { CompositingReasonSquashingVideoIsDisallowed,
- "squashingVideoIsDisallowed",
- "Squashing video is not supported" },
- { CompositingReasonSquashedLayerClipsCompositingDescendants,
- "squashedLayerClipsCompositingDescendants",
- "Squashing a layer that clips composited descendants is not supported." },
- { CompositingReasonSquashingLayoutPartIsDisallowed,
- "squashingLayoutPartIsDisallowed",
- "Squashing a frame, iframe or plugin is not supported." },
- { CompositingReasonSquashingReflectionIsDisallowed,
- "squashingReflectionDisallowed",
- "Squashing a element with a reflection is not supported." },
- { CompositingReasonSquashingBlendingIsDisallowed,
- "squashingBlendingDisallowed",
- "Squashing a layer with blending is not supported." },
- { CompositingReasonSquashingNearestFixedPositionMismatch,
- "squashingNearestFixedPositionMismatch",
- "Cannot be squashed because this layer has a different nearest fixed position layer than the squashing layer" },
- { CompositingReasonScrollChildWithCompositedDescendants,
- "scrollChildWithCompositedDescendants",
- "Squashing a scroll child with composited descendants is not supported." },
- { CompositingReasonSquashingLayerIsAnimating,
- "squashingLayerIsAnimating",
- "Cannot squash into a layer that is animating." },
+ { CompositingReasonSquashingDisallowed,
+ "squashingDisallowed",
+ "Layer was separately composited because it could not be squashed." },
{ CompositingReasonTransformWithCompositedDescendants,
"transformWithCompositedDescendants",
"Has a transform that needs to be known by compositor because of composited descendants" },
diff --git a/third_party/WebKit/Source/platform/graphics/CompositingReasons.h b/third_party/WebKit/Source/platform/graphics/CompositingReasons.h
index 542694a..82cccab 100644
--- a/third_party/WebKit/Source/platform/graphics/CompositingReasons.h
+++ b/third_party/WebKit/Source/platform/graphics/CompositingReasons.h
@@ -36,63 +36,49 @@ const uint64_t CompositingReasonBackdropFilter = UINT6
const uint64_t CompositingReasonAssumedOverlap = UINT64_C(1) << 15;
const uint64_t CompositingReasonOverlap = UINT64_C(1) << 16;
const uint64_t CompositingReasonNegativeZIndexChildren = UINT64_C(1) << 17;
-const uint64_t CompositingReasonScrollsWithRespectToSquashingLayer = UINT64_C(1) << 18;
-const uint64_t CompositingReasonSquashingSparsityExceeded = UINT64_C(1) << 19;
-const uint64_t CompositingReasonSquashingClippingContainerMismatch = UINT64_C(1) << 20;
-const uint64_t CompositingReasonSquashingOpacityAncestorMismatch = UINT64_C(1) << 21;
-const uint64_t CompositingReasonSquashingTransformAncestorMismatch = UINT64_C(1) << 22;
-const uint64_t CompositingReasonSquashingFilterMismatch = UINT64_C(1) << 23;
-const uint64_t CompositingReasonSquashingWouldBreakPaintOrder = UINT64_C(1) << 24;
-const uint64_t CompositingReasonSquashingVideoIsDisallowed = UINT64_C(1) << 25;
-const uint64_t CompositingReasonSquashedLayerClipsCompositingDescendants = UINT64_C(1) << 26;
-const uint64_t CompositingReasonSquashingLayoutPartIsDisallowed = UINT64_C(1) << 27;
-const uint64_t CompositingReasonSquashingReflectionIsDisallowed = UINT64_C(1) << 28;
-const uint64_t CompositingReasonSquashingBlendingIsDisallowed = UINT64_C(1) << 29;
-const uint64_t CompositingReasonSquashingNearestFixedPositionMismatch = UINT64_C(1) << 30;
-const uint64_t CompositingReasonScrollChildWithCompositedDescendants = UINT64_C(1) << 31;
-const uint64_t CompositingReasonSquashingLayerIsAnimating = UINT64_C(1) << 32;
+const uint64_t CompositingReasonSquashingDisallowed = UINT64_C(1) << 18;
// Subtree reasons that require knowing what the status of your subtree is before knowing the answer
-const uint64_t CompositingReasonTransformWithCompositedDescendants = UINT64_C(1) << 33;
-const uint64_t CompositingReasonOpacityWithCompositedDescendants = UINT64_C(1) << 34;
-const uint64_t CompositingReasonMaskWithCompositedDescendants = UINT64_C(1) << 35;
-const uint64_t CompositingReasonReflectionWithCompositedDescendants = UINT64_C(1) << 36;
-const uint64_t CompositingReasonFilterWithCompositedDescendants = UINT64_C(1) << 37;
-const uint64_t CompositingReasonBlendingWithCompositedDescendants = UINT64_C(1) << 38;
-const uint64_t CompositingReasonClipsCompositingDescendants = UINT64_C(1) << 39;
-const uint64_t CompositingReasonPerspectiveWith3DDescendants = UINT64_C(1) << 40;
-const uint64_t CompositingReasonPreserve3DWith3DDescendants = UINT64_C(1) << 41;
-const uint64_t CompositingReasonReflectionOfCompositedParent = UINT64_C(1) << 42;
-const uint64_t CompositingReasonIsolateCompositedDescendants = UINT64_C(1) << 43;
-const uint64_t CompositingReasonPositionFixedWithCompositedDescendants = UINT64_C(1) << 44;
+const uint64_t CompositingReasonTransformWithCompositedDescendants = UINT64_C(1) << 19;
+const uint64_t CompositingReasonOpacityWithCompositedDescendants = UINT64_C(1) << 20;
+const uint64_t CompositingReasonMaskWithCompositedDescendants = UINT64_C(1) << 21;
+const uint64_t CompositingReasonReflectionWithCompositedDescendants = UINT64_C(1) << 22;
+const uint64_t CompositingReasonFilterWithCompositedDescendants = UINT64_C(1) << 23;
+const uint64_t CompositingReasonBlendingWithCompositedDescendants = UINT64_C(1) << 24;
+const uint64_t CompositingReasonClipsCompositingDescendants = UINT64_C(1) << 25;
+const uint64_t CompositingReasonPerspectiveWith3DDescendants = UINT64_C(1) << 26;
+const uint64_t CompositingReasonPreserve3DWith3DDescendants = UINT64_C(1) << 27;
+const uint64_t CompositingReasonReflectionOfCompositedParent = UINT64_C(1) << 28;
+const uint64_t CompositingReasonIsolateCompositedDescendants = UINT64_C(1) << 29;
+const uint64_t CompositingReasonPositionFixedWithCompositedDescendants = UINT64_C(1) << 30;
// The root layer is a special case that may be forced to be a layer, but also it needs to be
// a layer if anything else in the subtree is composited.
-const uint64_t CompositingReasonRoot = UINT64_C(1) << 45;
+const uint64_t CompositingReasonRoot = UINT64_C(1) << 31;
// CompositedLayerMapping internal hierarchy reasons
-const uint64_t CompositingReasonLayerForAncestorClip = UINT64_C(1) << 46;
-const uint64_t CompositingReasonLayerForDescendantClip = UINT64_C(1) << 47;
-const uint64_t CompositingReasonLayerForPerspective = UINT64_C(1) << 48;
-const uint64_t CompositingReasonLayerForHorizontalScrollbar = UINT64_C(1) << 49;
-const uint64_t CompositingReasonLayerForVerticalScrollbar = UINT64_C(1) << 50;
-const uint64_t CompositingReasonLayerForOverflowControlsHost = UINT64_C(1) << 51;
-const uint64_t CompositingReasonLayerForScrollCorner = UINT64_C(1) << 52;
-const uint64_t CompositingReasonLayerForScrollingContents = UINT64_C(1) << 53;
-const uint64_t CompositingReasonLayerForScrollingContainer = UINT64_C(1) << 54;
-const uint64_t CompositingReasonLayerForSquashingContents = UINT64_C(1) << 55;
-const uint64_t CompositingReasonLayerForSquashingContainer = UINT64_C(1) << 56;
-const uint64_t CompositingReasonLayerForForeground = UINT64_C(1) << 57;
-const uint64_t CompositingReasonLayerForBackground = UINT64_C(1) << 58;
-const uint64_t CompositingReasonLayerForMask = UINT64_C(1) << 59;
-const uint64_t CompositingReasonLayerForClippingMask = UINT64_C(1) << 60;
-const uint64_t CompositingReasonLayerForScrollingBlockSelection = UINT64_C(1) << 61;
+const uint64_t CompositingReasonLayerForAncestorClip = UINT64_C(1) << 32;
+const uint64_t CompositingReasonLayerForDescendantClip = UINT64_C(1) << 33;
+const uint64_t CompositingReasonLayerForPerspective = UINT64_C(1) << 34;
+const uint64_t CompositingReasonLayerForHorizontalScrollbar = UINT64_C(1) << 35;
+const uint64_t CompositingReasonLayerForVerticalScrollbar = UINT64_C(1) << 36;
+const uint64_t CompositingReasonLayerForOverflowControlsHost = UINT64_C(1) << 37;
+const uint64_t CompositingReasonLayerForScrollCorner = UINT64_C(1) << 38;
+const uint64_t CompositingReasonLayerForScrollingContents = UINT64_C(1) << 39;
+const uint64_t CompositingReasonLayerForScrollingContainer = UINT64_C(1) << 40;
+const uint64_t CompositingReasonLayerForSquashingContents = UINT64_C(1) << 41;
+const uint64_t CompositingReasonLayerForSquashingContainer = UINT64_C(1) << 42;
+const uint64_t CompositingReasonLayerForForeground = UINT64_C(1) << 43;
+const uint64_t CompositingReasonLayerForBackground = UINT64_C(1) << 44;
+const uint64_t CompositingReasonLayerForMask = UINT64_C(1) << 45;
+const uint64_t CompositingReasonLayerForClippingMask = UINT64_C(1) << 46;
+const uint64_t CompositingReasonLayerForScrollingBlockSelection = UINT64_C(1) << 47;
// Composited elements with inline transforms trigger assumed overlap so that
// we can update their transforms quickly.
-const uint64_t CompositingReasonInlineTransform = UINT64_C(1) << 62;
+const uint64_t CompositingReasonInlineTransform = UINT64_C(1) << 48;
-const uint64_t CompositingReasonCompositorProxy = UINT64_C(1) << 63;
+const uint64_t CompositingReasonCompositorProxy = UINT64_C(1) << 49;
// Various combinations of compositing reasons are defined here also, for more intutive and faster bitwise logic.
const uint64_t CompositingReasonComboAllDirectReasons =
@@ -148,18 +134,7 @@ const uint64_t CompositingReasonComboReasonsThatRequireOwnBacking =
| CompositingReasonOverlap
| CompositingReasonAssumedOverlap
| CompositingReasonNegativeZIndexChildren
- | CompositingReasonScrollsWithRespectToSquashingLayer
- | CompositingReasonSquashingSparsityExceeded
- | CompositingReasonSquashingClippingContainerMismatch
- | CompositingReasonSquashingOpacityAncestorMismatch
- | CompositingReasonSquashingTransformAncestorMismatch
- | CompositingReasonSquashingFilterMismatch
- | CompositingReasonSquashingWouldBreakPaintOrder
- | CompositingReasonSquashingVideoIsDisallowed
- | CompositingReasonSquashedLayerClipsCompositingDescendants
- | CompositingReasonSquashingLayoutPartIsDisallowed
- | CompositingReasonSquashingReflectionIsDisallowed
- | CompositingReasonSquashingBlendingIsDisallowed
+ | CompositingReasonSquashingDisallowed
| CompositingReasonTransformWithCompositedDescendants
| CompositingReasonOpacityWithCompositedDescendants
| CompositingReasonMaskWithCompositedDescendants
@@ -167,11 +142,8 @@ const uint64_t CompositingReasonComboReasonsThatRequireOwnBacking =
| CompositingReasonBlendingWithCompositedDescendants
| CompositingReasonIsolateCompositedDescendants
| CompositingReasonPreserve3DWith3DDescendants // preserve-3d has to create backing store to ensure that 3d-transformed elements intersect.
- | CompositingReasonSquashingNearestFixedPositionMismatch
- | CompositingReasonScrollChildWithCompositedDescendants
| CompositingReasonBackdropFilter
- | CompositingReasonPositionFixedWithCompositedDescendants
- | CompositingReasonSquashingLayerIsAnimating;
+ | CompositingReasonPositionFixedWithCompositedDescendants;
const uint64_t CompositingReasonComboSquashableReasons =
CompositingReasonOverlap
diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
index 89f0c8e..40ff0f1 100644
--- a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
+++ b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
@@ -783,6 +783,13 @@ PassRefPtr<JSONObject> GraphicsLayer::layerTreeAsJSON(LayerTreeFlags flags, Rend
compositingReasonsJSON->pushString(debug ? kCompositingReasonStringMap[i].description : kCompositingReasonStringMap[i].shortName);
}
json->setArray("compositingReasons", compositingReasonsJSON);
+
+ RefPtr<JSONArray> squashingDisallowedReasonsJSON = adoptRef(new JSONArray);
+ for (size_t i = 0; i < kNumberOfSquashingDisallowedReasons; ++i) {
+ if (m_debugInfo.squashingDisallowedReasons() & kSquashingDisallowedReasonStringMap[i].reason)
+ squashingDisallowedReasonsJSON->pushString(debug ? kSquashingDisallowedReasonStringMap[i].description : kSquashingDisallowedReasonStringMap[i].shortName);
+ }
+ json->setArray("squashingDisallowedReasons", squashingDisallowedReasonsJSON);
}
if (m_children.size()) {
@@ -838,6 +845,11 @@ void GraphicsLayer::setCompositingReasons(CompositingReasons reasons)
m_debugInfo.setCompositingReasons(reasons);
}
+void GraphicsLayer::setSquashingDisallowedReasons(SquashingDisallowedReasons reasons)
+{
+ m_debugInfo.setSquashingDisallowedReasons(reasons);
+}
+
void GraphicsLayer::setOwnerNodeId(int nodeId)
{
m_debugInfo.setOwnerNodeId(nodeId);
diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.h b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.h
index 529ae1f..a565bc6 100644
--- a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.h
+++ b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.h
@@ -86,6 +86,7 @@ public:
void setCompositingReasons(CompositingReasons);
CompositingReasons compositingReasons() const { return m_debugInfo.compositingReasons(); }
+ void setSquashingDisallowedReasons(SquashingDisallowedReasons);
void setOwnerNodeId(int);
GraphicsLayer* parent() const { return m_parent; }
diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsLayerDebugInfo.cpp b/third_party/WebKit/Source/platform/graphics/GraphicsLayerDebugInfo.cpp
index 3820b8a..b46bcad 100644
--- a/third_party/WebKit/Source/platform/graphics/GraphicsLayerDebugInfo.cpp
+++ b/third_party/WebKit/Source/platform/graphics/GraphicsLayerDebugInfo.cpp
@@ -25,6 +25,7 @@ namespace blink {
GraphicsLayerDebugInfo::GraphicsLayerDebugInfo()
: m_compositingReasons(CompositingReasonNone)
+ , m_squashingDisallowedReasons(SquashingDisallowedReasonsNone)
, m_ownerNodeId(0)
{
}
@@ -36,6 +37,7 @@ scoped_refptr<base::trace_event::TracedValue> GraphicsLayerDebugInfo::asTracedVa
scoped_refptr<base::trace_event::TracedValue> tracedValue = new base::trace_event::TracedValue;
appendAnnotatedInvalidateRects(tracedValue.get());
appendCompositingReasons(tracedValue.get());
+ appendSquashingDisallowedReasons(tracedValue.get());
appendOwnerNodeId(tracedValue.get());
return tracedValue;
}
@@ -69,6 +71,17 @@ void GraphicsLayerDebugInfo::appendCompositingReasons(base::trace_event::TracedV
tracedValue->EndArray();
}
+void GraphicsLayerDebugInfo::appendSquashingDisallowedReasons(base::trace_event::TracedValue* tracedValue) const
+{
+ tracedValue->BeginArray("squashing_disallowed_reasons");
+ for (size_t i = 0; i < kNumberOfSquashingDisallowedReasons; ++i) {
+ if (!(m_compositingReasons & kSquashingDisallowedReasonStringMap[i].reason))
+ continue;
+ tracedValue->AppendString(kSquashingDisallowedReasonStringMap[i].description);
+ }
+ tracedValue->EndArray();
+}
+
void GraphicsLayerDebugInfo::appendOwnerNodeId(base::trace_event::TracedValue* tracedValue) const
{
if (!m_ownerNodeId)
diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsLayerDebugInfo.h b/third_party/WebKit/Source/platform/graphics/GraphicsLayerDebugInfo.h
index ccc64fa..fd79f68 100644
--- a/third_party/WebKit/Source/platform/graphics/GraphicsLayerDebugInfo.h
+++ b/third_party/WebKit/Source/platform/graphics/GraphicsLayerDebugInfo.h
@@ -35,6 +35,7 @@
#include "platform/geometry/FloatRect.h"
#include "platform/graphics/CompositingReasons.h"
#include "platform/graphics/PaintInvalidationReason.h"
+#include "platform/graphics/SquashingDisallowedReasons.h"
#include "wtf/Allocator.h"
#include "wtf/Noncopyable.h"
#include "wtf/Vector.h"
@@ -58,6 +59,9 @@ public:
CompositingReasons compositingReasons() const { return m_compositingReasons; }
void setCompositingReasons(CompositingReasons reasons) { m_compositingReasons = reasons; }
+
+ SquashingDisallowedReasons squashingDisallowedReasons() const { return m_squashingDisallowedReasons; }
+ void setSquashingDisallowedReasons(SquashingDisallowedReasons reasons) { m_squashingDisallowedReasons = reasons; }
void setOwnerNodeId(int id) { m_ownerNodeId = id; }
void appendAnnotatedInvalidateRect(const FloatRect&, PaintInvalidationReason);
@@ -66,6 +70,7 @@ public:
private:
void appendAnnotatedInvalidateRects(base::trace_event::TracedValue*) const;
void appendCompositingReasons(base::trace_event::TracedValue*) const;
+ void appendSquashingDisallowedReasons(base::trace_event::TracedValue*) const;
void appendOwnerNodeId(base::trace_event::TracedValue*) const;
struct AnnotatedInvalidationRect {
@@ -75,6 +80,7 @@ private:
};
CompositingReasons m_compositingReasons;
+ SquashingDisallowedReasons m_squashingDisallowedReasons;
int m_ownerNodeId;
Vector<AnnotatedInvalidationRect> m_invalidations;
Vector<AnnotatedInvalidationRect> m_previousInvalidations;
diff --git a/third_party/WebKit/Source/platform/graphics/SquashingDisallowedReasons.cpp b/third_party/WebKit/Source/platform/graphics/SquashingDisallowedReasons.cpp
new file mode 100644
index 0000000..5abeb33
--- /dev/null
+++ b/third_party/WebKit/Source/platform/graphics/SquashingDisallowedReasons.cpp
@@ -0,0 +1,61 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "platform/graphics/SquashingDisallowedReasons.h"
+
+#include "wtf/StdLibExtras.h"
+
+namespace blink {
+
+const SquashingDisallowedReasonStringMap kSquashingDisallowedReasonStringMap[] = {
+ { SquashingDisallowedReasonScrollsWithRespectToSquashingLayer,
+ "scrollsWithRespectToSquashingLayer",
+ "Cannot be squashed since this layer scrolls with respect to the squashing layer" },
+ { SquashingDisallowedReasonSquashingSparsityExceeded,
+ "squashingSparsityExceeded",
+ "Cannot be squashed as the squashing layer would become too sparse" },
+ { SquashingDisallowedReasonClippingContainerMismatch,
+ "squashingClippingContainerMismatch",
+ "Cannot be squashed because this layer has a different clipping container than the squashing layer" },
+ { SquashingDisallowedReasonOpacityAncestorMismatch,
+ "squashingOpacityAncestorMismatch",
+ "Cannot be squashed because this layer has a different opacity ancestor than the squashing layer" },
+ { SquashingDisallowedReasonTransformAncestorMismatch,
+ "squashingTransformAncestorMismatch",
+ "Cannot be squashed because this layer has a different transform ancestor than the squashing layer" },
+ { SquashingDisallowedReasonFilterMismatch,
+ "squashingFilterAncestorMismatch",
+ "Cannot be squashed because this layer has a different filter ancestor than the squashing layer, or this layer has a filter" },
+ { SquashingDisallowedReasonWouldBreakPaintOrder,
+ "squashingWouldBreakPaintOrder",
+ "Cannot be squashed without breaking paint order" },
+ { SquashingDisallowedReasonSquashingVideoIsDisallowed,
+ "squashingVideoIsDisallowed",
+ "Squashing video is not supported" },
+ { SquashingDisallowedReasonSquashedLayerClipsCompositingDescendants,
+ "squashedLayerClipsCompositingDescendants",
+ "Squashing a layer that clips composited descendants is not supported." },
+ { SquashingDisallowedReasonSquashingLayoutPartIsDisallowed,
+ "squashingLayoutPartIsDisallowed",
+ "Squashing a frame, iframe or plugin is not supported." },
+ { SquashingDisallowedReasonSquashingReflectionIsDisallowed,
+ "squashingReflectionDisallowed",
+ "Squashing a element with a reflection is not supported." },
+ { SquashingDisallowedReasonSquashingBlendingIsDisallowed,
+ "squashingBlendingDisallowed",
+ "Squashing a layer with blending is not supported." },
+ { SquashingDisallowedReasonNearestFixedPositionMismatch,
+ "squashingNearestFixedPositionMismatch",
+ "Cannot be squashed because this layer has a different nearest fixed position layer than the squashing layer" },
+ { SquashingDisallowedReasonScrollChildWithCompositedDescendants,
+ "scrollChildWithCompositedDescendants",
+ "Squashing a scroll child with composited descendants is not supported." },
+ { SquashingDisallowedReasonSquashingLayerIsAnimating,
+ "squashingLayerIsAnimating",
+ "Cannot squash into a layer that is animating." },
+};
+
+const size_t kNumberOfSquashingDisallowedReasons = WTF_ARRAY_LENGTH(kSquashingDisallowedReasonStringMap);
+
+} // namespace blink
diff --git a/third_party/WebKit/Source/platform/graphics/SquashingDisallowedReasons.h b/third_party/WebKit/Source/platform/graphics/SquashingDisallowedReasons.h
new file mode 100644
index 0000000..ec29090
--- /dev/null
+++ b/third_party/WebKit/Source/platform/graphics/SquashingDisallowedReasons.h
@@ -0,0 +1,46 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SquashingDisallowedReasons_h
+#define SquashingDisallowedReasons_h
+
+#include "platform/PlatformExport.h"
+#include "wtf/Allocator.h"
+#include <stdint.h>
+
+namespace blink {
+
+const uint64_t SquashingDisallowedReasonsNone = 0;
+
+const uint64_t SquashingDisallowedReasonScrollsWithRespectToSquashingLayer = UINT64_C(1) << 0;
+const uint64_t SquashingDisallowedReasonSquashingSparsityExceeded = UINT64_C(1) << 1;
+const uint64_t SquashingDisallowedReasonClippingContainerMismatch = UINT64_C(1) << 2;
+const uint64_t SquashingDisallowedReasonOpacityAncestorMismatch = UINT64_C(1) << 3;
+const uint64_t SquashingDisallowedReasonTransformAncestorMismatch = UINT64_C(1) << 4;
+const uint64_t SquashingDisallowedReasonFilterMismatch = UINT64_C(1) << 5;
+const uint64_t SquashingDisallowedReasonWouldBreakPaintOrder = UINT64_C(1) << 6;
+const uint64_t SquashingDisallowedReasonSquashingVideoIsDisallowed = UINT64_C(1) << 7;
+const uint64_t SquashingDisallowedReasonSquashedLayerClipsCompositingDescendants = UINT64_C(1) << 8;
+const uint64_t SquashingDisallowedReasonSquashingLayoutPartIsDisallowed = UINT64_C(1) << 9;
+const uint64_t SquashingDisallowedReasonSquashingReflectionIsDisallowed = UINT64_C(1) << 10;
+const uint64_t SquashingDisallowedReasonSquashingBlendingIsDisallowed = UINT64_C(1) << 11;
+const uint64_t SquashingDisallowedReasonNearestFixedPositionMismatch = UINT64_C(1) << 12;
+const uint64_t SquashingDisallowedReasonScrollChildWithCompositedDescendants = UINT64_C(1) << 13;
+const uint64_t SquashingDisallowedReasonSquashingLayerIsAnimating = UINT64_C(1) << 14;
+
+typedef uint64_t SquashingDisallowedReasons;
+
+struct SquashingDisallowedReasonStringMap {
+ STACK_ALLOCATED();
+ SquashingDisallowedReasons reason;
+ const char* shortName;
+ const char* description;
+};
+
+PLATFORM_EXPORT extern const SquashingDisallowedReasonStringMap kSquashingDisallowedReasonStringMap[];
+PLATFORM_EXPORT extern const size_t kNumberOfSquashingDisallowedReasons;
+
+} // namespace blink
+
+#endif // SquashingDisallowedReasons_h