diff options
| author | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2014-09-15 15:53:53 +0200 |
|---|---|---|
| committer | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2014-09-16 11:01:21 +0200 |
| commit | 40af385a1b7e7fdd60e3fb0adf872cc946515a06 (patch) | |
| tree | 7ca6078086e569ef10ece1d4cefc8ed0b2f59f5c | |
| parent | 3248c5b93cd22cb2d9f1a7368daf0902e68b58e0 (diff) | |
| download | qtwebkit-40af385a1b7e7fdd60e3fb0adf872cc946515a06.tar.gz | |
Fix repainting of subpixel positioned composited layers
Since the offset-from-renderer includes the pixel snapping based on
subpixel accumulation, we should take the accumulation into account to
calculate the repaint area in layer coordinates.
Task-number: QTBUG-40218
Change-Id: I66f9cb0943ba69bb892c686ecea9ed5fec805a0d
Reviewed-by: Michael Bruning <michael.bruning@digia.com>
| -rw-r--r-- | Source/WebCore/rendering/RenderLayerBacking.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/Source/WebCore/rendering/RenderLayerBacking.cpp b/Source/WebCore/rendering/RenderLayerBacking.cpp index 143c7d32c..acfc67776 100644 --- a/Source/WebCore/rendering/RenderLayerBacking.cpp +++ b/Source/WebCore/rendering/RenderLayerBacking.cpp @@ -1925,35 +1925,32 @@ void RenderLayerBacking::setContentsNeedDisplayInRect(const IntRect& r) { ASSERT(!paintsIntoCompositedAncestor()); + LayoutRect layerDirtyRect(r); + layerDirtyRect.move(m_subpixelAccumulation); if (m_graphicsLayer && m_graphicsLayer->drawsContent()) { - IntRect layerDirtyRect = r; layerDirtyRect.move(-m_graphicsLayer->offsetFromRenderer()); - m_graphicsLayer->setNeedsDisplayInRect(layerDirtyRect); + m_graphicsLayer->setNeedsDisplayInRect(enclosingIntRect(layerDirtyRect)); } if (m_foregroundLayer && m_foregroundLayer->drawsContent()) { - IntRect layerDirtyRect = r; layerDirtyRect.move(-m_foregroundLayer->offsetFromRenderer()); - m_foregroundLayer->setNeedsDisplayInRect(layerDirtyRect); + m_foregroundLayer->setNeedsDisplayInRect(enclosingIntRect(layerDirtyRect)); } // FIXME: need to split out repaints for the background. if (m_backgroundLayer && m_backgroundLayer->drawsContent()) { - IntRect layerDirtyRect = r; layerDirtyRect.move(-m_backgroundLayer->offsetFromRenderer()); - m_backgroundLayer->setNeedsDisplayInRect(layerDirtyRect); + m_backgroundLayer->setNeedsDisplayInRect(enclosingIntRect(layerDirtyRect)); } if (m_maskLayer && m_maskLayer->drawsContent()) { - IntRect layerDirtyRect = r; layerDirtyRect.move(-m_maskLayer->offsetFromRenderer()); - m_maskLayer->setNeedsDisplayInRect(layerDirtyRect); + m_maskLayer->setNeedsDisplayInRect(enclosingIntRect(layerDirtyRect)); } if (m_scrollingContentsLayer && m_scrollingContentsLayer->drawsContent()) { - IntRect layerDirtyRect = r; layerDirtyRect.move(-m_scrollingContentsLayer->offsetFromRenderer()); - m_scrollingContentsLayer->setNeedsDisplayInRect(layerDirtyRect); + m_scrollingContentsLayer->setNeedsDisplayInRect(enclosingIntRect(layerDirtyRect)); } } |
