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

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

Issue 976543002: Fix pixel snapping issue when transforming (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: add missing space Created 5 years, 8 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
« no previous file with comments | « Source/core/paint/DeprecatedPaintLayer.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/DeprecatedPaintLayerPainter.cpp
diff --git a/Source/core/paint/DeprecatedPaintLayerPainter.cpp b/Source/core/paint/DeprecatedPaintLayerPainter.cpp
index bc6b1e4d4060fe3090f7fdbab6bb57e33bb69d20..ceb4483766fac793571ad4fb49c2013823a31a66 100644
--- a/Source/core/paint/DeprecatedPaintLayerPainter.cpp
+++ b/Source/core/paint/DeprecatedPaintLayerPainter.cpp
@@ -199,6 +199,8 @@ void DeprecatedPaintLayerPainter::paintLayerContents(GraphicsContext* context, c
if (m_renderLayer.compositingState() == PaintsIntoOwnBacking)
offsetFromRoot.move(m_renderLayer.subpixelAccumulation());
+ else
+ offsetFromRoot.move(paintingInfo.subPixelAccumulation);
LayoutRect rootRelativeBounds;
bool rootRelativeBoundsComputed = false;
@@ -448,15 +450,6 @@ bool DeprecatedPaintLayerPainter::shouldPaintLayerInSoftwareMode(const Deprecate
|| 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 DeprecatedPaintLayerPainter::paintOverflowControlsForFragments(const DeprecatedPaintLayerFragments& layerFragments, GraphicsContext* context, const DeprecatedPaintLayerPaintingInfo& localPaintingInfo, PaintLayerFlags paintFlags)
{
bool needsScope = layerFragments.size() > 1;
@@ -471,7 +464,7 @@ void DeprecatedPaintLayerPainter::paintOverflowControlsForFragments(const Deprec
clipRecorder = adoptPtr(new LayerClipRecorder(*context, *m_renderLayer.layoutObject(), DisplayItem::ClipLayerOverflowControls, fragment.backgroundRect, &localPaintingInfo, fragment.paginationOffset, paintFlags));
}
if (DeprecatedPaintLayerScrollableArea* 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);
}
}
@@ -633,7 +626,7 @@ void DeprecatedPaintLayerPainter::paintFragmentWithPhase(PaintPhase phase, const
}
PaintInfo paintInfo(context, pixelSnappedIntRect(clipRect.rect()), phase, paintBehavior, paintingRootForRenderer, 0, paintingInfo.rootLayer->layoutObject());
- m_renderLayer.layoutObject()->paint(paintInfo, toPoint(fragment.layerBounds.location() - m_renderLayer.layoutBoxLocation() + subPixelAccumulationIfNeeded(paintingInfo.subPixelAccumulation, m_renderLayer.compositingState())));
+ m_renderLayer.layoutObject()->paint(paintInfo, toPoint(fragment.layerBounds.location() - m_renderLayer.layoutBoxLocation()));
}
void DeprecatedPaintLayerPainter::paintBackgroundForFragments(const DeprecatedPaintLayerFragments& layerFragments, GraphicsContext* context,
« no previous file with comments | « Source/core/paint/DeprecatedPaintLayer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698