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

Unified Diff: Source/core/rendering/compositing/CompositedLayerMapping.cpp

Issue 343543005: Round in the range [-0.5, 0.5) when computing offsetFromRenderer and subpixelAccumulation (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Added test. Created 6 years, 6 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 | « LayoutTests/compositing/squashing/subpixel-rounding-expected.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/compositing/CompositedLayerMapping.cpp
diff --git a/Source/core/rendering/compositing/CompositedLayerMapping.cpp b/Source/core/rendering/compositing/CompositedLayerMapping.cpp
index 8f2e9dd6ff369c2585001b7e05878d9b85d121a5..d81a0afa9ac3ba1656b6ecabf7928dd5cbf350ac 100644
--- a/Source/core/rendering/compositing/CompositedLayerMapping.cpp
+++ b/Source/core/rendering/compositing/CompositedLayerMapping.cpp
@@ -556,8 +556,8 @@ void CompositedLayerMapping::updateSquashingLayerGeometry(const LayoutPoint& off
// The totalSquashBounds is positioned with respect to referenceLayer of this CompositedLayerMapping.
// But the squashingLayer needs to be positioned with respect to the ancestor CompositedLayerMapping.
- // The conversion between referenceLayer and the ancestor CLM is already computed in the caller as
- // offsetFromReferenceLayerToCompositedAncestor.
+ // The conversion between referenceLayer and the ancestor CLM is already computed as
+ // offsetFromReferenceLayerToParentGraphicsLayer.
totalSquashBounds.moveBy(offsetFromReferenceLayerToParentGraphicsLayer);
IntRect squashLayerBounds = enclosingIntRect(totalSquashBounds);
IntPoint squashLayerOrigin = squashLayerBounds.location();
@@ -581,15 +581,14 @@ void CompositedLayerMapping::updateSquashingLayerGeometry(const LayoutPoint& off
LayoutSize offsetFromSquashLayerOrigin = (offsetFromTransformedAncestorForSquashedLayer - referenceOffsetFromTransformedAncestor) - squashLayerOriginInOwningLayerSpace;
// It is ok to repaint here, because all of the geometry needed to correctly repaint is computed by this point.
- IntSize newOffsetFromRenderer = -flooredIntSize(offsetFromSquashLayerOrigin);
+ IntSize newOffsetFromRenderer = -IntSize(offsetFromSquashLayerOrigin.width().round(), offsetFromSquashLayerOrigin.height().round());
+ LayoutSize subpixelAccumulation = offsetFromSquashLayerOrigin + newOffsetFromRenderer;
if (layers[i].offsetFromRendererSet && layers[i].offsetFromRenderer != newOffsetFromRenderer)
layers[i].renderLayer->repainter().repaintIncludingNonCompositingDescendants();
layers[i].offsetFromRenderer = newOffsetFromRenderer;
layers[i].offsetFromRendererSet = true;
- layers[i].renderLayer->setSubpixelAccumulation(offsetFromSquashLayerOrigin.fraction());
- ASSERT(layers[i].renderLayer->subpixelAccumulation() ==
- toLayoutSize(computeOffsetFromCompositedAncestor(layers[i].renderLayer, layers[i].renderLayer->ancestorCompositingLayer())).fraction());
leviw_travelin_and_unemployed 2014/06/18 17:33:35 I'm sad to see the assert leave, but I'll just cro
+ layers[i].renderLayer->setSubpixelAccumulation(subpixelAccumulation);
// 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.
« no previous file with comments | « LayoutTests/compositing/squashing/subpixel-rounding-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698