| 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 20 matching lines...) Expand all Loading... |
| 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/animation/ActiveAnimations.h" |
| 34 #include "core/animation/DocumentAnimations.h" | 34 #include "core/animation/DocumentAnimations.h" |
| 35 #include "core/dom/FullscreenElementStack.h" | 35 #include "core/dom/FullscreenElementStack.h" |
| 36 #include "core/dom/NodeList.h" | 36 #include "core/dom/NodeList.h" |
| 37 #include "core/frame/DeprecatedScheduleStyleRecalcDuringCompositingUpdate.h" | 37 #include "core/frame/DeprecatedScheduleStyleRecalcDuringCompositingUpdate.h" |
| 38 #include "core/frame/Frame.h" | 38 #include "core/frame/Frame.h" |
| 39 #include "core/frame/FrameView.h" | 39 #include "core/frame/FrameView.h" |
| 40 #include "core/frame/Settings.h" | 40 #include "core/frame/Settings.h" |
| 41 #include "core/frame/animation/AnimationController.h" | |
| 42 #include "core/html/HTMLCanvasElement.h" | 41 #include "core/html/HTMLCanvasElement.h" |
| 43 #include "core/html/HTMLIFrameElement.h" | 42 #include "core/html/HTMLIFrameElement.h" |
| 44 #include "core/html/HTMLMediaElement.h" | 43 #include "core/html/HTMLMediaElement.h" |
| 45 #include "core/html/canvas/CanvasRenderingContext.h" | 44 #include "core/html/canvas/CanvasRenderingContext.h" |
| 46 #include "core/inspector/InspectorInstrumentation.h" | 45 #include "core/inspector/InspectorInstrumentation.h" |
| 47 #include "core/page/Chrome.h" | 46 #include "core/page/Chrome.h" |
| 48 #include "core/page/Page.h" | 47 #include "core/page/Page.h" |
| 49 #include "core/page/scrolling/ScrollingConstraints.h" | 48 #include "core/page/scrolling/ScrollingConstraints.h" |
| 50 #include "core/page/scrolling/ScrollingCoordinator.h" | 49 #include "core/page/scrolling/ScrollingCoordinator.h" |
| 51 #include "core/rendering/CompositedLayerMapping.h" | 50 #include "core/rendering/CompositedLayerMapping.h" |
| (...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 | 405 |
| 407 if (isMainFrame() && m_renderView->frameView()) | 406 if (isMainFrame() && m_renderView->frameView()) |
| 408 finishCompositingUpdateForFrameTree(&m_renderView->frameView()->frame())
; | 407 finishCompositingUpdateForFrameTree(&m_renderView->frameView()->frame())
; |
| 409 | 408 |
| 410 if (m_forceCompositingMode && !m_compositing) | 409 if (m_forceCompositingMode && !m_compositing) |
| 411 enableCompositingMode(true); | 410 enableCompositingMode(true); |
| 412 | 411 |
| 413 if (!m_needsToRecomputeCompositingRequirements && !m_compositing) | 412 if (!m_needsToRecomputeCompositingRequirements && !m_compositing) |
| 414 return; | 413 return; |
| 415 | 414 |
| 416 AnimationUpdateBlock animationUpdateBlock(m_renderView->frameView()->frame()
.animation()); | |
| 417 | |
| 418 TemporaryChange<bool> postLayoutChange(m_inPostLayoutUpdate, true); | 415 TemporaryChange<bool> postLayoutChange(m_inPostLayoutUpdate, true); |
| 419 | 416 |
| 420 bool needCompositingRequirementsUpdate = m_needsToRecomputeCompositingRequir
ements; | 417 bool needCompositingRequirementsUpdate = m_needsToRecomputeCompositingRequir
ements; |
| 421 bool needHierarchyAndGeometryUpdate = m_compositingLayersNeedRebuild; | 418 bool needHierarchyAndGeometryUpdate = m_compositingLayersNeedRebuild; |
| 422 bool needGeometryUpdate = m_needsToUpdateLayerTreeGeometry; | 419 bool needGeometryUpdate = m_needsToUpdateLayerTreeGeometry; |
| 423 bool needsToUpdateScrollingCoordinator = scrollingCoordinator() ? scrollingC
oordinator()->needsToUpdateAfterCompositingChange() : false; | 420 bool needsToUpdateScrollingCoordinator = scrollingCoordinator() ? scrollingC
oordinator()->needsToUpdateAfterCompositingChange() : false; |
| 424 | 421 |
| 425 if (!needCompositingRequirementsUpdate && !needHierarchyAndGeometryUpdate &&
!needGeometryUpdate && !needsToUpdateScrollingCoordinator) | 422 if (!needCompositingRequirementsUpdate && !needHierarchyAndGeometryUpdate &&
!needGeometryUpdate && !needsToUpdateScrollingCoordinator) |
| 426 return; | 423 return; |
| 427 | 424 |
| (...skipping 1434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1862 bool RenderLayerCompositor::requiresCompositingForBackfaceVisibilityHidden(Rende
rObject* renderer) const | 1859 bool RenderLayerCompositor::requiresCompositingForBackfaceVisibilityHidden(Rende
rObject* renderer) const |
| 1863 { | 1860 { |
| 1864 return canRender3DTransforms() && renderer->style()->backfaceVisibility() ==
BackfaceVisibilityHidden; | 1861 return canRender3DTransforms() && renderer->style()->backfaceVisibility() ==
BackfaceVisibilityHidden; |
| 1865 } | 1862 } |
| 1866 | 1863 |
| 1867 bool RenderLayerCompositor::requiresCompositingForAnimation(RenderObject* render
er) const | 1864 bool RenderLayerCompositor::requiresCompositingForAnimation(RenderObject* render
er) const |
| 1868 { | 1865 { |
| 1869 if (!(m_compositingTriggers & ChromeClient::AnimationTrigger)) | 1866 if (!(m_compositingTriggers & ChromeClient::AnimationTrigger)) |
| 1870 return false; | 1867 return false; |
| 1871 | 1868 |
| 1872 if (!RuntimeEnabledFeatures::webAnimationsCSSEnabled()) | |
| 1873 return renderer->animation().isRunningAcceleratableAnimationOnRenderer(r
enderer); | |
| 1874 | |
| 1875 return shouldCompositeForActiveAnimations(*renderer); | 1869 return shouldCompositeForActiveAnimations(*renderer); |
| 1876 } | 1870 } |
| 1877 | 1871 |
| 1878 bool RenderLayerCompositor::requiresCompositingForTransition(RenderObject* rende
rer) const | 1872 bool RenderLayerCompositor::requiresCompositingForTransition(RenderObject* rende
rer) const |
| 1879 { | 1873 { |
| 1880 if (!(m_compositingTriggers & ChromeClient::AnimationTrigger)) | 1874 if (!(m_compositingTriggers & ChromeClient::AnimationTrigger)) |
| 1881 return false; | 1875 return false; |
| 1882 | 1876 |
| 1883 if (Settings* settings = m_renderView->document().settings()) { | 1877 if (Settings* settings = m_renderView->document().settings()) { |
| 1884 if (!settings->acceleratedCompositingForTransitionEnabled()) | 1878 if (!settings->acceleratedCompositingForTransitionEnabled()) |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2079 | 2073 |
| 2080 bool RenderLayerCompositor::requiresCompositingForOverflowScrolling(const Render
Layer* layer) const | 2074 bool RenderLayerCompositor::requiresCompositingForOverflowScrolling(const Render
Layer* layer) const |
| 2081 { | 2075 { |
| 2082 return layer->needsCompositedScrolling(); | 2076 return layer->needsCompositedScrolling(); |
| 2083 } | 2077 } |
| 2084 | 2078 |
| 2085 bool RenderLayerCompositor::isRunningAcceleratedTransformAnimation(RenderObject*
renderer) const | 2079 bool RenderLayerCompositor::isRunningAcceleratedTransformAnimation(RenderObject*
renderer) const |
| 2086 { | 2080 { |
| 2087 if (!(m_compositingTriggers & ChromeClient::AnimationTrigger)) | 2081 if (!(m_compositingTriggers & ChromeClient::AnimationTrigger)) |
| 2088 return false; | 2082 return false; |
| 2089 if (!RuntimeEnabledFeatures::webAnimationsCSSEnabled()) | |
| 2090 return renderer->animation().isRunningAnimationOnRenderer(renderer, CSSP
ropertyWebkitTransform); | |
| 2091 return hasActiveAnimations(*renderer, CSSPropertyWebkitTransform); | 2083 return hasActiveAnimations(*renderer, CSSPropertyWebkitTransform); |
| 2092 } | 2084 } |
| 2093 | 2085 |
| 2094 // If an element has negative z-index children, those children render in front o
f the | 2086 // If an element has negative z-index children, those children render in front o
f the |
| 2095 // layer background, so we need an extra 'contents' layer for the foreground of
the layer | 2087 // layer background, so we need an extra 'contents' layer for the foreground of
the layer |
| 2096 // object. | 2088 // object. |
| 2097 bool RenderLayerCompositor::needsContentsCompositingLayer(const RenderLayer* lay
er) const | 2089 bool RenderLayerCompositor::needsContentsCompositingLayer(const RenderLayer* lay
er) const |
| 2098 { | 2090 { |
| 2099 return layer->stackingNode()->hasNegativeZOrderList(); | 2091 return layer->stackingNode()->hasNegativeZOrderList(); |
| 2100 } | 2092 } |
| (...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2662 } else if (graphicsLayer == m_scrollLayer.get()) { | 2654 } else if (graphicsLayer == m_scrollLayer.get()) { |
| 2663 name = "Frame Scrolling Layer"; | 2655 name = "Frame Scrolling Layer"; |
| 2664 } else { | 2656 } else { |
| 2665 ASSERT_NOT_REACHED(); | 2657 ASSERT_NOT_REACHED(); |
| 2666 } | 2658 } |
| 2667 | 2659 |
| 2668 return name; | 2660 return name; |
| 2669 } | 2661 } |
| 2670 | 2662 |
| 2671 } // namespace WebCore | 2663 } // namespace WebCore |
| OLD | NEW |