| 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 1627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1670 | 1671 |
| 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 return renderer->animation().isRunningAcceleratableAnimationOnRenderer(rende
rer); | 1681 |
| 1682 if (!RuntimeEnabledFeatures::webAnimationsEnabled()) |
| 1683 return renderer->animation().isRunningAcceleratableAnimationOnRenderer(r
enderer); |
| 1684 |
| 1685 if (!renderer->node() || !renderer->node()->isElementNode()) |
| 1686 return false; |
| 1687 |
| 1688 if (const ActiveAnimations* activeAnimations = toElement(renderer->node())->
activeAnimations()) |
| 1689 return activeAnimations->hasCandidateForCompositorAnimation(); |
| 1690 |
| 1691 return false; |
| 1681 } | 1692 } |
| 1682 | 1693 |
| 1683 bool RenderLayerCompositor::requiresCompositingForTransition(RenderObject* rende
rer) const | 1694 bool RenderLayerCompositor::requiresCompositingForTransition(RenderObject* rende
rer) const |
| 1684 { | 1695 { |
| 1685 if (!(m_compositingTriggers & ChromeClient::AnimationTrigger)) | 1696 if (!(m_compositingTriggers & ChromeClient::AnimationTrigger)) |
| 1686 return false; | 1697 return false; |
| 1687 | 1698 |
| 1688 if (Settings* settings = m_renderView->document().settings()) { | 1699 if (Settings* settings = m_renderView->document().settings()) { |
| 1689 if (!settings->acceleratedCompositingForTransitionEnabled()) | 1700 if (!settings->acceleratedCompositingForTransitionEnabled()) |
| 1690 return false; | 1701 return false; |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1861 | 1872 |
| 1862 bool RenderLayerCompositor::requiresCompositingForOverflowScrolling(const Render
Layer* layer) const | 1873 bool RenderLayerCompositor::requiresCompositingForOverflowScrolling(const Render
Layer* layer) const |
| 1863 { | 1874 { |
| 1864 return layer->needsCompositedScrolling(); | 1875 return layer->needsCompositedScrolling(); |
| 1865 } | 1876 } |
| 1866 | 1877 |
| 1867 bool RenderLayerCompositor::isRunningAcceleratedTransformAnimation(RenderObject*
renderer) const | 1878 bool RenderLayerCompositor::isRunningAcceleratedTransformAnimation(RenderObject*
renderer) const |
| 1868 { | 1879 { |
| 1869 if (!(m_compositingTriggers & ChromeClient::AnimationTrigger)) | 1880 if (!(m_compositingTriggers & ChromeClient::AnimationTrigger)) |
| 1870 return false; | 1881 return false; |
| 1871 return renderer->animation().isRunningAnimationOnRenderer(renderer, CSSPrope
rtyWebkitTransform); | 1882 return isRunningCompositorAnimation(*renderer, CSSPropertyWebkitTransform); |
| 1872 } | 1883 } |
| 1873 | 1884 |
| 1874 // If an element has negative z-index children, those children render in front o
f the | 1885 // If an element has negative z-index children, those children render in front o
f the |
| 1875 // layer background, so we need an extra 'contents' layer for the foreground of
the layer | 1886 // layer background, so we need an extra 'contents' layer for the foreground of
the layer |
| 1876 // object. | 1887 // object. |
| 1877 bool RenderLayerCompositor::needsContentsCompositingLayer(const RenderLayer* lay
er) const | 1888 bool RenderLayerCompositor::needsContentsCompositingLayer(const RenderLayer* lay
er) const |
| 1878 { | 1889 { |
| 1879 return layer->stackingNode()->hasNegativeZOrderList(); | 1890 return layer->stackingNode()->hasNegativeZOrderList(); |
| 1880 } | 1891 } |
| 1881 | 1892 |
| (...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2444 } else if (graphicsLayer == m_scrollLayer.get()) { | 2455 } else if (graphicsLayer == m_scrollLayer.get()) { |
| 2445 name = "Frame Scrolling Layer"; | 2456 name = "Frame Scrolling Layer"; |
| 2446 } else { | 2457 } else { |
| 2447 ASSERT_NOT_REACHED(); | 2458 ASSERT_NOT_REACHED(); |
| 2448 } | 2459 } |
| 2449 | 2460 |
| 2450 return name; | 2461 return name; |
| 2451 } | 2462 } |
| 2452 | 2463 |
| 2453 } // namespace WebCore | 2464 } // namespace WebCore |
| OLD | NEW |