Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1124)

Unified Diff: Source/core/paint/LayerPainter.cpp

Issue 976543002: Fix pixel snapping issue when transforming (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/paint/LayerPainter.cpp
diff --git a/Source/core/paint/LayerPainter.cpp b/Source/core/paint/LayerPainter.cpp
index 77b7acbc33656d26d3e56cb2796332b1c510b44c..3b5074b285f691064ff895e39e39feab6e9a226a 100644
--- a/Source/core/paint/LayerPainter.cpp
+++ b/Source/core/paint/LayerPainter.cpp
@@ -196,6 +196,8 @@ void LayerPainter::paintLayerContents(GraphicsContext* context, const LayerPaint
if (m_renderLayer.compositingState() == PaintsIntoOwnBacking)
offsetFromRoot.move(m_renderLayer.subpixelAccumulation());
+ else
+ offsetFromRoot.move(paintingInfo.subPixelAccumulation);
LayoutRect rootRelativeBounds;
bool rootRelativeBoundsComputed = false;
@@ -441,15 +443,6 @@ bool LayerPainter::shouldPaintLayerInSoftwareMode(const LayerPaintingInfo& paint
|| paintForFixedRootBackground(&m_renderLayer, paintFlags);
}
-static inline LayoutSize subPixelAccumulationIfNeeded(const LayoutSize& subPixelAccumulation, CompositingState compositingState)
-{
- // Only apply the sub-pixel accumulation if we don't paint into our own backing layer, otherwise the position
- // of the renderer already includes any sub-pixel offset.
- if (compositingState == PaintsIntoOwnBacking)
- return LayoutSize();
- return subPixelAccumulation;
-}
-
void LayerPainter::paintOverflowControlsForFragments(const LayerFragments& layerFragments, GraphicsContext* context, const LayerPaintingInfo& localPaintingInfo, PaintLayerFlags paintFlags)
{
for (size_t i = 0; i < layerFragments.size(); ++i) {
@@ -462,7 +455,7 @@ void LayerPainter::paintOverflowControlsForFragments(const LayerFragments& layer
clipRecorder = adoptPtr(new LayerClipRecorder(m_renderLayer.renderer(), context, DisplayItem::ClipLayerOverflowControls, fragment.backgroundRect, &localPaintingInfo, fragment.paginationOffset, paintFlags));
}
if (LayerScrollableArea* scrollableArea = m_renderLayer.scrollableArea())
- ScrollableAreaPainter(*scrollableArea).paintOverflowControls(context, roundedIntPoint(toPoint(fragment.layerBounds.location() - m_renderLayer.layoutBoxLocation() + subPixelAccumulationIfNeeded(localPaintingInfo.subPixelAccumulation, m_renderLayer.compositingState()))), pixelSnappedIntRect(fragment.backgroundRect.rect()), true);
+ ScrollableAreaPainter(*scrollableArea).paintOverflowControls(context, roundedIntPoint(toPoint(fragment.layerBounds.location() - m_renderLayer.layoutBoxLocation())), pixelSnappedIntRect(fragment.backgroundRect.rect()), true);
}
}
@@ -624,7 +617,7 @@ void LayerPainter::paintFragmentWithPhase(PaintPhase phase, const LayerFragment&
}
PaintInfo paintInfo(context, pixelSnappedIntRect(clipRect.rect()), phase, paintBehavior, paintingRootForRenderer, 0, paintingInfo.rootLayer->renderer());
- m_renderLayer.renderer()->paint(paintInfo, toPoint(fragment.layerBounds.location() - m_renderLayer.layoutBoxLocation() + subPixelAccumulationIfNeeded(paintingInfo.subPixelAccumulation, m_renderLayer.compositingState())));
+ m_renderLayer.renderer()->paint(paintInfo, toPoint(fragment.layerBounds.location() - m_renderLayer.layoutBoxLocation()));
}
void LayerPainter::paintBackgroundForFragments(const LayerFragments& layerFragments, GraphicsContext* context,

Powered by Google App Engine
This is Rietveld 408576698