| Index: Source/core/rendering/RenderLayer.cpp
|
| diff --git a/Source/core/rendering/RenderLayer.cpp b/Source/core/rendering/RenderLayer.cpp
|
| index 2ddee3c762ea1f92387b04328288267f2eedf82e..0fe7e0c0486e6e30517a0a5f91a3a6a08f7dea95 100644
|
| --- a/Source/core/rendering/RenderLayer.cpp
|
| +++ b/Source/core/rendering/RenderLayer.cpp
|
| @@ -134,6 +134,7 @@ RenderLayer::RenderLayer(RenderLayerModelObject* renderer)
|
| , m_staticInlinePosition(0)
|
| , m_staticBlockPosition(0)
|
| , m_enclosingPaginationLayer(0)
|
| + , m_groupedMapping(0)
|
| , m_repainter(renderer)
|
| , m_clipper(renderer)
|
| {
|
| @@ -1110,15 +1111,16 @@ static inline const RenderLayer* compositingContainer(const RenderLayer* layer)
|
|
|
| // FIXME: having two different functions named enclosingCompositingLayer and enclosingCompositingLayerForRepaint
|
| // is error-prone and misleading for reading code that uses these functions - especially compounded with
|
| -// the includeSelf option. It is very likely that some call sites of this function actually mean to use
|
| -// enclosingCompositingLayerForRepaint().
|
| +// the includeSelf option. It is very likely that we don't even want either of these functions; A layer
|
| +// should be told explicitly which GraphicsLayer is the repaintContainer for a RenderLayer, and
|
| +// any other use cases should probably have an API between the non-compositing and compositing sides of code.
|
| RenderLayer* RenderLayer::enclosingCompositingLayer(bool includeSelf) const
|
| {
|
| - if (includeSelf && hasCompositedLayerMapping())
|
| + if (includeSelf && compositingState() != NotComposited && compositingState() != PaintsIntoGroupedBacking)
|
| return const_cast<RenderLayer*>(this);
|
|
|
| for (const RenderLayer* curr = compositingContainer(this); curr; curr = compositingContainer(curr)) {
|
| - if (curr->hasCompositedLayerMapping())
|
| + if (curr->compositingState() != NotComposited && curr->compositingState() != PaintsIntoGroupedBacking)
|
| return const_cast<RenderLayer*>(curr);
|
| }
|
|
|
| @@ -1127,11 +1129,11 @@ RenderLayer* RenderLayer::enclosingCompositingLayer(bool includeSelf) const
|
|
|
| RenderLayer* RenderLayer::enclosingCompositingLayerForRepaint(bool includeSelf) const
|
| {
|
| - if (includeSelf && compositingState() == PaintsIntoOwnBacking)
|
| + if (includeSelf && (compositingState() == PaintsIntoOwnBacking || compositingState() == PaintsIntoGroupedBacking))
|
| return const_cast<RenderLayer*>(this);
|
|
|
| for (const RenderLayer* curr = compositingContainer(this); curr; curr = compositingContainer(curr)) {
|
| - if (curr->compositingState() == PaintsIntoOwnBacking)
|
| + if (curr->compositingState() == PaintsIntoOwnBacking || curr->compositingState() == PaintsIntoGroupedBacking)
|
| return const_cast<RenderLayer*>(curr);
|
| }
|
|
|
| @@ -1884,7 +1886,7 @@ static bool paintForFixedRootBackground(const RenderLayer* layer, PaintLayerFlag
|
|
|
| void RenderLayer::paintLayer(GraphicsContext* context, const LayerPaintingInfo& paintingInfo, PaintLayerFlags paintFlags)
|
| {
|
| - if (compositingState() != NotComposited) {
|
| + if (compositingState() != NotComposited && compositingState() != PaintsIntoGroupedBacking) {
|
| // The updatingControlTints() painting pass goes through compositing layers,
|
| // but we need to ensure that we don't cache clip rects computed with the wrong root in this case.
|
| if (context->updatingControlTints() || (paintingInfo.paintBehavior & PaintBehaviorFlattenCompositingLayers)) {
|
| @@ -3636,6 +3638,12 @@ CompositingState RenderLayer::compositingState() const
|
| // This is computed procedurally so there is no redundant state variable that
|
| // can get out of sync from the real actual compositing state.
|
|
|
| + if (m_groupedMapping) {
|
| + ASSERT(compositor()->isLayerSquashingEnabled());
|
| + ASSERT(!m_compositedLayerMapping);
|
| + return PaintsIntoGroupedBacking;
|
| + }
|
| +
|
| if (!m_compositedLayerMapping)
|
| return NotComposited;
|
|
|
| @@ -3987,10 +3995,17 @@ void RenderLayer::styleChanged(StyleDifference, const RenderStyle* oldStyle)
|
| if (compositor()->updateLayerCompositingState(this)
|
| || needsCompositingLayersRebuiltForClip(oldStyle, newStyle)
|
| || needsCompositingLayersRebuiltForOverflow(oldStyle, newStyle)
|
| - || needsCompositingLayersRebuiltForFilters(oldStyle, newStyle, didPaintWithFilters))
|
| + || needsCompositingLayersRebuiltForFilters(oldStyle, newStyle, didPaintWithFilters)) {
|
| compositor()->setCompositingLayersNeedRebuild();
|
| - else if (hasCompositedLayerMapping())
|
| + } else if (compositingState() == PaintsIntoOwnBacking || compositingState() == HasOwnBackingButPaintsIntoAncestor) {
|
| + ASSERT(hasCompositedLayerMapping());
|
| compositedLayerMapping()->updateGraphicsLayerGeometry();
|
| + } else if (compositingState() == PaintsIntoGroupedBacking) {
|
| + ASSERT(compositor()->isLayerSquashingEnabled());
|
| + ASSERT(groupedMapping());
|
| + // FIXME: double-check that updateGraphicsLayerGeometry is not necessary (well the squashing portion is what might be needed? but probably not)...
|
| + // FIXME: do we need to take any action here for a squashed layer?
|
| + }
|
| }
|
|
|
| bool RenderLayer::scrollsOverflow() const
|
|
|