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

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

Issue 23874019: Web Animations CSS: Start running animations on the compositor (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase and rename hasActiveAnimationOnCompositor to hasActiveAnimationsOnCompositor 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
« no previous file with comments | « Source/core/frame/FrameView.cpp ('k') | Source/core/rendering/RenderLayer.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 12 matching lines...) Expand all
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25 25
26 #include "config.h" 26 #include "config.h"
27 27
28 #include "core/rendering/CompositedLayerMapping.h" 28 #include "core/rendering/CompositedLayerMapping.h"
29 29
30 #include "CSSPropertyNames.h" 30 #include "CSSPropertyNames.h"
31 #include "HTMLNames.h" 31 #include "HTMLNames.h"
32 #include "RuntimeEnabledFeatures.h" 32 #include "RuntimeEnabledFeatures.h"
33 #include "core/animation/ActiveAnimations.h"
33 #include "core/fetch/ImageResource.h" 34 #include "core/fetch/ImageResource.h"
34 #include "core/html/HTMLIFrameElement.h" 35 #include "core/html/HTMLIFrameElement.h"
35 #include "core/html/HTMLMediaElement.h" 36 #include "core/html/HTMLMediaElement.h"
36 #include "core/html/canvas/CanvasRenderingContext.h" 37 #include "core/html/canvas/CanvasRenderingContext.h"
37 #include "core/inspector/InspectorInstrumentation.h" 38 #include "core/inspector/InspectorInstrumentation.h"
38 #include "core/page/Chrome.h" 39 #include "core/page/Chrome.h"
39 #include "core/frame/FrameView.h" 40 #include "core/frame/FrameView.h"
40 #include "core/page/Settings.h" 41 #include "core/page/Settings.h"
41 #include "core/frame/animation/AnimationController.h" 42 #include "core/frame/animation/AnimationController.h"
42 #include "core/page/scrolling/ScrollingCoordinator.h" 43 #include "core/page/scrolling/ScrollingCoordinator.h"
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
513 } 514 }
514 515
515 void CompositedLayerMapping::updateGraphicsLayerGeometry() 516 void CompositedLayerMapping::updateGraphicsLayerGeometry()
516 { 517 {
517 // If we haven't built z-order lists yet, wait until later. 518 // If we haven't built z-order lists yet, wait until later.
518 if (m_owningLayer->stackingNode()->isStackingContainer() && m_owningLayer->s tackingNode()->zOrderListsDirty()) 519 if (m_owningLayer->stackingNode()->isStackingContainer() && m_owningLayer->s tackingNode()->zOrderListsDirty())
519 return; 520 return;
520 521
521 // Set transform property, if it is not animating. We have to do this here b ecause the transform 522 // Set transform property, if it is not animating. We have to do this here b ecause the transform
522 // is affected by the layer dimensions. 523 // is affected by the layer dimensions.
523 if (!renderer()->animation().isRunningAcceleratedAnimationOnRenderer(rendere r(), CSSPropertyWebkitTransform)) 524 if (RuntimeEnabledFeatures::webAnimationsCSSEnabled()
525 ? !hasActiveAnimationsOnCompositor(*renderer(), CSSPropertyWebkitTransfo rm)
526 : !renderer()->animation().isRunningAcceleratedAnimationOnRenderer(rende rer(), CSSPropertyWebkitTransform))
524 updateTransform(renderer()->style()); 527 updateTransform(renderer()->style());
525 528
526 // Set opacity, if it is not animating. 529 // Set opacity, if it is not animating.
527 if (!renderer()->animation().isRunningAcceleratedAnimationOnRenderer(rendere r(), CSSPropertyOpacity)) 530 if (RuntimeEnabledFeatures::webAnimationsCSSEnabled()
531 ? !hasActiveAnimationsOnCompositor(*renderer(), CSSPropertyOpacity)
532 : !renderer()->animation().isRunningAcceleratedAnimationOnRenderer(rende rer(), CSSPropertyOpacity))
528 updateOpacity(renderer()->style()); 533 updateOpacity(renderer()->style());
529 534
530 if (RuntimeEnabledFeatures::cssCompositingEnabled()) 535 if (RuntimeEnabledFeatures::cssCompositingEnabled())
531 updateLayerBlendMode(renderer()->style()); 536 updateLayerBlendMode(renderer()->style());
532 537
533 bool isSimpleContainer = isSimpleContainerCompositingLayer(); 538 bool isSimpleContainer = isSimpleContainerCompositingLayer();
534 539
535 m_owningLayer->updateDescendantDependentFlags(); 540 m_owningLayer->updateDescendantDependentFlags();
536 541
537 // m_graphicsLayer is the corresponding GraphicsLayer for this RenderLayer a nd its non-compositing 542 // m_graphicsLayer is the corresponding GraphicsLayer for this RenderLayer a nd its non-compositing
(...skipping 1381 matching lines...) Expand 10 before | Expand all | Expand 10 after
1919 1924
1920 void CompositedLayerMapping::transitionFinished(CSSPropertyID property) 1925 void CompositedLayerMapping::transitionFinished(CSSPropertyID property)
1921 { 1926 {
1922 int animationId = m_animationProvider->getWebAnimationId(property); 1927 int animationId = m_animationProvider->getWebAnimationId(property);
1923 ASSERT(animationId); 1928 ASSERT(animationId);
1924 m_graphicsLayer->removeAnimation(animationId); 1929 m_graphicsLayer->removeAnimation(animationId);
1925 } 1930 }
1926 1931
1927 void CompositedLayerMapping::notifyAnimationStarted(const GraphicsLayer*, double time) 1932 void CompositedLayerMapping::notifyAnimationStarted(const GraphicsLayer*, double time)
1928 { 1933 {
1929 renderer()->animation().notifyAnimationStarted(renderer(), time); 1934 if (RuntimeEnabledFeatures::webAnimationsEnabled())
1935 renderer()->node()->document().cssPendingAnimations().notifyCompositorAn imationStarted(monotonicallyIncreasingTime() - (currentTime() - time));
1936 else
1937 renderer()->animation().notifyAnimationStarted(renderer(), time);
1930 } 1938 }
1931 1939
1932 IntRect CompositedLayerMapping::compositedBounds() const 1940 IntRect CompositedLayerMapping::compositedBounds() const
1933 { 1941 {
1934 return m_compositedBounds; 1942 return m_compositedBounds;
1935 } 1943 }
1936 1944
1937 void CompositedLayerMapping::setCompositedBounds(const IntRect& bounds) 1945 void CompositedLayerMapping::setCompositedBounds(const IntRect& bounds)
1938 { 1946 {
1939 m_compositedBounds = bounds; 1947 m_compositedBounds = bounds;
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
2006 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { 2014 } else if (graphicsLayer == m_scrollingContentsLayer.get()) {
2007 name = "Scrolling Contents Layer"; 2015 name = "Scrolling Contents Layer";
2008 } else { 2016 } else {
2009 ASSERT_NOT_REACHED(); 2017 ASSERT_NOT_REACHED();
2010 } 2018 }
2011 2019
2012 return name; 2020 return name;
2013 } 2021 }
2014 2022
2015 } // namespace WebCore 2023 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/frame/FrameView.cpp ('k') | Source/core/rendering/RenderLayer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698