| 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 30 matching lines...) Expand all Loading... |
| 41 * version of this file under any of the LGPL, the MPL or the GPL. | 41 * version of this file under any of the LGPL, the MPL or the GPL. |
| 42 */ | 42 */ |
| 43 | 43 |
| 44 #include "config.h" | 44 #include "config.h" |
| 45 #include "core/rendering/RenderLayer.h" | 45 #include "core/rendering/RenderLayer.h" |
| 46 | 46 |
| 47 #include "CSSPropertyNames.h" | 47 #include "CSSPropertyNames.h" |
| 48 #include "HTMLNames.h" | 48 #include "HTMLNames.h" |
| 49 #include "RuntimeEnabledFeatures.h" | 49 #include "RuntimeEnabledFeatures.h" |
| 50 #include "SVGNames.h" | 50 #include "SVGNames.h" |
| 51 #include "core/animation/ActiveAnimations.h" |
| 51 #include "core/css/PseudoStyleRequest.h" | 52 #include "core/css/PseudoStyleRequest.h" |
| 52 #include "core/dom/Document.h" | 53 #include "core/dom/Document.h" |
| 53 #include "core/dom/shadow/ShadowRoot.h" | 54 #include "core/dom/shadow/ShadowRoot.h" |
| 54 #include "core/html/HTMLFrameElement.h" | 55 #include "core/html/HTMLFrameElement.h" |
| 55 #include "core/frame/Frame.h" | 56 #include "core/frame/Frame.h" |
| 56 #include "core/frame/FrameView.h" | 57 #include "core/frame/FrameView.h" |
| 57 #include "core/page/Page.h" | 58 #include "core/page/Page.h" |
| 58 #include "core/page/Settings.h" | 59 #include "core/page/Settings.h" |
| 59 #include "core/frame/animation/AnimationController.h" | 60 #include "core/frame/animation/AnimationController.h" |
| 60 #include "core/page/scrolling/ScrollingCoordinator.h" | 61 #include "core/page/scrolling/ScrollingCoordinator.h" |
| (...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 | 569 |
| 569 if (had3DTransform != has3DTransform()) | 570 if (had3DTransform != has3DTransform()) |
| 570 dirty3DTransformedDescendantStatus(); | 571 dirty3DTransformedDescendantStatus(); |
| 571 } | 572 } |
| 572 | 573 |
| 573 TransformationMatrix RenderLayer::currentTransform(RenderStyle::ApplyTransformOr
igin applyOrigin) const | 574 TransformationMatrix RenderLayer::currentTransform(RenderStyle::ApplyTransformOr
igin applyOrigin) const |
| 574 { | 575 { |
| 575 if (!m_transform) | 576 if (!m_transform) |
| 576 return TransformationMatrix(); | 577 return TransformationMatrix(); |
| 577 | 578 |
| 578 if (renderer()->style()->isRunningAcceleratedAnimation()) { | 579 // FIXME: handle this under web-animations |
| 580 if (!RuntimeEnabledFeatures::webAnimationsEnabled() && renderer()->style()->
isRunningAcceleratedAnimation()) { |
| 579 TransformationMatrix currTransform; | 581 TransformationMatrix currTransform; |
| 580 RefPtr<RenderStyle> style = renderer()->animation().getAnimatedStyleForR
enderer(renderer()); | 582 RefPtr<RenderStyle> style = renderer()->animation().getAnimatedStyleForR
enderer(renderer()); |
| 581 style->applyTransform(currTransform, renderBox()->pixelSnappedBorderBoxR
ect().size(), applyOrigin); | 583 style->applyTransform(currTransform, renderBox()->pixelSnappedBorderBoxR
ect().size(), applyOrigin); |
| 582 makeMatrixRenderable(currTransform, canRender3DTransforms()); | 584 makeMatrixRenderable(currTransform, canRender3DTransforms()); |
| 583 return currTransform; | 585 return currTransform; |
| 584 } | 586 } |
| 585 | 587 |
| 586 // m_transform includes transform-origin, so we need to recompute the transf
orm here. | 588 // m_transform includes transform-origin, so we need to recompute the transf
orm here. |
| 587 if (applyOrigin == RenderStyle::ExcludeTransformOrigin) { | 589 if (applyOrigin == RenderStyle::ExcludeTransformOrigin) { |
| 588 RenderBox* box = renderBox(); | 590 RenderBox* box = renderBox(); |
| (...skipping 3323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3912 { | 3914 { |
| 3913 ASSERT(newStyle); | 3915 ASSERT(newStyle); |
| 3914 return !hasCompositedLayerMapping() && oldStyle && (oldStyle->overflowX() !=
newStyle->overflowX()) && m_stackingNode->ancestorStackingContainerNode()->laye
r()->hasCompositingDescendant(); | 3916 return !hasCompositedLayerMapping() && oldStyle && (oldStyle->overflowX() !=
newStyle->overflowX()) && m_stackingNode->ancestorStackingContainerNode()->laye
r()->hasCompositingDescendant(); |
| 3915 } | 3917 } |
| 3916 | 3918 |
| 3917 inline bool RenderLayer::needsCompositingLayersRebuiltForFilters(const RenderSty
le* oldStyle, const RenderStyle* newStyle, bool didPaintWithFilters) const | 3919 inline bool RenderLayer::needsCompositingLayersRebuiltForFilters(const RenderSty
le* oldStyle, const RenderStyle* newStyle, bool didPaintWithFilters) const |
| 3918 { | 3920 { |
| 3919 if (!hasOrHadFilters(oldStyle, newStyle)) | 3921 if (!hasOrHadFilters(oldStyle, newStyle)) |
| 3920 return false; | 3922 return false; |
| 3921 | 3923 |
| 3922 if (renderer()->animation().isRunningAcceleratedAnimationOnRenderer(renderer
(), CSSPropertyWebkitFilter)) { | 3924 if (RuntimeEnabledFeatures::webAnimationsCSSEnabled() |
| 3925 ? hasActiveAnimationsOnCompositor(*renderer(), CSSPropertyWebkitFilter) |
| 3926 : renderer()->animation().isRunningAcceleratedAnimationOnRenderer(render
er(), CSSPropertyWebkitFilter)) { |
| 3927 |
| 3923 // When the compositor is performing the filter animation, we shouldn't
touch the compositing layers. | 3928 // When the compositor is performing the filter animation, we shouldn't
touch the compositing layers. |
| 3924 // All of the layers above us should have been promoted to compositing l
ayers already. | 3929 // All of the layers above us should have been promoted to compositing l
ayers already. |
| 3925 return false; | 3930 return false; |
| 3926 } | 3931 } |
| 3927 | 3932 |
| 3928 FilterOutsets newOutsets = newStyle->filterOutsets(); | 3933 FilterOutsets newOutsets = newStyle->filterOutsets(); |
| 3929 if (oldStyle && (oldStyle->filterOutsets() != newOutsets)) { | 3934 if (oldStyle && (oldStyle->filterOutsets() != newOutsets)) { |
| 3930 // When filter outsets change, we need to: | 3935 // When filter outsets change, we need to: |
| 3931 // (1) Recompute the overlap map to promote the correct layers to compos
ited layers. | 3936 // (1) Recompute the overlap map to promote the correct layers to compos
ited layers. |
| 3932 // (2) Update the composited layer bounds (and child GraphicsLayer posit
ions) on platforms | 3937 // (2) Update the composited layer bounds (and child GraphicsLayer posit
ions) on platforms |
| (...skipping 15 matching lines...) Expand all Loading... |
| 3948 } | 3953 } |
| 3949 | 3954 |
| 3950 void RenderLayer::updateFilters(const RenderStyle* oldStyle, const RenderStyle*
newStyle) | 3955 void RenderLayer::updateFilters(const RenderStyle* oldStyle, const RenderStyle*
newStyle) |
| 3951 { | 3956 { |
| 3952 if (!hasOrHadFilters(oldStyle, newStyle)) | 3957 if (!hasOrHadFilters(oldStyle, newStyle)) |
| 3953 return; | 3958 return; |
| 3954 | 3959 |
| 3955 updateOrRemoveFilterClients(); | 3960 updateOrRemoveFilterClients(); |
| 3956 // During an accelerated animation, both WebKit and the compositor animate p
roperties. | 3961 // During an accelerated animation, both WebKit and the compositor animate p
roperties. |
| 3957 // However, WebKit shouldn't ask the compositor to update its filters if the
compositor is performing the animation. | 3962 // However, WebKit shouldn't ask the compositor to update its filters if the
compositor is performing the animation. |
| 3958 bool shouldUpdateFilters = hasCompositedLayerMapping() && !renderer()->anima
tion().isRunningAcceleratedAnimationOnRenderer(renderer(), CSSPropertyWebkitFilt
er); | 3963 if (hasCompositedLayerMapping() && (RuntimeEnabledFeatures::webAnimationsCSS
Enabled() |
| 3959 if (shouldUpdateFilters) | 3964 ? !hasActiveAnimationsOnCompositor(*renderer(), CSSPropertyWebkitFilter) |
| 3965 : !renderer()->animation().isRunningAcceleratedAnimationOnRenderer(rende
rer(), CSSPropertyWebkitFilter))) |
| 3960 compositedLayerMapping()->updateFilters(renderer()->style()); | 3966 compositedLayerMapping()->updateFilters(renderer()->style()); |
| 3961 updateOrRemoveFilterEffectRenderer(); | 3967 updateOrRemoveFilterEffectRenderer(); |
| 3962 } | 3968 } |
| 3963 | 3969 |
| 3964 void RenderLayer::styleChanged(StyleDifference, const RenderStyle* oldStyle) | 3970 void RenderLayer::styleChanged(StyleDifference, const RenderStyle* oldStyle) |
| 3965 { | 3971 { |
| 3966 m_stackingNode->updateIsNormalFlowOnly(); | 3972 m_stackingNode->updateIsNormalFlowOnly(); |
| 3967 | 3973 |
| 3968 if (m_scrollableArea) | 3974 if (m_scrollableArea) |
| 3969 m_scrollableArea->updateAfterStyleChange(oldStyle); | 3975 m_scrollableArea->updateAfterStyleChange(oldStyle); |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4165 } | 4171 } |
| 4166 } | 4172 } |
| 4167 | 4173 |
| 4168 void showLayerTree(const WebCore::RenderObject* renderer) | 4174 void showLayerTree(const WebCore::RenderObject* renderer) |
| 4169 { | 4175 { |
| 4170 if (!renderer) | 4176 if (!renderer) |
| 4171 return; | 4177 return; |
| 4172 showLayerTree(renderer->enclosingLayer()); | 4178 showLayerTree(renderer->enclosingLayer()); |
| 4173 } | 4179 } |
| 4174 #endif | 4180 #endif |
| OLD | NEW |