| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009, 2010 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009, 2010 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/RenderLayerCompositor.h" | 28 #include "core/rendering/RenderLayerCompositor.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/dom/FullscreenElementStack.h" | 34 #include "core/dom/FullscreenElementStack.h" |
| 34 #include "core/dom/NodeList.h" | 35 #include "core/dom/NodeList.h" |
| 35 #include "core/html/HTMLCanvasElement.h" | 36 #include "core/html/HTMLCanvasElement.h" |
| 36 #include "core/html/HTMLIFrameElement.h" | 37 #include "core/html/HTMLIFrameElement.h" |
| 37 #include "core/html/HTMLVideoElement.h" | 38 #include "core/html/HTMLVideoElement.h" |
| 38 #include "core/html/canvas/CanvasRenderingContext.h" | 39 #include "core/html/canvas/CanvasRenderingContext.h" |
| 39 #include "core/inspector/InspectorInstrumentation.h" | 40 #include "core/inspector/InspectorInstrumentation.h" |
| 40 #include "core/page/Chrome.h" | 41 #include "core/page/Chrome.h" |
| 41 #include "core/page/ChromeClient.h" | 42 #include "core/page/ChromeClient.h" |
| 42 #include "core/frame/Frame.h" | 43 #include "core/frame/Frame.h" |
| (...skipping 1628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1671 bool RenderLayerCompositor::requiresCompositingForBackfaceVisibilityHidden(Rende
rObject* renderer) const | 1672 bool RenderLayerCompositor::requiresCompositingForBackfaceVisibilityHidden(Rende
rObject* renderer) const |
| 1672 { | 1673 { |
| 1673 return canRender3DTransforms() && renderer->style()->backfaceVisibility() ==
BackfaceVisibilityHidden; | 1674 return canRender3DTransforms() && renderer->style()->backfaceVisibility() ==
BackfaceVisibilityHidden; |
| 1674 } | 1675 } |
| 1675 | 1676 |
| 1676 bool RenderLayerCompositor::requiresCompositingForAnimation(RenderObject* render
er) const | 1677 bool RenderLayerCompositor::requiresCompositingForAnimation(RenderObject* render
er) const |
| 1677 { | 1678 { |
| 1678 if (!(m_compositingTriggers & ChromeClient::AnimationTrigger)) | 1679 if (!(m_compositingTriggers & ChromeClient::AnimationTrigger)) |
| 1679 return false; | 1680 return false; |
| 1680 | 1681 |
| 1681 // FIXME: Remove this condition once force-compositing-mode is enabled on al
l platforms. | 1682 if (!RuntimeEnabledFeatures::webAnimationsEnabled()) { |
| 1682 bool shouldAccelerateOpacity = inCompositingMode(); | 1683 // FIXME: Remove this condition once force-compositing-mode is enabled o
n all platforms. |
| 1683 return renderer->animation().isRunningAcceleratableAnimationOnRenderer(rende
rer, shouldAccelerateOpacity); | 1684 bool shouldAccelerateOpacity = inCompositingMode(); |
| 1685 return renderer->animation().isRunningAcceleratableAnimationOnRenderer(r
enderer, shouldAccelerateOpacity); |
| 1686 } |
| 1687 |
| 1688 return shouldCompositeForActiveAnimations(*renderer, inCompositingMode()); |
| 1684 } | 1689 } |
| 1685 | 1690 |
| 1686 bool RenderLayerCompositor::requiresCompositingForTransition(RenderObject* rende
rer) const | 1691 bool RenderLayerCompositor::requiresCompositingForTransition(RenderObject* rende
rer) const |
| 1687 { | 1692 { |
| 1688 if (!(m_compositingTriggers & ChromeClient::AnimationTrigger)) | 1693 if (!(m_compositingTriggers & ChromeClient::AnimationTrigger)) |
| 1689 return false; | 1694 return false; |
| 1690 | 1695 |
| 1691 if (Settings* settings = m_renderView->document().settings()) { | 1696 if (Settings* settings = m_renderView->document().settings()) { |
| 1692 if (!settings->acceleratedCompositingForTransitionEnabled()) | 1697 if (!settings->acceleratedCompositingForTransitionEnabled()) |
| 1693 return false; | 1698 return false; |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1864 | 1869 |
| 1865 bool RenderLayerCompositor::requiresCompositingForOverflowScrolling(const Render
Layer* layer) const | 1870 bool RenderLayerCompositor::requiresCompositingForOverflowScrolling(const Render
Layer* layer) const |
| 1866 { | 1871 { |
| 1867 return layer->needsCompositedScrolling(); | 1872 return layer->needsCompositedScrolling(); |
| 1868 } | 1873 } |
| 1869 | 1874 |
| 1870 bool RenderLayerCompositor::isRunningAcceleratedTransformAnimation(RenderObject*
renderer) const | 1875 bool RenderLayerCompositor::isRunningAcceleratedTransformAnimation(RenderObject*
renderer) const |
| 1871 { | 1876 { |
| 1872 if (!(m_compositingTriggers & ChromeClient::AnimationTrigger)) | 1877 if (!(m_compositingTriggers & ChromeClient::AnimationTrigger)) |
| 1873 return false; | 1878 return false; |
| 1874 return renderer->animation().isRunningAnimationOnRenderer(renderer, CSSPrope
rtyWebkitTransform); | 1879 if (!RuntimeEnabledFeatures::webAnimationsCSSEnabled()) |
| 1880 return renderer->animation().isRunningAnimationOnRenderer(renderer, CSSP
ropertyWebkitTransform); |
| 1881 return hasActiveAnimations(*renderer, CSSPropertyWebkitTransform); |
| 1875 } | 1882 } |
| 1876 | 1883 |
| 1877 // If an element has negative z-index children, those children render in front o
f the | 1884 // If an element has negative z-index children, those children render in front o
f the |
| 1878 // layer background, so we need an extra 'contents' layer for the foreground of
the layer | 1885 // layer background, so we need an extra 'contents' layer for the foreground of
the layer |
| 1879 // object. | 1886 // object. |
| 1880 bool RenderLayerCompositor::needsContentsCompositingLayer(const RenderLayer* lay
er) const | 1887 bool RenderLayerCompositor::needsContentsCompositingLayer(const RenderLayer* lay
er) const |
| 1881 { | 1888 { |
| 1882 return layer->stackingNode()->hasNegativeZOrderList(); | 1889 return layer->stackingNode()->hasNegativeZOrderList(); |
| 1883 } | 1890 } |
| 1884 | 1891 |
| (...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2447 } else if (graphicsLayer == m_scrollLayer.get()) { | 2454 } else if (graphicsLayer == m_scrollLayer.get()) { |
| 2448 name = "Frame Scrolling Layer"; | 2455 name = "Frame Scrolling Layer"; |
| 2449 } else { | 2456 } else { |
| 2450 ASSERT_NOT_REACHED(); | 2457 ASSERT_NOT_REACHED(); |
| 2451 } | 2458 } |
| 2452 | 2459 |
| 2453 return name; | 2460 return name; |
| 2454 } | 2461 } |
| 2455 | 2462 |
| 2456 } // namespace WebCore | 2463 } // namespace WebCore |
| OLD | NEW |