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 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 bool scrollingConfigChanged = false; | 441 bool scrollingConfigChanged = false; |
442 if (updateScrollingLayers(m_owningLayer.needsCompositedScrolling())) { | 442 if (updateScrollingLayers(m_owningLayer.needsCompositedScrolling())) { |
443 layerConfigChanged = true; | 443 layerConfigChanged = true; |
444 scrollingConfigChanged = true; | 444 scrollingConfigChanged = true; |
445 } | 445 } |
446 | 446 |
447 if (updateOverflowControlsLayers(requiresHorizontalScrollbarLayer(), require
sVerticalScrollbarLayer(), requiresScrollCornerLayer(), needsAncestorClip)) | 447 if (updateOverflowControlsLayers(requiresHorizontalScrollbarLayer(), require
sVerticalScrollbarLayer(), requiresScrollCornerLayer(), needsAncestorClip)) |
448 layerConfigChanged = true; | 448 layerConfigChanged = true; |
449 | 449 |
450 bool hasPerspective = false; | 450 bool hasPerspective = false; |
451 if (RenderStyle* style = renderer->style()) | 451 if (const RenderStyle* style = renderer->style()) |
452 hasPerspective = style->hasPerspective(); | 452 hasPerspective = style->hasPerspective(); |
453 bool needsChildTransformLayer = hasPerspective && (layerForChildrenTransform
() == m_childTransformLayer.get()) && renderer->isBox(); | 453 bool needsChildTransformLayer = hasPerspective && (layerForChildrenTransform
() == m_childTransformLayer.get()) && renderer->isBox(); |
454 if (updateChildTransformLayer(needsChildTransformLayer)) | 454 if (updateChildTransformLayer(needsChildTransformLayer)) |
455 layerConfigChanged = true; | 455 layerConfigChanged = true; |
456 | 456 |
457 updateScrollParent(scrollParent); | 457 updateScrollParent(scrollParent); |
458 updateClipParent(); | 458 updateClipParent(); |
459 | 459 |
460 if (updateSquashingLayers(!m_squashedLayers.isEmpty())) | 460 if (updateSquashingLayers(!m_squashedLayers.isEmpty())) |
461 layerConfigChanged = true; | 461 layerConfigChanged = true; |
(...skipping 997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1459 // All CLM-managed layers that could affect a descendant layer should update
their | 1459 // All CLM-managed layers that could affect a descendant layer should update
their |
1460 // should-flatten-transform value (the other layers' transforms don't matter
here). | 1460 // should-flatten-transform value (the other layers' transforms don't matter
here). |
1461 UpdateShouldFlattenTransformFunctor functor = { !m_owningLayer.shouldPreserv
e3D() }; | 1461 UpdateShouldFlattenTransformFunctor functor = { !m_owningLayer.shouldPreserv
e3D() }; |
1462 ApplyToGraphicsLayersMode mode = ApplyToLayersAffectedByPreserve3D; | 1462 ApplyToGraphicsLayersMode mode = ApplyToLayersAffectedByPreserve3D; |
1463 ApplyToGraphicsLayers(this, functor, mode); | 1463 ApplyToGraphicsLayers(this, functor, mode); |
1464 | 1464 |
1465 // Note, if we apply perspective, we have to set should flatten differently | 1465 // Note, if we apply perspective, we have to set should flatten differently |
1466 // so that the transform propagates to child layers correctly. | 1466 // so that the transform propagates to child layers correctly. |
1467 if (GraphicsLayer* childTransformLayer = layerForChildrenTransform()) { | 1467 if (GraphicsLayer* childTransformLayer = layerForChildrenTransform()) { |
1468 bool hasPerspective = false; | 1468 bool hasPerspective = false; |
1469 if (RenderStyle* style = m_owningLayer.renderer()->style()) | 1469 if (const RenderStyle* style = m_owningLayer.renderer()->style()) |
1470 hasPerspective = style->hasPerspective(); | 1470 hasPerspective = style->hasPerspective(); |
1471 if (hasPerspective) | 1471 if (hasPerspective) |
1472 childTransformLayer->setShouldFlattenTransform(false); | 1472 childTransformLayer->setShouldFlattenTransform(false); |
1473 | 1473 |
1474 // Note, if the target is the scrolling layer, we need to ensure that th
e | 1474 // Note, if the target is the scrolling layer, we need to ensure that th
e |
1475 // scrolling content layer doesn't flatten the transform. (It would be n
ice | 1475 // scrolling content layer doesn't flatten the transform. (It would be n
ice |
1476 // if we could apply transform to the scrolling content layer, but that'
s | 1476 // if we could apply transform to the scrolling content layer, but that'
s |
1477 // too late, we need the children transform to be applied _before_ the | 1477 // too late, we need the children transform to be applied _before_ the |
1478 // scrolling offset.) | 1478 // scrolling offset.) |
1479 if (childTransformLayer == m_scrollingLayer.get()) { | 1479 if (childTransformLayer == m_scrollingLayer.get()) { |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1886 updateDrawsContent(); | 1886 updateDrawsContent(); |
1887 | 1887 |
1888 // Image animation is "lazy", in that it automatically stops unless someone
is drawing | 1888 // Image animation is "lazy", in that it automatically stops unless someone
is drawing |
1889 // the image. So we have to kick the animation each time; this has the downs
ide that the | 1889 // the image. So we have to kick the animation each time; this has the downs
ide that the |
1890 // image will keep animating, even if its layer is not visible. | 1890 // image will keep animating, even if its layer is not visible. |
1891 image->startAnimation(); | 1891 image->startAnimation(); |
1892 } | 1892 } |
1893 | 1893 |
1894 FloatPoint3D CompositedLayerMapping::computeTransformOrigin(const IntRect& borde
rBox) const | 1894 FloatPoint3D CompositedLayerMapping::computeTransformOrigin(const IntRect& borde
rBox) const |
1895 { | 1895 { |
1896 RenderStyle* style = renderer()->style(); | 1896 const RenderStyle* style = renderer()->style(); |
1897 | 1897 |
1898 FloatPoint3D origin; | 1898 FloatPoint3D origin; |
1899 origin.setX(floatValueForLength(style->transformOriginX(), borderBox.width()
)); | 1899 origin.setX(floatValueForLength(style->transformOriginX(), borderBox.width()
)); |
1900 origin.setY(floatValueForLength(style->transformOriginY(), borderBox.height(
))); | 1900 origin.setY(floatValueForLength(style->transformOriginY(), borderBox.height(
))); |
1901 origin.setZ(style->transformOriginZ()); | 1901 origin.setZ(style->transformOriginZ()); |
1902 | 1902 |
1903 return origin; | 1903 return origin; |
1904 } | 1904 } |
1905 | 1905 |
1906 // Return the offset from the top-left of this compositing layer at which the | 1906 // Return the offset from the top-left of this compositing layer at which the |
(...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2334 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { | 2334 } else if (graphicsLayer == m_scrollingBlockSelectionLayer.get()) { |
2335 name = "Scrolling Block Selection Layer"; | 2335 name = "Scrolling Block Selection Layer"; |
2336 } else { | 2336 } else { |
2337 ASSERT_NOT_REACHED(); | 2337 ASSERT_NOT_REACHED(); |
2338 } | 2338 } |
2339 | 2339 |
2340 return name; | 2340 return name; |
2341 } | 2341 } |
2342 | 2342 |
2343 } // namespace blink | 2343 } // namespace blink |
OLD | NEW |