Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Side by Side Diff: Source/core/rendering/RenderLayer.cpp

Issue 139273007: Web Animations: Remove legacy animations engine. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix TestExpectations. Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
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/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/frame/DeprecatedScheduleStyleRecalcDuringLayout.h" 55 #include "core/frame/DeprecatedScheduleStyleRecalcDuringLayout.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/frame/Settings.h" 58 #include "core/frame/Settings.h"
59 #include "core/frame/animation/AnimationController.h"
60 #include "core/html/HTMLFrameElement.h" 59 #include "core/html/HTMLFrameElement.h"
61 #include "core/page/Page.h" 60 #include "core/page/Page.h"
62 #include "core/page/scrolling/ScrollingCoordinator.h" 61 #include "core/page/scrolling/ScrollingCoordinator.h"
63 #include "core/rendering/ColumnInfo.h" 62 #include "core/rendering/ColumnInfo.h"
64 #include "core/rendering/CompositedLayerMapping.h" 63 #include "core/rendering/CompositedLayerMapping.h"
65 #include "core/rendering/FilterEffectRenderer.h" 64 #include "core/rendering/FilterEffectRenderer.h"
66 #include "core/rendering/HitTestRequest.h" 65 #include "core/rendering/HitTestRequest.h"
67 #include "core/rendering/HitTestResult.h" 66 #include "core/rendering/HitTestResult.h"
68 #include "core/rendering/HitTestingTransformState.h" 67 #include "core/rendering/HitTestingTransformState.h"
69 #include "core/rendering/RenderFlowThread.h" 68 #include "core/rendering/RenderFlowThread.h"
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after
557 m_3dRenderingContextRoot = ancestorLayer->renderingContextRoot() ; 556 m_3dRenderingContextRoot = ancestorLayer->renderingContextRoot() ;
558 } 557 }
559 } 558 }
560 } 559 }
561 560
562 TransformationMatrix RenderLayer::currentTransform(RenderStyle::ApplyTransformOr igin applyOrigin) const 561 TransformationMatrix RenderLayer::currentTransform(RenderStyle::ApplyTransformOr igin applyOrigin) const
563 { 562 {
564 if (!m_transform) 563 if (!m_transform)
565 return TransformationMatrix(); 564 return TransformationMatrix();
566 565
567 // FIXME: handle this under web-animations
568 if (!RuntimeEnabledFeatures::webAnimationsCSSEnabled() && renderer()->style( )->isRunningAcceleratedAnimation()) {
569 TransformationMatrix currTransform;
570 RefPtr<RenderStyle> style = renderer()->animation().getAnimatedStyleForR enderer(renderer());
571 style->applyTransform(currTransform, renderBox()->pixelSnappedBorderBoxR ect().size(), applyOrigin);
572 makeMatrixRenderable(currTransform, canRender3DTransforms());
573 return currTransform;
574 }
575
576 // m_transform includes transform-origin, so we need to recompute the transf orm here. 566 // m_transform includes transform-origin, so we need to recompute the transf orm here.
577 if (applyOrigin == RenderStyle::ExcludeTransformOrigin) { 567 if (applyOrigin == RenderStyle::ExcludeTransformOrigin) {
578 RenderBox* box = renderBox(); 568 RenderBox* box = renderBox();
579 TransformationMatrix currTransform; 569 TransformationMatrix currTransform;
580 box->style()->applyTransform(currTransform, box->pixelSnappedBorderBoxRe ct().size(), RenderStyle::ExcludeTransformOrigin); 570 box->style()->applyTransform(currTransform, box->pixelSnappedBorderBoxRe ct().size(), RenderStyle::ExcludeTransformOrigin);
581 makeMatrixRenderable(currTransform, canRender3DTransforms()); 571 makeMatrixRenderable(currTransform, canRender3DTransforms());
582 return currTransform; 572 return currTransform;
583 } 573 }
584 574
585 return *m_transform; 575 return *m_transform;
(...skipping 3158 matching lines...) Expand 10 before | Expand all | Expand 10 after
3744 { 3734 {
3745 ASSERT(newStyle); 3735 ASSERT(newStyle);
3746 return !hasCompositedLayerMapping() && oldStyle && (oldStyle->overflowX() != newStyle->overflowX()) && m_stackingNode->ancestorStackingContainerNode()->laye r()->hasCompositingDescendant(); 3736 return !hasCompositedLayerMapping() && oldStyle && (oldStyle->overflowX() != newStyle->overflowX()) && m_stackingNode->ancestorStackingContainerNode()->laye r()->hasCompositingDescendant();
3747 } 3737 }
3748 3738
3749 inline bool RenderLayer::needsCompositingLayersRebuiltForFilters(const RenderSty le* oldStyle, const RenderStyle* newStyle, bool didPaintWithFilters) const 3739 inline bool RenderLayer::needsCompositingLayersRebuiltForFilters(const RenderSty le* oldStyle, const RenderStyle* newStyle, bool didPaintWithFilters) const
3750 { 3740 {
3751 if (!hasOrHadFilters(oldStyle, newStyle)) 3741 if (!hasOrHadFilters(oldStyle, newStyle))
3752 return false; 3742 return false;
3753 3743
3754 if (RuntimeEnabledFeatures::webAnimationsCSSEnabled() 3744 if (RuntimeEnabledFeatures::webAnimationsCSSEnabled() && hasActiveAnimations OnCompositor(*renderer(), CSSPropertyWebkitFilter)) {
3755 ? hasActiveAnimationsOnCompositor(*renderer(), CSSPropertyWebkitFilter)
3756 : renderer()->animation().isRunningAcceleratedAnimationOnRenderer(render er(), CSSPropertyWebkitFilter)) {
3757 3745
3758 // When the compositor is performing the filter animation, we shouldn't touch the compositing layers. 3746 // When the compositor is performing the filter animation, we shouldn't touch the compositing layers.
3759 // All of the layers above us should have been promoted to compositing l ayers already. 3747 // All of the layers above us should have been promoted to compositing l ayers already.
3760 return false; 3748 return false;
3761 } 3749 }
3762 3750
3763 FilterOutsets newOutsets = newStyle->filterOutsets(); 3751 FilterOutsets newOutsets = newStyle->filterOutsets();
3764 if (oldStyle && (oldStyle->filterOutsets() != newOutsets)) { 3752 if (oldStyle && (oldStyle->filterOutsets() != newOutsets)) {
3765 // When filter outsets change, we need to: 3753 // When filter outsets change, we need to:
3766 // (1) Recompute the overlap map to promote the correct layers to compos ited layers. 3754 // (1) Recompute the overlap map to promote the correct layers to compos ited layers.
(...skipping 25 matching lines...) Expand all
3792 } 3780 }
3793 3781
3794 void RenderLayer::updateFilters(const RenderStyle* oldStyle, const RenderStyle* newStyle) 3782 void RenderLayer::updateFilters(const RenderStyle* oldStyle, const RenderStyle* newStyle)
3795 { 3783 {
3796 if (!hasOrHadFilters(oldStyle, newStyle)) 3784 if (!hasOrHadFilters(oldStyle, newStyle))
3797 return; 3785 return;
3798 3786
3799 updateOrRemoveFilterClients(); 3787 updateOrRemoveFilterClients();
3800 // During an accelerated animation, both WebKit and the compositor animate p roperties. 3788 // During an accelerated animation, both WebKit and the compositor animate p roperties.
3801 // However, WebKit shouldn't ask the compositor to update its filters if the compositor is performing the animation. 3789 // However, WebKit shouldn't ask the compositor to update its filters if the compositor is performing the animation.
3802 if (hasCompositedLayerMapping() && (RuntimeEnabledFeatures::webAnimationsCSS Enabled() 3790 if (hasCompositedLayerMapping() && !(RuntimeEnabledFeatures::webAnimationsCS SEnabled() && hasActiveAnimationsOnCompositor(*renderer(), CSSPropertyWebkitFilt er)))
3803 ? !hasActiveAnimationsOnCompositor(*renderer(), CSSPropertyWebkitFilter)
3804 : !renderer()->animation().isRunningAcceleratedAnimationOnRenderer(rende rer(), CSSPropertyWebkitFilter)))
3805 compositedLayerMapping()->updateFilters(renderer()->style()); 3791 compositedLayerMapping()->updateFilters(renderer()->style());
3806 updateOrRemoveFilterEffectRenderer(); 3792 updateOrRemoveFilterEffectRenderer();
3807 } 3793 }
3808 3794
3809 void RenderLayer::styleChanged(StyleDifference diff, const RenderStyle* oldStyle ) 3795 void RenderLayer::styleChanged(StyleDifference diff, const RenderStyle* oldStyle )
3810 { 3796 {
3811 m_stackingNode->updateIsNormalFlowOnly(); 3797 m_stackingNode->updateIsNormalFlowOnly();
3812 3798
3813 if (m_scrollableArea) 3799 if (m_scrollableArea)
3814 m_scrollableArea->updateAfterStyleChange(oldStyle); 3800 m_scrollableArea->updateAfterStyleChange(oldStyle);
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
4018 } 4004 }
4019 } 4005 }
4020 4006
4021 void showLayerTree(const WebCore::RenderObject* renderer) 4007 void showLayerTree(const WebCore::RenderObject* renderer)
4022 { 4008 {
4023 if (!renderer) 4009 if (!renderer)
4024 return; 4010 return;
4025 showLayerTree(renderer->enclosingLayer()); 4011 showLayerTree(renderer->enclosingLayer());
4026 } 4012 }
4027 #endif 4013 #endif
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderBoxModelObject.cpp ('k') | Source/core/rendering/RenderLayerCompositor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698