| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 #include "SVGNames.h" | 50 #include "SVGNames.h" |
| 51 #include "core/animation/ActiveAnimations.h" | 51 #include "core/animation/ActiveAnimations.h" |
| 52 #include "core/css/PseudoStyleRequest.h" | 52 #include "core/css/PseudoStyleRequest.h" |
| 53 #include "core/dom/Document.h" | 53 #include "core/dom/Document.h" |
| 54 #include "core/dom/shadow/ShadowRoot.h" | 54 #include "core/dom/shadow/ShadowRoot.h" |
| 55 #include "core/html/HTMLFrameElement.h" | 55 #include "core/html/HTMLFrameElement.h" |
| 56 #include "core/frame/Frame.h" | 56 #include "core/frame/Frame.h" |
| 57 #include "core/frame/FrameView.h" | 57 #include "core/frame/FrameView.h" |
| 58 #include "core/page/Page.h" | 58 #include "core/page/Page.h" |
| 59 #include "core/frame/Settings.h" | 59 #include "core/frame/Settings.h" |
| 60 #include "core/frame/animation/AnimationController.h" | |
| 61 #include "core/page/scrolling/ScrollingCoordinator.h" | 60 #include "core/page/scrolling/ScrollingCoordinator.h" |
| 62 #include "core/rendering/ColumnInfo.h" | 61 #include "core/rendering/ColumnInfo.h" |
| 63 #include "core/rendering/CompositedLayerMapping.h" | 62 #include "core/rendering/CompositedLayerMapping.h" |
| 64 #include "core/rendering/FilterEffectRenderer.h" | 63 #include "core/rendering/FilterEffectRenderer.h" |
| 65 #include "core/rendering/HitTestRequest.h" | 64 #include "core/rendering/HitTestRequest.h" |
| 66 #include "core/rendering/HitTestResult.h" | 65 #include "core/rendering/HitTestResult.h" |
| 67 #include "core/rendering/HitTestingTransformState.h" | 66 #include "core/rendering/HitTestingTransformState.h" |
| 68 #include "core/rendering/RenderFlowThread.h" | 67 #include "core/rendering/RenderFlowThread.h" |
| 69 #include "core/rendering/RenderGeometryMap.h" | 68 #include "core/rendering/RenderGeometryMap.h" |
| 70 #include "core/rendering/RenderInline.h" | 69 #include "core/rendering/RenderInline.h" |
| (...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 522 | 521 |
| 523 if (had3DTransform != has3DTransform()) | 522 if (had3DTransform != has3DTransform()) |
| 524 dirty3DTransformedDescendantStatus(); | 523 dirty3DTransformedDescendantStatus(); |
| 525 } | 524 } |
| 526 | 525 |
| 527 TransformationMatrix RenderLayer::currentTransform(RenderStyle::ApplyTransformOr
igin applyOrigin) const | 526 TransformationMatrix RenderLayer::currentTransform(RenderStyle::ApplyTransformOr
igin applyOrigin) const |
| 528 { | 527 { |
| 529 if (!m_transform) | 528 if (!m_transform) |
| 530 return TransformationMatrix(); | 529 return TransformationMatrix(); |
| 531 | 530 |
| 532 // FIXME: handle this under web-animations | |
| 533 if (!RuntimeEnabledFeatures::webAnimationsCSSEnabled() && renderer()->style(
)->isRunningAcceleratedAnimation()) { | |
| 534 TransformationMatrix currTransform; | |
| 535 RefPtr<RenderStyle> style = renderer()->animation().getAnimatedStyleForR
enderer(renderer()); | |
| 536 style->applyTransform(currTransform, renderBox()->pixelSnappedBorderBoxR
ect().size(), applyOrigin); | |
| 537 makeMatrixRenderable(currTransform, canRender3DTransforms()); | |
| 538 return currTransform; | |
| 539 } | |
| 540 | |
| 541 // m_transform includes transform-origin, so we need to recompute the transf
orm here. | 531 // m_transform includes transform-origin, so we need to recompute the transf
orm here. |
| 542 if (applyOrigin == RenderStyle::ExcludeTransformOrigin) { | 532 if (applyOrigin == RenderStyle::ExcludeTransformOrigin) { |
| 543 RenderBox* box = renderBox(); | 533 RenderBox* box = renderBox(); |
| 544 TransformationMatrix currTransform; | 534 TransformationMatrix currTransform; |
| 545 box->style()->applyTransform(currTransform, box->pixelSnappedBorderBoxRe
ct().size(), RenderStyle::ExcludeTransformOrigin); | 535 box->style()->applyTransform(currTransform, box->pixelSnappedBorderBoxRe
ct().size(), RenderStyle::ExcludeTransformOrigin); |
| 546 makeMatrixRenderable(currTransform, canRender3DTransforms()); | 536 makeMatrixRenderable(currTransform, canRender3DTransforms()); |
| 547 return currTransform; | 537 return currTransform; |
| 548 } | 538 } |
| 549 | 539 |
| 550 return *m_transform; | 540 return *m_transform; |
| (...skipping 3127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3678 { | 3668 { |
| 3679 ASSERT(newStyle); | 3669 ASSERT(newStyle); |
| 3680 return !hasCompositedLayerMapping() && oldStyle && (oldStyle->overflowX() !=
newStyle->overflowX()) && m_stackingNode->ancestorStackingContainerNode()->laye
r()->hasCompositingDescendant(); | 3670 return !hasCompositedLayerMapping() && oldStyle && (oldStyle->overflowX() !=
newStyle->overflowX()) && m_stackingNode->ancestorStackingContainerNode()->laye
r()->hasCompositingDescendant(); |
| 3681 } | 3671 } |
| 3682 | 3672 |
| 3683 inline bool RenderLayer::needsCompositingLayersRebuiltForFilters(const RenderSty
le* oldStyle, const RenderStyle* newStyle, bool didPaintWithFilters) const | 3673 inline bool RenderLayer::needsCompositingLayersRebuiltForFilters(const RenderSty
le* oldStyle, const RenderStyle* newStyle, bool didPaintWithFilters) const |
| 3684 { | 3674 { |
| 3685 if (!hasOrHadFilters(oldStyle, newStyle)) | 3675 if (!hasOrHadFilters(oldStyle, newStyle)) |
| 3686 return false; | 3676 return false; |
| 3687 | 3677 |
| 3688 if (RuntimeEnabledFeatures::webAnimationsCSSEnabled() | 3678 if (RuntimeEnabledFeatures::webAnimationsCSSEnabled() && hasActiveAnimations
OnCompositor(*renderer(), CSSPropertyWebkitFilter)) { |
| 3689 ? hasActiveAnimationsOnCompositor(*renderer(), CSSPropertyWebkitFilter) | |
| 3690 : renderer()->animation().isRunningAcceleratedAnimationOnRenderer(render
er(), CSSPropertyWebkitFilter)) { | |
| 3691 | 3679 |
| 3692 // When the compositor is performing the filter animation, we shouldn't
touch the compositing layers. | 3680 // When the compositor is performing the filter animation, we shouldn't
touch the compositing layers. |
| 3693 // All of the layers above us should have been promoted to compositing l
ayers already. | 3681 // All of the layers above us should have been promoted to compositing l
ayers already. |
| 3694 return false; | 3682 return false; |
| 3695 } | 3683 } |
| 3696 | 3684 |
| 3697 FilterOutsets newOutsets = newStyle->filterOutsets(); | 3685 FilterOutsets newOutsets = newStyle->filterOutsets(); |
| 3698 if (oldStyle && (oldStyle->filterOutsets() != newOutsets)) { | 3686 if (oldStyle && (oldStyle->filterOutsets() != newOutsets)) { |
| 3699 // When filter outsets change, we need to: | 3687 // When filter outsets change, we need to: |
| 3700 // (1) Recompute the overlap map to promote the correct layers to compos
ited layers. | 3688 // (1) Recompute the overlap map to promote the correct layers to compos
ited layers. |
| (...skipping 25 matching lines...) Expand all Loading... |
| 3726 } | 3714 } |
| 3727 | 3715 |
| 3728 void RenderLayer::updateFilters(const RenderStyle* oldStyle, const RenderStyle*
newStyle) | 3716 void RenderLayer::updateFilters(const RenderStyle* oldStyle, const RenderStyle*
newStyle) |
| 3729 { | 3717 { |
| 3730 if (!hasOrHadFilters(oldStyle, newStyle)) | 3718 if (!hasOrHadFilters(oldStyle, newStyle)) |
| 3731 return; | 3719 return; |
| 3732 | 3720 |
| 3733 updateOrRemoveFilterClients(); | 3721 updateOrRemoveFilterClients(); |
| 3734 // During an accelerated animation, both WebKit and the compositor animate p
roperties. | 3722 // During an accelerated animation, both WebKit and the compositor animate p
roperties. |
| 3735 // However, WebKit shouldn't ask the compositor to update its filters if the
compositor is performing the animation. | 3723 // However, WebKit shouldn't ask the compositor to update its filters if the
compositor is performing the animation. |
| 3736 if (hasCompositedLayerMapping() && (RuntimeEnabledFeatures::webAnimationsCSS
Enabled() | 3724 if (hasCompositedLayerMapping() && !(RuntimeEnabledFeatures::webAnimationsCS
SEnabled() && hasActiveAnimationsOnCompositor(*renderer(), CSSPropertyWebkitFilt
er))) |
| 3737 ? !hasActiveAnimationsOnCompositor(*renderer(), CSSPropertyWebkitFilter) | |
| 3738 : !renderer()->animation().isRunningAcceleratedAnimationOnRenderer(rende
rer(), CSSPropertyWebkitFilter))) | |
| 3739 compositedLayerMapping()->updateFilters(renderer()->style()); | 3725 compositedLayerMapping()->updateFilters(renderer()->style()); |
| 3740 updateOrRemoveFilterEffectRenderer(); | 3726 updateOrRemoveFilterEffectRenderer(); |
| 3741 } | 3727 } |
| 3742 | 3728 |
| 3743 void RenderLayer::styleChanged(StyleDifference diff, const RenderStyle* oldStyle
) | 3729 void RenderLayer::styleChanged(StyleDifference diff, const RenderStyle* oldStyle
) |
| 3744 { | 3730 { |
| 3745 m_stackingNode->updateIsNormalFlowOnly(); | 3731 m_stackingNode->updateIsNormalFlowOnly(); |
| 3746 | 3732 |
| 3747 if (m_scrollableArea) | 3733 if (m_scrollableArea) |
| 3748 m_scrollableArea->updateAfterStyleChange(oldStyle); | 3734 m_scrollableArea->updateAfterStyleChange(oldStyle); |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3930 } | 3916 } |
| 3931 } | 3917 } |
| 3932 | 3918 |
| 3933 void showLayerTree(const WebCore::RenderObject* renderer) | 3919 void showLayerTree(const WebCore::RenderObject* renderer) |
| 3934 { | 3920 { |
| 3935 if (!renderer) | 3921 if (!renderer) |
| 3936 return; | 3922 return; |
| 3937 showLayerTree(renderer->enclosingLayer()); | 3923 showLayerTree(renderer->enclosingLayer()); |
| 3938 } | 3924 } |
| 3939 #endif | 3925 #endif |
| OLD | NEW |