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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/RenderLayerModelObject.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 576 matching lines...) Expand 10 before | Expand all | Expand 10 after
587 587
588 squashedBounds.move(offsetFromSquashingLayer); 588 squashedBounds.move(offsetFromSquashingLayer);
589 totalSquashBounds.unite(squashedBounds); 589 totalSquashBounds.unite(squashedBounds);
590 } 590 }
591 591
592 // The totalSquashBounds is positioned with respect to referenceLayer of thi s CompositedLayerMapping. 592 // The totalSquashBounds is positioned with respect to referenceLayer of thi s CompositedLayerMapping.
593 // But the squashingLayer needs to be positioned with respect to the ancesto r CompositedLayerMapping. 593 // But the squashingLayer needs to be positioned with respect to the ancesto r CompositedLayerMapping.
594 // The conversion between referenceLayer and the ancestor CLM is already com puted as 594 // The conversion between referenceLayer and the ancestor CLM is already com puted as
595 // offsetFromReferenceLayerToParentGraphicsLayer. 595 // offsetFromReferenceLayerToParentGraphicsLayer.
596 totalSquashBounds.moveBy(offsetFromReferenceLayerToParentGraphicsLayer); 596 totalSquashBounds.moveBy(offsetFromReferenceLayerToParentGraphicsLayer);
597 IntRect squashLayerBounds = enclosingIntRect(totalSquashBounds); 597 const IntRect squashLayerBounds = enclosingIntRect(totalSquashBounds);
598 IntPoint squashLayerOrigin = squashLayerBounds.location(); 598 const IntPoint squashLayerOrigin = squashLayerBounds.location();
599 LayoutSize squashLayerOriginInOwningLayerSpace = squashLayerOrigin - offsetF romReferenceLayerToParentGraphicsLayer; 599 const LayoutSize squashLayerOriginInOwningLayerSpace = squashLayerOrigin - o ffsetFromReferenceLayerToParentGraphicsLayer;
600 600
601 // Now that the squashing bounds are known, we can convert the RenderLayer p ainting offsets 601 // Now that the squashing bounds are known, we can convert the RenderLayer p ainting offsets
602 // from CLM owning layer space to the squashing layer space. 602 // from CLM owning layer space to the squashing layer space.
603 // 603 //
604 // The painting offset we want to compute for each squashed RenderLayer is e ssentially the position of 604 // The painting offset we want to compute for each squashed RenderLayer is e ssentially the position of
605 // the squashed RenderLayer described w.r.t. referenceLayer's origin. For th is purpose we already cached 605 // the squashed RenderLayer described w.r.t. referenceLayer's origin.
606 // offsetFromSquashingCLM before, which describes where the squashed RenderL ayer is located w.r.t. 606 // So we just need to convert that point from referenceLayer space to the sq uashing layer's
607 // referenceLayer. So we just need to convert that point from referenceLayer space to referenceLayer
608 // space. This is simply done by subtracing squashLayerOriginInOwningLayerSp ace, but then the offset 607 // space. This is simply done by subtracing squashLayerOriginInOwningLayerSp ace, but then the offset
609 // overall needs to be negated because that's the direction that the paintin g code expects the 608 // overall needs to be negated because that's the direction that the paintin g code expects the
610 // offset to be. 609 // offset to be.
611 for (size_t i = 0; i < layers.size(); ++i) { 610 for (size_t i = 0; i < layers.size(); ++i) {
612 LayoutPoint offsetFromTransformedAncestorForSquashedLayer = layers[i].re nderLayer->computeOffsetFromTransformedAncestor(); 611 const LayoutPoint offsetFromTransformedAncestorForSquashedLayer = layers [i].renderLayer->computeOffsetFromTransformedAncestor();
613 LayoutSize offsetFromSquashLayerOrigin = (offsetFromTransformedAncestorF orSquashedLayer - referenceOffsetFromTransformedAncestor) - squashLayerOriginInO wningLayerSpace; 612 const LayoutSize offsetFromSquashLayerOrigin = (offsetFromTransformedAnc estorForSquashedLayer - referenceOffsetFromTransformedAncestor) - squashLayerOri ginInOwningLayerSpace;
614 613
615 // It is ok to issue paint invalidation here, because all of the geometr y needed to correctly invalidate paint is computed by this point.
616 IntSize newOffsetFromRenderer = -IntSize(offsetFromSquashLayerOrigin.wid th().round(), offsetFromSquashLayerOrigin.height().round()); 614 IntSize newOffsetFromRenderer = -IntSize(offsetFromSquashLayerOrigin.wid th().round(), offsetFromSquashLayerOrigin.height().round());
617 LayoutSize subpixelAccumulation = offsetFromSquashLayerOrigin + newOffse tFromRenderer; 615 LayoutSize subpixelAccumulation = offsetFromSquashLayerOrigin + newOffse tFromRenderer;
618 if (layers[i].offsetFromRendererSet && layers[i].offsetFromRenderer != n ewOffsetFromRenderer) { 616 if (layers[i].offsetFromRendererSet && layers[i].offsetFromRenderer != n ewOffsetFromRenderer) {
617 // It is ok to issue paint invalidation here, because all of the geo metry needed to correctly invalidate paint is computed by this point.
619 layers[i].renderLayer->renderer()->invalidatePaintIncludingNonCompos itingDescendants(); 618 layers[i].renderLayer->renderer()->invalidatePaintIncludingNonCompos itingDescendants();
620 619
621 TRACE_LAYER_INVALIDATION(layers[i].renderLayer, InspectorLayerInvali dationTrackingEvent::SquashingLayerGeometryWasUpdated); 620 TRACE_LAYER_INVALIDATION(layers[i].renderLayer, InspectorLayerInvali dationTrackingEvent::SquashingLayerGeometryWasUpdated);
622 layersNeedingPaintInvalidation.append(layers[i].renderLayer); 621 layersNeedingPaintInvalidation.append(layers[i].renderLayer);
623 } 622 }
624 layers[i].offsetFromRenderer = newOffsetFromRenderer; 623 layers[i].offsetFromRenderer = newOffsetFromRenderer;
625 layers[i].offsetFromRendererSet = true; 624 layers[i].offsetFromRendererSet = true;
626 625
627 layers[i].renderLayer->setSubpixelAccumulation(subpixelAccumulation); 626 layers[i].renderLayer->setSubpixelAccumulation(subpixelAccumulation);
628 } 627 }
(...skipping 1745 matching lines...) Expand 10 before | Expand all | Expand 10 after
2374 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { 2373 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) {
2375 name = "Scrolling Block Selection Layer"; 2374 name = "Scrolling Block Selection Layer";
2376 } else { 2375 } else {
2377 ASSERT_NOT_REACHED(); 2376 ASSERT_NOT_REACHED();
2378 } 2377 }
2379 2378
2380 return name; 2379 return name;
2381 } 2380 }
2382 2381
2383 } // namespace blink 2382 } // namespace blink
OLDNEW
« 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