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

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

Issue 23874019: Web Animations CSS: Start running animations on the compositor (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Cleanup isRunning* and shouldCompositeForAnimation Created 7 years, 1 month 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 30 matching lines...) Expand all
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
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
Steve Block 2013/11/18 05:03:03 How does this affect behavior? Is it flag-flip blo
dstockwell 2013/11/18 06:11:20 Unclear, needs further investigation :(
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
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 (isRunningCompositorAnimation(*renderer(), CSSPropertyWebkitFilter)) {
3923 // When the compositor is performing the filter animation, we shouldn't touch the compositing layers. 3925 // 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. 3926 // All of the layers above us should have been promoted to compositing l ayers already.
3925 return false; 3927 return false;
3926 } 3928 }
3927 3929
3928 FilterOutsets newOutsets = newStyle->filterOutsets(); 3930 FilterOutsets newOutsets = newStyle->filterOutsets();
3929 if (oldStyle && (oldStyle->filterOutsets() != newOutsets)) { 3931 if (oldStyle && (oldStyle->filterOutsets() != newOutsets)) {
3930 // When filter outsets change, we need to: 3932 // When filter outsets change, we need to:
3931 // (1) Recompute the overlap map to promote the correct layers to compos ited layers. 3933 // (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 3934 // (2) Update the composited layer bounds (and child GraphicsLayer posit ions) on platforms
(...skipping 15 matching lines...) Expand all
3948 } 3950 }
3949 3951
3950 void RenderLayer::updateFilters(const RenderStyle* oldStyle, const RenderStyle* newStyle) 3952 void RenderLayer::updateFilters(const RenderStyle* oldStyle, const RenderStyle* newStyle)
3951 { 3953 {
3952 if (!hasOrHadFilters(oldStyle, newStyle)) 3954 if (!hasOrHadFilters(oldStyle, newStyle))
3953 return; 3955 return;
3954 3956
3955 updateOrRemoveFilterClients(); 3957 updateOrRemoveFilterClients();
3956 // During an accelerated animation, both WebKit and the compositor animate p roperties. 3958 // 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. 3959 // 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); 3960 if (hasCompositedLayerMapping() && !isRunningCompositorAnimation(*renderer() , CSSPropertyWebkitFilter))
3959 if (shouldUpdateFilters)
3960 compositedLayerMapping()->updateFilters(renderer()->style()); 3961 compositedLayerMapping()->updateFilters(renderer()->style());
3961 updateOrRemoveFilterEffectRenderer(); 3962 updateOrRemoveFilterEffectRenderer();
3962 } 3963 }
3963 3964
3964 void RenderLayer::styleChanged(StyleDifference, const RenderStyle* oldStyle) 3965 void RenderLayer::styleChanged(StyleDifference, const RenderStyle* oldStyle)
3965 { 3966 {
3966 m_stackingNode->updateIsNormalFlowOnly(); 3967 m_stackingNode->updateIsNormalFlowOnly();
3967 3968
3968 if (m_scrollableArea) 3969 if (m_scrollableArea)
3969 m_scrollableArea->updateAfterStyleChange(oldStyle); 3970 m_scrollableArea->updateAfterStyleChange(oldStyle);
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
4165 } 4166 }
4166 } 4167 }
4167 4168
4168 void showLayerTree(const WebCore::RenderObject* renderer) 4169 void showLayerTree(const WebCore::RenderObject* renderer)
4169 { 4170 {
4170 if (!renderer) 4171 if (!renderer)
4171 return; 4172 return;
4172 showLayerTree(renderer->enclosingLayer()); 4173 showLayerTree(renderer->enclosingLayer());
4173 } 4174 }
4174 #endif 4175 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698