OLD | NEW |
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 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 // Store the local bounds of the RenderLayer subtree before applying the
offset. | 544 // Store the local bounds of the RenderLayer subtree before applying the
offset. |
545 layers[i].compositedBounds = squashedBounds; | 545 layers[i].compositedBounds = squashedBounds; |
546 | 546 |
547 LayoutPoint offsetFromTransformedAncestorForSquashedLayer = layers[i].re
nderLayer->computeOffsetFromTransformedAncestor(); | 547 LayoutPoint offsetFromTransformedAncestorForSquashedLayer = layers[i].re
nderLayer->computeOffsetFromTransformedAncestor(); |
548 LayoutSize offsetFromSquashingLayer = offsetFromTransformedAncestorForSq
uashedLayer - referenceOffsetFromTransformedAncestor; | 548 LayoutSize offsetFromSquashingLayer = offsetFromTransformedAncestorForSq
uashedLayer - referenceOffsetFromTransformedAncestor; |
549 | 549 |
550 squashedBounds.move(offsetFromSquashingLayer); | 550 squashedBounds.move(offsetFromSquashingLayer); |
551 totalSquashBounds.unite(squashedBounds); | 551 totalSquashBounds.unite(squashedBounds); |
552 } | 552 } |
553 | 553 |
554 *offsetFromTransformedAncestor = referenceOffsetFromTransformedAncestor; | |
555 offsetFromTransformedAncestor->moveBy(totalSquashBounds.location()); | |
556 | |
557 // The totalSquashBounds is positioned with respect to referenceLayer of thi
s CompositedLayerMapping. | 554 // The totalSquashBounds is positioned with respect to referenceLayer of thi
s CompositedLayerMapping. |
558 // But the squashingLayer needs to be positioned with respect to the ancesto
r CompositedLayerMapping. | 555 // But the squashingLayer needs to be positioned with respect to the ancesto
r CompositedLayerMapping. |
559 // The conversion between referenceLayer and the ancestor CLM is already com
puted as | 556 // The conversion between referenceLayer and the ancestor CLM is already com
puted as |
560 // offsetFromReferenceLayerToParentGraphicsLayer. | 557 // offsetFromReferenceLayerToParentGraphicsLayer. |
561 totalSquashBounds.moveBy(offsetFromReferenceLayerToParentGraphicsLayer); | 558 totalSquashBounds.moveBy(offsetFromReferenceLayerToParentGraphicsLayer); |
562 IntRect squashLayerBounds = enclosingIntRect(totalSquashBounds); | 559 IntRect squashLayerBounds = enclosingIntRect(totalSquashBounds); |
563 IntPoint squashLayerOrigin = squashLayerBounds.location(); | 560 IntPoint squashLayerOrigin = squashLayerBounds.location(); |
564 LayoutSize squashLayerOriginInOwningLayerSpace = squashLayerOrigin - offsetF
romReferenceLayerToParentGraphicsLayer; | 561 LayoutSize squashLayerOriginInOwningLayerSpace = squashLayerOrigin - offsetF
romReferenceLayerToParentGraphicsLayer; |
565 | 562 |
566 squashingLayer->setPosition(squashLayerBounds.location()); | 563 squashingLayer->setPosition(squashLayerBounds.location()); |
567 squashingLayer->setSize(squashLayerBounds.size()); | 564 squashingLayer->setSize(squashLayerBounds.size()); |
568 | 565 |
| 566 *offsetFromTransformedAncestor = referenceOffsetFromTransformedAncestor; |
| 567 offsetFromTransformedAncestor->move(squashLayerOriginInOwningLayerSpace); |
| 568 |
569 // Now that the squashing bounds are known, we can convert the RenderLayer p
ainting offsets | 569 // Now that the squashing bounds are known, we can convert the RenderLayer p
ainting offsets |
570 // from CLM owning layer space to the squashing layer space. | 570 // from CLM owning layer space to the squashing layer space. |
571 // | 571 // |
572 // The painting offset we want to compute for each squashed RenderLayer is e
ssentially the position of | 572 // The painting offset we want to compute for each squashed RenderLayer is e
ssentially the position of |
573 // the squashed RenderLayer described w.r.t. referenceLayer's origin. For th
is purpose we already cached | 573 // the squashed RenderLayer described w.r.t. referenceLayer's origin. For th
is purpose we already cached |
574 // offsetFromSquashingCLM before, which describes where the squashed RenderL
ayer is located w.r.t. | 574 // offsetFromSquashingCLM before, which describes where the squashed RenderL
ayer is located w.r.t. |
575 // referenceLayer. So we just need to convert that point from referenceLayer
space to referenceLayer | 575 // referenceLayer. So we just need to convert that point from referenceLayer
space to referenceLayer |
576 // space. This is simply done by subtracing squashLayerOriginInOwningLayerSp
ace, but then the offset | 576 // space. This is simply done by subtracing squashLayerOriginInOwningLayerSp
ace, but then the offset |
577 // overall needs to be negated because that's the direction that the paintin
g code expects the | 577 // overall needs to be negated because that's the direction that the paintin
g code expects the |
578 // offset to be. | 578 // offset to be. |
(...skipping 1686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2265 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { | 2265 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { |
2266 name = "Scrolling Block Selection Layer"; | 2266 name = "Scrolling Block Selection Layer"; |
2267 } else { | 2267 } else { |
2268 ASSERT_NOT_REACHED(); | 2268 ASSERT_NOT_REACHED(); |
2269 } | 2269 } |
2270 | 2270 |
2271 return name; | 2271 return name; |
2272 } | 2272 } |
2273 | 2273 |
2274 } // namespace WebCore | 2274 } // namespace WebCore |
OLD | NEW |