| 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 559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 // The painting offset we want to compute for each squashed RenderLayer is e
ssentially the position of | 570 // The painting offset we want to compute for each squashed RenderLayer is e
ssentially the position of |
| 571 // the squashed RenderLayer described w.r.t. referenceLayer's origin. For th
is purpose we already cached | 571 // the squashed RenderLayer described w.r.t. referenceLayer's origin. For th
is purpose we already cached |
| 572 // offsetFromSquashingCLM before, which describes where the squashed RenderL
ayer is located w.r.t. | 572 // offsetFromSquashingCLM before, which describes where the squashed RenderL
ayer is located w.r.t. |
| 573 // referenceLayer. So we just need to convert that point from referenceLayer
space to referenceLayer | 573 // referenceLayer. So we just need to convert that point from referenceLayer
space to referenceLayer |
| 574 // space. This is simply done by subtracing squashLayerOriginInOwningLayerSp
ace, but then the offset | 574 // space. This is simply done by subtracing squashLayerOriginInOwningLayerSp
ace, but then the offset |
| 575 // overall needs to be negated because that's the direction that the paintin
g code expects the | 575 // overall needs to be negated because that's the direction that the paintin
g code expects the |
| 576 // offset to be. | 576 // offset to be. |
| 577 for (size_t i = 0; i < layers.size(); ++i) { | 577 for (size_t i = 0; i < layers.size(); ++i) { |
| 578 LayoutPoint offsetFromTransformedAncestorForSquashedLayer = layers[i].re
nderLayer->computeOffsetFromTransformedAncestor(); | 578 LayoutPoint offsetFromTransformedAncestorForSquashedLayer = layers[i].re
nderLayer->computeOffsetFromTransformedAncestor(); |
| 579 LayoutSize offsetFromSquashLayerOrigin = (offsetFromTransformedAncestorF
orSquashedLayer - referenceOffsetFromTransformedAncestor) - squashLayerOriginInO
wningLayerSpace; | 579 LayoutSize offsetFromSquashLayerOrigin = (offsetFromTransformedAncestorF
orSquashedLayer - referenceOffsetFromTransformedAncestor) - squashLayerOriginInO
wningLayerSpace; |
| 580 layers[i].offsetFromRenderer = -flooredIntSize(offsetFromSquashLayerOrig
in); | 580 |
| 581 // It is ok to repaint here, because all of the geometry needed to corre
ctly repaint is computed by this point. |
| 582 IntSize newOffsetFromRenderer = -flooredIntSize(offsetFromSquashLayerOri
gin); |
| 583 if (layers[i].offsetFromRendererSet && layers[i].offsetFromRenderer != n
ewOffsetFromRenderer) |
| 584 layers[i].renderLayer->repainter().repaintIncludingNonCompositingDes
cendants(); |
| 585 layers[i].offsetFromRenderer = newOffsetFromRenderer; |
| 586 layers[i].offsetFromRendererSet = true; |
| 581 | 587 |
| 582 layers[i].renderLayer->setSubpixelAccumulation(offsetFromSquashLayerOrig
in.fraction()); | 588 layers[i].renderLayer->setSubpixelAccumulation(offsetFromSquashLayerOrig
in.fraction()); |
| 583 ASSERT(layers[i].renderLayer->subpixelAccumulation() == | 589 ASSERT(layers[i].renderLayer->subpixelAccumulation() == |
| 584 toLayoutSize(computeOffsetFromCompositedAncestor(layers[i].renderLay
er, layers[i].renderLayer->ancestorCompositingLayer())).fraction()); | 590 toLayoutSize(computeOffsetFromCompositedAncestor(layers[i].renderLay
er, layers[i].renderLayer->ancestorCompositingLayer())).fraction()); |
| 585 | 591 |
| 586 // FIXME: find a better design to avoid this redundant value - most like
ly it will make | 592 // FIXME: find a better design to avoid this redundant value - most like
ly it will make |
| 587 // sense to move the paint task info into RenderLayer's m_compositingPro
perties. | 593 // sense to move the paint task info into RenderLayer's m_compositingPro
perties. |
| 588 layers[i].renderLayer->setOffsetFromSquashingLayerOrigin(layers[i].offse
tFromRenderer); | 594 layers[i].renderLayer->setOffsetFromSquashingLayerOrigin(layers[i].offse
tFromRenderer); |
| 589 | |
| 590 } | 595 } |
| 591 | 596 |
| 592 for (size_t i = 0; i < layers.size(); ++i) | 597 for (size_t i = 0; i < layers.size(); ++i) |
| 593 layers[i].localClipRectForSquashedLayer = localClipRectForSquashedLayer(
referenceLayer, layers[i], layers); | 598 layers[i].localClipRectForSquashedLayer = localClipRectForSquashedLayer(
referenceLayer, layers[i], layers); |
| 594 } | 599 } |
| 595 | 600 |
| 596 void CompositedLayerMapping::updateGraphicsLayerGeometry(GraphicsLayerUpdater::U
pdateType updateType, const RenderLayer* compositingContainer) | 601 void CompositedLayerMapping::updateGraphicsLayerGeometry(GraphicsLayerUpdater::U
pdateType updateType, const RenderLayer* compositingContainer) |
| 597 { | 602 { |
| 598 if (!shouldUpdateGraphicsLayer(updateType)) | 603 if (!shouldUpdateGraphicsLayer(updateType)) |
| 599 return; | 604 return; |
| (...skipping 1612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2212 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { | 2217 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { |
| 2213 name = "Scrolling Contents Layer"; | 2218 name = "Scrolling Contents Layer"; |
| 2214 } else { | 2219 } else { |
| 2215 ASSERT_NOT_REACHED(); | 2220 ASSERT_NOT_REACHED(); |
| 2216 } | 2221 } |
| 2217 | 2222 |
| 2218 return name; | 2223 return name; |
| 2219 } | 2224 } |
| 2220 | 2225 |
| 2221 } // namespace WebCore | 2226 } // namespace WebCore |
| OLD | NEW |