Chromium Code Reviews| Index: Source/core/rendering/CompositedLayerMapping.cpp |
| diff --git a/Source/core/rendering/CompositedLayerMapping.cpp b/Source/core/rendering/CompositedLayerMapping.cpp |
| index 04369437d96249832183d6b0b228ce03b85e3a40..163b82eabd55c4a820a5ea29fd249f9824b22e7f 100644 |
| --- a/Source/core/rendering/CompositedLayerMapping.cpp |
| +++ b/Source/core/rendering/CompositedLayerMapping.cpp |
| @@ -575,22 +575,22 @@ void CompositedLayerMapping::updateSquashingLayerGeometry(const IntPoint& delta) |
| // Store the local bounds of the RenderLayer subtree before applying the offset. |
| m_squashedLayers[i].compositedBounds = squashedBounds; |
| - squashedBounds.move(m_squashedLayers[i].offsetFromSquashingCLM); |
| + squashedBounds.move(roundedIntSize(m_squashedLayers[i].offsetFromSquashingCLM + m_subpixelAccumulation)); |
| totalSquashBounds.unite(squashedBounds); |
| } |
| // 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 above as |delta|. |
|
ajuma
2014/02/03 21:00:44
What if the compositing ancestor has a clip layer?
|
| + IntRect squashLayerBounds = pixelSnappedIntRect(totalSquashBounds); |
| + IntPoint squashLayerOrigin = squashLayerBounds.location(); |
| + squashLayerBounds.moveBy(delta); |
| // FIXME: this could be skipped for accelerated overflow scrolling, somehow. |
| m_squashingLayer->setNeedsDisplay(); |
| - 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. |
| @@ -599,11 +599,11 @@ 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 |
| + // space. This is simply done by subtracing squashLayerOrigin... 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()); |
| + m_squashedLayers[i].offsetFromRenderer = -roundedIntSize(LayoutSize(m_squashedLayers[i].offsetFromSquashingCLM.width() - squashLayerOrigin.x() + m_subpixelAccumulation.width(), |
| + m_squashedLayers[i].offsetFromSquashingCLM.height() - squashLayerOrigin.y() + m_subpixelAccumulation.height())); |
| // 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. |
| @@ -2064,7 +2064,7 @@ void CompositedLayerMapping::setCompositedBounds(const LayoutRect& bounds) |
| m_compositedBounds = bounds; |
| } |
| -void CompositedLayerMapping::addRenderLayerToSquashingGraphicsLayer(RenderLayer* layer, IntSize offsetFromSquashingCLM, size_t nextSquashedLayerIndex) |
| +void CompositedLayerMapping::addRenderLayerToSquashingGraphicsLayer(RenderLayer* layer, LayoutSize offsetFromSquashingCLM, size_t nextSquashedLayerIndex) |
| { |
| ASSERT(compositor()->layerSquashingEnabled()); |