OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009, 2010 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 1509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1520 return true; | 1520 return true; |
1521 | 1521 |
1522 if (layer->isRootLayer() | 1522 if (layer->isRootLayer() |
1523 || layer->transform() // note: excludes perspective and transformStyle3D . | 1523 || layer->transform() // note: excludes perspective and transformStyle3D . |
1524 || requiresCompositingForVideo(renderer) | 1524 || requiresCompositingForVideo(renderer) |
1525 || requiresCompositingForCanvas(renderer) | 1525 || requiresCompositingForCanvas(renderer) |
1526 || requiresCompositingForPlugin(renderer) | 1526 || requiresCompositingForPlugin(renderer) |
1527 || requiresCompositingForFrame(renderer) | 1527 || requiresCompositingForFrame(renderer) |
1528 || requiresCompositingForBackfaceVisibilityHidden(renderer) | 1528 || requiresCompositingForBackfaceVisibilityHidden(renderer) |
1529 || requiresCompositingForAnimation(renderer) | 1529 || requiresCompositingForAnimation(renderer) |
1530 || requiresCompositingForTransition(renderer) | |
1530 || requiresCompositingForFilters(renderer) | 1531 || requiresCompositingForFilters(renderer) |
1531 || requiresCompositingForBlending(renderer) | 1532 || requiresCompositingForBlending(renderer) |
1532 || requiresCompositingForPosition(renderer, layer) | 1533 || requiresCompositingForPosition(renderer, layer) |
1533 || requiresCompositingForOverflowScrolling(layer) | 1534 || requiresCompositingForOverflowScrolling(layer) |
1534 || renderer->isTransparent() | 1535 || renderer->isTransparent() |
1535 || renderer->hasMask() | 1536 || renderer->hasMask() |
1536 || renderer->hasReflection() | 1537 || renderer->hasReflection() |
1537 || renderer->hasFilter()) | 1538 || renderer->hasFilter()) |
1538 return true; | 1539 return true; |
1539 | 1540 |
(...skipping 28 matching lines...) Expand all Loading... | |
1568 | 1569 |
1569 if (requiresCompositingForFrame(renderer)) | 1570 if (requiresCompositingForFrame(renderer)) |
1570 directReasons |= CompositingReasonIFrame; | 1571 directReasons |= CompositingReasonIFrame; |
1571 | 1572 |
1572 if (requiresCompositingForBackfaceVisibilityHidden(renderer)) | 1573 if (requiresCompositingForBackfaceVisibilityHidden(renderer)) |
1573 directReasons |= CompositingReasonBackfaceVisibilityHidden; | 1574 directReasons |= CompositingReasonBackfaceVisibilityHidden; |
1574 | 1575 |
1575 if (requiresCompositingForAnimation(renderer)) | 1576 if (requiresCompositingForAnimation(renderer)) |
1576 directReasons |= CompositingReasonAnimation; | 1577 directReasons |= CompositingReasonAnimation; |
1577 | 1578 |
1579 if (requiresCompositingForTransition(renderer)) | |
1580 directReasons |= CompositingReasonTransition; | |
1581 | |
1578 if (requiresCompositingForFilters(renderer)) | 1582 if (requiresCompositingForFilters(renderer)) |
1579 directReasons |= CompositingReasonFilters; | 1583 directReasons |= CompositingReasonFilters; |
1580 | 1584 |
1581 if (requiresCompositingForPosition(renderer, layer)) | 1585 if (requiresCompositingForPosition(renderer, layer)) |
1582 directReasons |= renderer->style()->position() == FixedPosition ? Compos itingReasonPositionFixed : CompositingReasonPositionSticky; | 1586 directReasons |= renderer->style()->position() == FixedPosition ? Compos itingReasonPositionFixed : CompositingReasonPositionSticky; |
1583 | 1587 |
1584 if (requiresCompositingForOverflowScrolling(layer)) | 1588 if (requiresCompositingForOverflowScrolling(layer)) |
1585 directReasons |= CompositingReasonOverflowScrollingTouch; | 1589 directReasons |= CompositingReasonOverflowScrollingTouch; |
1586 | 1590 |
1587 if (requiresCompositingForBlending(renderer)) | 1591 if (requiresCompositingForBlending(renderer)) |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1622 | 1626 |
1623 if (reasons & CompositingReasonBackfaceVisibilityHidden) | 1627 if (reasons & CompositingReasonBackfaceVisibilityHidden) |
1624 return "backface-visibility: hidden"; | 1628 return "backface-visibility: hidden"; |
1625 | 1629 |
1626 if (reasons & CompositingReasonClipsCompositingDescendants) | 1630 if (reasons & CompositingReasonClipsCompositingDescendants) |
1627 return "clips compositing descendants"; | 1631 return "clips compositing descendants"; |
1628 | 1632 |
1629 if (reasons & CompositingReasonAnimation) | 1633 if (reasons & CompositingReasonAnimation) |
1630 return "animation"; | 1634 return "animation"; |
1631 | 1635 |
1636 if (reasons & CompositingReasonTransition) | |
1637 return "transition"; | |
1638 | |
1632 if (reasons & CompositingReasonFilters) | 1639 if (reasons & CompositingReasonFilters) |
1633 return "filters"; | 1640 return "filters"; |
1634 | 1641 |
1635 if (reasons & CompositingReasonPositionFixed) | 1642 if (reasons & CompositingReasonPositionFixed) |
1636 return "position: fixed"; | 1643 return "position: fixed"; |
1637 | 1644 |
1638 if (reasons & CompositingReasonPositionSticky) | 1645 if (reasons & CompositingReasonPositionSticky) |
1639 return "position: sticky"; | 1646 return "position: sticky"; |
1640 | 1647 |
1641 if (reasons & CompositingReasonOverflowScrollingTouch) | 1648 if (reasons & CompositingReasonOverflowScrollingTouch) |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1835 | 1842 |
1836 if (AnimationController* animController = renderer->animation()) { | 1843 if (AnimationController* animController = renderer->animation()) { |
1837 return (animController->isRunningAnimationOnRenderer(renderer, CSSProper tyOpacity) && inCompositingMode()) | 1844 return (animController->isRunningAnimationOnRenderer(renderer, CSSProper tyOpacity) && inCompositingMode()) |
1838 // <rdar://problem/10907251> - WebKit2 doesn't support CA animations of CI filters on Lion and below | 1845 // <rdar://problem/10907251> - WebKit2 doesn't support CA animations of CI filters on Lion and below |
1839 || animController->isRunningAnimationOnRenderer(renderer, CSSPropert yWebkitFilter) | 1846 || animController->isRunningAnimationOnRenderer(renderer, CSSPropert yWebkitFilter) |
1840 || animController->isRunningAnimationOnRenderer(renderer, CSSPropert yWebkitTransform); | 1847 || animController->isRunningAnimationOnRenderer(renderer, CSSPropert yWebkitTransform); |
1841 } | 1848 } |
1842 return false; | 1849 return false; |
1843 } | 1850 } |
1844 | 1851 |
1852 bool RenderLayerCompositor::requiresCompositingForTransition(RenderObject* rende rer) const | |
1853 { | |
1854 if (!(m_compositingTriggers & ChromeClient::AnimationTrigger)) | |
1855 return false; | |
1856 | |
1857 return renderer->style()->transitionForProperty(CSSPropertyOpacity) | |
1858 || renderer->style()->transitionForProperty(CSSPropertyWebkitTransform); | |
shawnsingh
2013/05/15 19:24:43
Would it work to accelerate filter transitions as
ajuma
2013/05/17 17:21:29
Done.
| |
1859 } | |
1860 | |
1845 CompositingReasons RenderLayerCompositor::subtreeReasonsForCompositing(RenderObj ect* renderer, bool hasCompositedDescendants, bool has3DTransformedDescendants) const | 1861 CompositingReasons RenderLayerCompositor::subtreeReasonsForCompositing(RenderObj ect* renderer, bool hasCompositedDescendants, bool has3DTransformedDescendants) const |
1846 { | 1862 { |
1847 CompositingReasons subtreeReasons = CompositingReasonNone; | 1863 CompositingReasons subtreeReasons = CompositingReasonNone; |
1848 | 1864 |
1849 // FIXME: this seems to be a potentially different layer than the layer for which this was called. May not be an error, but is very confusing. | 1865 // FIXME: this seems to be a potentially different layer than the layer for which this was called. May not be an error, but is very confusing. |
1850 RenderLayer* layer = toRenderBoxModelObject(renderer)->layer(); | 1866 RenderLayer* layer = toRenderBoxModelObject(renderer)->layer(); |
1851 | 1867 |
1852 // When a layer has composited descendants, some effects, like 2d transforms , filters, masks etc must be implemented | 1868 // When a layer has composited descendants, some effects, like 2d transforms , filters, masks etc must be implemented |
1853 // via compositing so that they also apply to those composited descdendants. | 1869 // via compositing so that they also apply to those composited descdendants. |
1854 if (hasCompositedDescendants) { | 1870 if (hasCompositedDescendants) { |
(...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2728 info.addMember(m_layerForScrollCorner, "layerForScrollCorner"); | 2744 info.addMember(m_layerForScrollCorner, "layerForScrollCorner"); |
2729 #if ENABLE(RUBBER_BANDING) | 2745 #if ENABLE(RUBBER_BANDING) |
2730 info.addMember(m_layerForOverhangAreas, "layerForOverhangAreas"); | 2746 info.addMember(m_layerForOverhangAreas, "layerForOverhangAreas"); |
2731 info.addMember(m_contentShadowLayer, "contentShadowLayer"); | 2747 info.addMember(m_contentShadowLayer, "contentShadowLayer"); |
2732 info.addMember(m_layerForTopOverhangArea, "layerForTopOverhangArea"); | 2748 info.addMember(m_layerForTopOverhangArea, "layerForTopOverhangArea"); |
2733 info.addMember(m_layerForBottomOverhangArea, "layerForBottomOverhangArea"); | 2749 info.addMember(m_layerForBottomOverhangArea, "layerForBottomOverhangArea"); |
2734 #endif | 2750 #endif |
2735 } | 2751 } |
2736 | 2752 |
2737 } // namespace WebCore | 2753 } // namespace WebCore |
OLD | NEW |