Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 (!isRunningCompositorAnimation(*renderer(), CSSPropertyWebkitTransform)) |
| 524 updateTransform(renderer()->style()); | 525 updateTransform(renderer()->style()); |
| 525 | 526 |
| 526 // Set opacity, if it is not animating. | 527 // Set opacity, if it is not animating. |
| 527 if (!renderer()->animation().isRunningAcceleratedAnimationOnRenderer(rendere r(), CSSPropertyOpacity)) | 528 if (!isRunningCompositorAnimation(*renderer(), CSSPropertyOpacity)) |
| 528 updateOpacity(renderer()->style()); | 529 updateOpacity(renderer()->style()); |
| 529 | 530 |
| 530 if (RuntimeEnabledFeatures::cssCompositingEnabled()) | 531 if (RuntimeEnabledFeatures::cssCompositingEnabled()) |
| 531 updateLayerBlendMode(renderer()->style()); | 532 updateLayerBlendMode(renderer()->style()); |
| 532 | 533 |
| 533 bool isSimpleContainer = isSimpleContainerCompositingLayer(); | 534 bool isSimpleContainer = isSimpleContainerCompositingLayer(); |
| 534 | 535 |
| 535 m_owningLayer->updateDescendantDependentFlags(); | 536 m_owningLayer->updateDescendantDependentFlags(); |
| 536 | 537 |
| 537 // m_graphicsLayer is the corresponding GraphicsLayer for this RenderLayer a nd its non-compositing | 538 // 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 Loading... | |
| 1919 | 1920 |
| 1920 void CompositedLayerMapping::transitionFinished(CSSPropertyID property) | 1921 void CompositedLayerMapping::transitionFinished(CSSPropertyID property) |
| 1921 { | 1922 { |
| 1922 int animationId = m_animationProvider->getWebAnimationId(property); | 1923 int animationId = m_animationProvider->getWebAnimationId(property); |
| 1923 ASSERT(animationId); | 1924 ASSERT(animationId); |
| 1924 m_graphicsLayer->removeAnimation(animationId); | 1925 m_graphicsLayer->removeAnimation(animationId); |
| 1925 } | 1926 } |
| 1926 | 1927 |
| 1927 void CompositedLayerMapping::notifyAnimationStarted(const GraphicsLayer*, double time) | 1928 void CompositedLayerMapping::notifyAnimationStarted(const GraphicsLayer*, double time) |
| 1928 { | 1929 { |
| 1929 renderer()->animation().notifyAnimationStarted(renderer(), time); | 1930 if (RuntimeEnabledFeatures::webAnimationsEnabled()) |
| 1931 renderer()->node()->document().cssPendingAnimations().notifyCompositorAn imationStarted(monotonicallyIncreasingTime() - (currentTime() - time)); | |
| 1932 else | |
| 1933 renderer()->animation().notifyAnimationStarted(renderer(), time); | |
|
shans
2013/11/18 01:02:06
(Not required for this CL): I think we need to dra
dstockwell
2013/11/18 05:30:34
Will do, but I think we should move as much as we
| |
| 1930 } | 1934 } |
| 1931 | 1935 |
| 1932 IntRect CompositedLayerMapping::compositedBounds() const | 1936 IntRect CompositedLayerMapping::compositedBounds() const |
| 1933 { | 1937 { |
| 1934 return m_compositedBounds; | 1938 return m_compositedBounds; |
| 1935 } | 1939 } |
| 1936 | 1940 |
| 1937 void CompositedLayerMapping::setCompositedBounds(const IntRect& bounds) | 1941 void CompositedLayerMapping::setCompositedBounds(const IntRect& bounds) |
| 1938 { | 1942 { |
| 1939 m_compositedBounds = bounds; | 1943 m_compositedBounds = bounds; |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2006 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { | 2010 } else if (graphicsLayer == m_scrollingContentsLayer.get()) { |
| 2007 name = "Scrolling Contents Layer"; | 2011 name = "Scrolling Contents Layer"; |
| 2008 } else { | 2012 } else { |
| 2009 ASSERT_NOT_REACHED(); | 2013 ASSERT_NOT_REACHED(); |
| 2010 } | 2014 } |
| 2011 | 2015 |
| 2012 return name; | 2016 return name; |
| 2013 } | 2017 } |
| 2014 | 2018 |
| 2015 } // namespace WebCore | 2019 } // namespace WebCore |
| OLD | NEW |