OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. | 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All rights
reserved. |
3 * | 3 * |
4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. | 4 * Portions are Copyright (C) 1998 Netscape Communications Corporation. |
5 * | 5 * |
6 * Other contributors: | 6 * Other contributors: |
7 * Robert O'Callahan <roc+@cs.cmu.edu> | 7 * Robert O'Callahan <roc+@cs.cmu.edu> |
8 * David Baron <dbaron@fas.harvard.edu> | 8 * David Baron <dbaron@fas.harvard.edu> |
9 * Christian Biesinger <cbiesinger@web.de> | 9 * Christian Biesinger <cbiesinger@web.de> |
10 * Randall Jesup <rjesup@wgate.com> | 10 * Randall Jesup <rjesup@wgate.com> |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 , m_visibleContentStatusDirty(true) | 111 , m_visibleContentStatusDirty(true) |
112 , m_hasVisibleContent(false) | 112 , m_hasVisibleContent(false) |
113 , m_visibleDescendantStatusDirty(false) | 113 , m_visibleDescendantStatusDirty(false) |
114 , m_hasVisibleDescendant(false) | 114 , m_hasVisibleDescendant(false) |
115 , m_hasVisibleNonLayerContent(false) | 115 , m_hasVisibleNonLayerContent(false) |
116 , m_isPaginated(false) | 116 , m_isPaginated(false) |
117 , m_3DTransformedDescendantStatusDirty(true) | 117 , m_3DTransformedDescendantStatusDirty(true) |
118 , m_has3DTransformedDescendant(false) | 118 , m_has3DTransformedDescendant(false) |
119 , m_containsDirtyOverlayScrollbars(false) | 119 , m_containsDirtyOverlayScrollbars(false) |
120 , m_hasFilterInfo(false) | 120 , m_hasFilterInfo(false) |
| 121 , m_hasClipPathInfo(false) |
121 , m_needsAncestorDependentCompositingInputsUpdate(true) | 122 , m_needsAncestorDependentCompositingInputsUpdate(true) |
122 , m_needsDescendantDependentCompositingInputsUpdate(true) | 123 , m_needsDescendantDependentCompositingInputsUpdate(true) |
123 , m_childNeedsCompositingInputsUpdate(true) | 124 , m_childNeedsCompositingInputsUpdate(true) |
124 , m_hasCompositingDescendant(false) | 125 , m_hasCompositingDescendant(false) |
125 , m_hasNonCompositedChild(false) | 126 , m_hasNonCompositedChild(false) |
126 , m_shouldIsolateCompositedDescendants(false) | 127 , m_shouldIsolateCompositedDescendants(false) |
127 , m_lostGroupedMapping(false) | 128 , m_lostGroupedMapping(false) |
128 , m_viewportConstrainedNotCompositedReason(NoNotCompositedReason) | 129 , m_viewportConstrainedNotCompositedReason(NoNotCompositedReason) |
129 , m_renderer(renderer) | 130 , m_renderer(renderer) |
130 , m_parent(0) | 131 , m_parent(0) |
(...skipping 24 matching lines...) Expand all Loading... |
155 } | 156 } |
156 | 157 |
157 RenderLayer::~RenderLayer() | 158 RenderLayer::~RenderLayer() |
158 { | 159 { |
159 if (renderer()->frame() && renderer()->frame()->page()) { | 160 if (renderer()->frame() && renderer()->frame()->page()) { |
160 if (ScrollingCoordinator* scrollingCoordinator = renderer()->frame()->pa
ge()->scrollingCoordinator()) | 161 if (ScrollingCoordinator* scrollingCoordinator = renderer()->frame()->pa
ge()->scrollingCoordinator()) |
161 scrollingCoordinator->willDestroyRenderLayer(this); | 162 scrollingCoordinator->willDestroyRenderLayer(this); |
162 } | 163 } |
163 | 164 |
164 removeFilterInfoIfNeeded(); | 165 removeFilterInfoIfNeeded(); |
| 166 removeClipPathInfoIfNeeded(); |
165 | 167 |
166 if (groupedMapping()) { | 168 if (groupedMapping()) { |
167 DisableCompositingQueryAsserts disabler; | 169 DisableCompositingQueryAsserts disabler; |
168 groupedMapping()->removeRenderLayerFromSquashingGraphicsLayer(this); | 170 groupedMapping()->removeRenderLayerFromSquashingGraphicsLayer(this); |
169 setGroupedMapping(0); | 171 setGroupedMapping(0); |
170 } | 172 } |
171 | 173 |
172 // Child layers will be deleted by their corresponding render objects, so | 174 // Child layers will be deleted by their corresponding render objects, so |
173 // we don't need to delete them ourselves. | 175 // we don't need to delete them ourselves. |
174 | 176 |
(...skipping 3367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3542 | 3544 |
3543 void RenderLayer::updateFilters(const RenderStyle* oldStyle, const RenderStyle*
newStyle) | 3545 void RenderLayer::updateFilters(const RenderStyle* oldStyle, const RenderStyle*
newStyle) |
3544 { | 3546 { |
3545 if (!newStyle->hasFilter() && (!oldStyle || !oldStyle->hasFilter())) | 3547 if (!newStyle->hasFilter() && (!oldStyle || !oldStyle->hasFilter())) |
3546 return; | 3548 return; |
3547 | 3549 |
3548 updateOrRemoveFilterClients(); | 3550 updateOrRemoveFilterClients(); |
3549 updateOrRemoveFilterEffectRenderer(); | 3551 updateOrRemoveFilterEffectRenderer(); |
3550 } | 3552 } |
3551 | 3553 |
| 3554 void RenderLayer::updateClipPath(const RenderStyle* oldStyle, const RenderStyle*
newStyle) |
| 3555 { |
| 3556 if (!newStyle->clipPath() && (!oldStyle || !oldStyle->clipPath())) |
| 3557 return; |
| 3558 |
| 3559 updateOrRemoveClipPathClients(); |
| 3560 } |
| 3561 |
| 3562 void RenderLayer::updateOrRemoveClipPathClients() |
| 3563 { |
| 3564 if (!hasClipPath()) { |
| 3565 removeClipPathInfoIfNeeded(); |
| 3566 return; |
| 3567 } |
| 3568 |
| 3569 if (renderer()->style()->clipPath()->type() == ClipPathOperation::REFERENCE) |
| 3570 ensureClipPathInfo()->updateReferenceClipPathClients(renderer()->style()
->clipPath()); |
| 3571 else if (hasClipPathInfo()) |
| 3572 clipPathInfo()->removeReferenceClipPathClients(); |
| 3573 } |
| 3574 |
3552 bool RenderLayer::attemptDirectCompositingUpdate(StyleDifference diff, const Ren
derStyle* oldStyle) | 3575 bool RenderLayer::attemptDirectCompositingUpdate(StyleDifference diff, const Ren
derStyle* oldStyle) |
3553 { | 3576 { |
3554 CompositingReasons oldPotentialCompositingReasonsFromStyle = m_potentialComp
ositingReasonsFromStyle; | 3577 CompositingReasons oldPotentialCompositingReasonsFromStyle = m_potentialComp
ositingReasonsFromStyle; |
3555 compositor()->updatePotentialCompositingReasonsFromStyle(this); | 3578 compositor()->updatePotentialCompositingReasonsFromStyle(this); |
3556 | 3579 |
3557 // This function implements an optimization for transforms and opacity. | 3580 // This function implements an optimization for transforms and opacity. |
3558 // A common pattern is for a touchmove handler to update the transform | 3581 // A common pattern is for a touchmove handler to update the transform |
3559 // and/or an opacity of an element every frame while the user moves their | 3582 // and/or an opacity of an element every frame while the user moves their |
3560 // finger across the screen. The conditions below recognize when the | 3583 // finger across the screen. The conditions below recognize when the |
3561 // compositing state is set up to receive a direct transform or opacity | 3584 // compositing state is set up to receive a direct transform or opacity |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3627 updateReflectionInfo(oldStyle); | 3650 updateReflectionInfo(oldStyle); |
3628 } | 3651 } |
3629 | 3652 |
3630 if (RuntimeEnabledFeatures::cssCompositingEnabled()) | 3653 if (RuntimeEnabledFeatures::cssCompositingEnabled()) |
3631 m_blendInfo.updateBlendMode(); | 3654 m_blendInfo.updateBlendMode(); |
3632 | 3655 |
3633 updateDescendantDependentFlags(); | 3656 updateDescendantDependentFlags(); |
3634 | 3657 |
3635 updateTransform(oldStyle, renderer()->style()); | 3658 updateTransform(oldStyle, renderer()->style()); |
3636 updateFilters(oldStyle, renderer()->style()); | 3659 updateFilters(oldStyle, renderer()->style()); |
| 3660 updateClipPath(oldStyle, renderer()->style()); |
3637 | 3661 |
3638 setNeedsCompositingInputsUpdate(); | 3662 setNeedsCompositingInputsUpdate(); |
3639 } | 3663 } |
3640 | 3664 |
3641 bool RenderLayer::scrollsOverflow() const | 3665 bool RenderLayer::scrollsOverflow() const |
3642 { | 3666 { |
3643 if (RenderLayerScrollableArea* scrollableArea = this->scrollableArea()) | 3667 if (RenderLayerScrollableArea* scrollableArea = this->scrollableArea()) |
3644 return scrollableArea->scrollsOverflow(); | 3668 return scrollableArea->scrollsOverflow(); |
3645 | 3669 |
3646 return false; | 3670 return false; |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3790 } | 3814 } |
3791 } | 3815 } |
3792 | 3816 |
3793 void showLayerTree(const blink::RenderObject* renderer) | 3817 void showLayerTree(const blink::RenderObject* renderer) |
3794 { | 3818 { |
3795 if (!renderer) | 3819 if (!renderer) |
3796 return; | 3820 return; |
3797 showLayerTree(renderer->enclosingLayer()); | 3821 showLayerTree(renderer->enclosingLayer()); |
3798 } | 3822 } |
3799 #endif | 3823 #endif |
OLD | NEW |