| Index: Source/core/rendering/compositing/CompositedLayerMapping.cpp
|
| diff --git a/Source/core/rendering/compositing/CompositedLayerMapping.cpp b/Source/core/rendering/compositing/CompositedLayerMapping.cpp
|
| index 1997accd403e335080362befcb932f53bcb2f9ff..157bec403039891c8851b9d743e977f5049d2e51 100644
|
| --- a/Source/core/rendering/compositing/CompositedLayerMapping.cpp
|
| +++ b/Source/core/rendering/compositing/CompositedLayerMapping.cpp
|
| @@ -598,13 +598,16 @@ void CompositedLayerMapping::updateSquashingLayerGeometry(const IntPoint& delta)
|
|
|
| // The totalSquashBounds is positioned with respect to m_owningLayer of this CompositedLayerMapping.
|
| // But the squashingLayer needs to be positioned with respect to the ancestor CompositedLayerMapping.
|
| - // The conversion between m_owningLayer and the ancestor CLM is already computed in the caller as |delta|.
|
| - // FIXME: probably not the right place to round from LayoutPoint to IntPoint?
|
| - IntPoint squashLayerPosition = pixelSnappedIntRect(totalSquashBounds).location();
|
| - squashLayerPosition.moveBy(delta);
|
| + // The conversion between m_owningLayer and the ancestor CLM is already computed in the caller as
|
| + // |delta| + |m_subpixelAccumulation|.
|
| + LayoutPoint rawDelta = delta + m_subpixelAccumulation;
|
| + totalSquashBounds.moveBy(rawDelta);
|
| + IntRect squashLayerBounds = enclosingIntRect(totalSquashBounds);
|
| + IntPoint squashLayerOrigin = squashLayerBounds.location();
|
| + LayoutPoint squashLayerOriginInOwningLayerSpace = LayoutPoint(squashLayerOrigin - rawDelta);
|
|
|
| - m_squashingLayer->setPosition(squashLayerPosition);
|
| - m_squashingLayer->setSize(totalSquashBounds.size());
|
| + m_squashingLayer->setPosition(squashLayerBounds.location());
|
| + m_squashingLayer->setSize(squashLayerBounds.size());
|
|
|
| // Now that the squashing bounds are known, we can convert the RenderLayer painting offsets
|
| // from CLM owning layer space to the squashing layer space.
|
| @@ -613,11 +616,13 @@ void CompositedLayerMapping::updateSquashingLayerGeometry(const IntPoint& delta)
|
| // the squashed RenderLayer described w.r.t. m_squashingLayer's origin. For this purpose we already cached
|
| // offsetFromSquashingCLM before, which describes where the squashed RenderLayer is located w.r.t.
|
| // m_owningLayer. So we just need to convert that point from m_owningLayer space to m_squashingLayer
|
| - // space. This is simply done by subtracing totalSquashBounds... but then the offset overall needs to be
|
| - // negated because that's the direction that the painting code expects the offset to be.
|
| + // space. This is simply done by subtracing squashLayerOriginInOwningLayerSpace, but then the offset
|
| + // overall needs to be negated because that's the direction that the painting code expects the
|
| + // offset to be.
|
| for (size_t i = 0; i < m_squashedLayers.size(); ++i) {
|
| - m_squashedLayers[i].offsetFromRenderer = IntSize(-m_squashedLayers[i].offsetFromSquashingCLM.width() + totalSquashBounds.x(),
|
| - -m_squashedLayers[i].offsetFromSquashingCLM.height() + totalSquashBounds.y());
|
| + LayoutSize offsetFromSquashLayerOrigin = LayoutPoint(m_squashedLayers[i].offsetFromSquashingCLM) - squashLayerOriginInOwningLayerSpace;
|
| + m_squashedLayers[i].offsetFromRenderer = -flooredIntSize(offsetFromSquashLayerOrigin);
|
| + m_squashedLayers[i].subpixelAccumulation = offsetFromSquashLayerOrigin.fraction();
|
|
|
| // FIXME: find a better design to avoid this redundant value - most likely it will make
|
| // sense to move the paint task info into RenderLayer's m_compositingProperties.
|
| @@ -1900,10 +1905,10 @@ void CompositedLayerMapping::doPaintTask(GraphicsLayerPaintInfo& paintInfo, Grap
|
|
|
| if (!(paintInfo.paintingPhase & GraphicsLayerPaintOverflowContents)) {
|
| LayoutRect bounds = paintInfo.compositedBounds;
|
| - bounds.move(m_subpixelAccumulation);
|
| + bounds.move(paintInfo.subpixelAccumulation);
|
| dirtyRect.intersect(pixelSnappedIntRect(bounds));
|
| } else {
|
| - dirtyRect.move(roundedIntSize(m_subpixelAccumulation));
|
| + dirtyRect.move(roundedIntSize(paintInfo.subpixelAccumulation));
|
| }
|
|
|
| #ifndef NDEBUG
|
| @@ -1912,7 +1917,7 @@ void CompositedLayerMapping::doPaintTask(GraphicsLayerPaintInfo& paintInfo, Grap
|
|
|
| if (paintInfo.renderLayer->compositingState() != PaintsIntoGroupedBacking) {
|
| // FIXME: GraphicsLayers need a way to split for RenderRegions.
|
| - LayerPaintingInfo paintingInfo(paintInfo.renderLayer, dirtyRect, PaintBehaviorNormal, m_subpixelAccumulation);
|
| + LayerPaintingInfo paintingInfo(paintInfo.renderLayer, dirtyRect, PaintBehaviorNormal, paintInfo.subpixelAccumulation);
|
| paintInfo.renderLayer->paintLayerContents(context, paintingInfo, paintFlags);
|
|
|
| ASSERT(!paintInfo.isBackgroundLayer || paintFlags & PaintLayerPaintingRootBackgroundOnly);
|
| @@ -1921,7 +1926,7 @@ void CompositedLayerMapping::doPaintTask(GraphicsLayerPaintInfo& paintInfo, Grap
|
| paintInfo.renderLayer->paintLayerContents(context, paintingInfo, paintFlags | PaintLayerPaintingOverlayScrollbars);
|
| } else {
|
| ASSERT(compositor()->layerSquashingEnabled());
|
| - LayerPaintingInfo paintingInfo(paintInfo.renderLayer, dirtyRect, PaintBehaviorNormal, LayoutSize());
|
| + LayerPaintingInfo paintingInfo(paintInfo.renderLayer, dirtyRect, PaintBehaviorNormal, paintInfo.subpixelAccumulation);
|
| paintInfo.renderLayer->paintLayer(context, paintingInfo, paintFlags);
|
| }
|
|
|
| @@ -1970,6 +1975,7 @@ void CompositedLayerMapping::paintContents(const GraphicsLayer* graphicsLayer, G
|
| paintInfo.offsetFromRenderer = graphicsLayer->offsetFromRenderer();
|
| paintInfo.paintingPhase = paintingPhase;
|
| paintInfo.isBackgroundLayer = (graphicsLayer == m_backgroundLayer);
|
| + paintInfo.subpixelAccumulation = m_subpixelAccumulation;
|
|
|
| // We have to use the same root as for hit testing, because both methods can compute and cache clipRects.
|
| doPaintTask(paintInfo, &context, clip);
|
| @@ -2039,7 +2045,7 @@ void CompositedLayerMapping::setCompositedBounds(const LayoutRect& bounds)
|
| m_compositedBounds = bounds;
|
| }
|
|
|
| -bool CompositedLayerMapping::updateSquashingLayerAssignment(RenderLayer* layer, IntSize offsetFromSquashingCLM, size_t nextSquashedLayerIndex)
|
| +bool CompositedLayerMapping::updateSquashingLayerAssignment(RenderLayer* layer, LayoutSize offsetFromSquashingCLM, size_t nextSquashedLayerIndex)
|
| {
|
| ASSERT(compositor()->layerSquashingEnabled());
|
|
|
|
|