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

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

Issue 659493005: Don't add subpixel accumulations for squashed layers when invalidating them. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixed. Created 6 years, 2 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/rendering/RenderLayerModelObject.cpp ('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 9203eb561848719d29b7520cbed32a92cd9b371a..c2d15b716ff74d0aa319f1af1b85c0df5dc9608e 100644
--- a/Source/core/rendering/compositing/CompositedLayerMapping.cpp
+++ b/Source/core/rendering/compositing/CompositedLayerMapping.cpp
@@ -594,28 +594,27 @@ void CompositedLayerMapping::updateSquashingLayerGeometry(const LayoutPoint& off
// The conversion between referenceLayer and the ancestor CLM is already computed as
// offsetFromReferenceLayerToParentGraphicsLayer.
totalSquashBounds.moveBy(offsetFromReferenceLayerToParentGraphicsLayer);
- IntRect squashLayerBounds = enclosingIntRect(totalSquashBounds);
- IntPoint squashLayerOrigin = squashLayerBounds.location();
- LayoutSize squashLayerOriginInOwningLayerSpace = squashLayerOrigin - offsetFromReferenceLayerToParentGraphicsLayer;
+ const IntRect squashLayerBounds = enclosingIntRect(totalSquashBounds);
+ const IntPoint squashLayerOrigin = squashLayerBounds.location();
+ const LayoutSize squashLayerOriginInOwningLayerSpace = squashLayerOrigin - offsetFromReferenceLayerToParentGraphicsLayer;
// Now that the squashing bounds are known, we can convert the RenderLayer painting offsets
// from CLM owning layer space to the squashing layer space.
//
// The painting offset we want to compute for each squashed RenderLayer is essentially the position of
- // the squashed RenderLayer described w.r.t. referenceLayer's origin. For this purpose we already cached
- // offsetFromSquashingCLM before, which describes where the squashed RenderLayer is located w.r.t.
- // referenceLayer. So we just need to convert that point from referenceLayer space to referenceLayer
+ // the squashed RenderLayer described w.r.t. referenceLayer's origin.
+ // So we just need to convert that point from referenceLayer space to the squashing layer's
// space. This is simply done by subtracing squashLayerOriginInOwningLayerSpace, 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 < layers.size(); ++i) {
- LayoutPoint offsetFromTransformedAncestorForSquashedLayer = layers[i].renderLayer->computeOffsetFromTransformedAncestor();
- LayoutSize offsetFromSquashLayerOrigin = (offsetFromTransformedAncestorForSquashedLayer - referenceOffsetFromTransformedAncestor) - squashLayerOriginInOwningLayerSpace;
+ const LayoutPoint offsetFromTransformedAncestorForSquashedLayer = layers[i].renderLayer->computeOffsetFromTransformedAncestor();
+ const LayoutSize offsetFromSquashLayerOrigin = (offsetFromTransformedAncestorForSquashedLayer - referenceOffsetFromTransformedAncestor) - squashLayerOriginInOwningLayerSpace;
- // It is ok to issue paint invalidation here, because all of the geometry needed to correctly invalidate paint is computed by this point.
IntSize newOffsetFromRenderer = -IntSize(offsetFromSquashLayerOrigin.width().round(), offsetFromSquashLayerOrigin.height().round());
LayoutSize subpixelAccumulation = offsetFromSquashLayerOrigin + newOffsetFromRenderer;
if (layers[i].offsetFromRendererSet && layers[i].offsetFromRenderer != newOffsetFromRenderer) {
+ // It is ok to issue paint invalidation here, because all of the geometry needed to correctly invalidate paint is computed by this point.
layers[i].renderLayer->renderer()->invalidatePaintIncludingNonCompositingDescendants();
TRACE_LAYER_INVALIDATION(layers[i].renderLayer, InspectorLayerInvalidationTrackingEvent::SquashingLayerGeometryWasUpdated);
« no previous file with comments | « Source/core/rendering/RenderLayerModelObject.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698