| 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 1130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1141 { | 1141 { |
| 1142 FrameView* frameView = m_renderView->frameView(); | 1142 FrameView* frameView = m_renderView->frameView(); |
| 1143 IntPoint scrollPosition = frameView->scrollPosition(); | 1143 IntPoint scrollPosition = frameView->scrollPosition(); |
| 1144 | 1144 |
| 1145 if (!m_scrollLayer) | 1145 if (!m_scrollLayer) |
| 1146 return; | 1146 return; |
| 1147 | 1147 |
| 1148 // If there's a scrolling coordinator that manages scrolling for this frame
view, | 1148 // If there's a scrolling coordinator that manages scrolling for this frame
view, |
| 1149 // it will also manage updating the scroll layer position. | 1149 // it will also manage updating the scroll layer position. |
| 1150 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator(
)) { | 1150 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator(
)) { |
| 1151 if (scrollingCoordinator->coordinatesScrollingForFrameView(frameView)) | |
| 1152 return; | |
| 1153 if (Settings* settings = m_renderView->document()->settings()) { | 1151 if (Settings* settings = m_renderView->document()->settings()) { |
| 1154 if (settings->compositedScrollingForFramesEnabled()) | 1152 if (isMainFrame() || settings->compositedScrollingForFramesEnabled()
) |
| 1155 scrollingCoordinator->scrollableAreaScrollLayerDidChange(frameVi
ew); | 1153 scrollingCoordinator->scrollableAreaScrollLayerDidChange(frameVi
ew); |
| 1156 } | 1154 } |
| 1157 } | 1155 } |
| 1158 | 1156 |
| 1159 m_scrollLayer->setPosition(FloatPoint(-scrollPosition.x(), -scrollPosition.y
())); | 1157 m_scrollLayer->setPosition(FloatPoint(-scrollPosition.x(), -scrollPosition.y
())); |
| 1160 | 1158 |
| 1161 if (GraphicsLayer* fixedBackgroundLayer = fixedRootBackgroundLayer()) | 1159 if (GraphicsLayer* fixedBackgroundLayer = fixedRootBackgroundLayer()) |
| 1162 fixedBackgroundLayer->setPosition(IntPoint(frameView->scrollOffsetForFix
edPosition())); | 1160 fixedBackgroundLayer->setPosition(IntPoint(frameView->scrollOffsetForFix
edPosition())); |
| 1163 } | 1161 } |
| 1164 | 1162 |
| (...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1508 // FIXME: We disable accelerated compositing for elements in a RenderFlowThr
ead as it doesn't work properly. | 1506 // FIXME: We disable accelerated compositing for elements in a RenderFlowThr
ead as it doesn't work properly. |
| 1509 // See http://webkit.org/b/84900 to re-enable it. | 1507 // See http://webkit.org/b/84900 to re-enable it. |
| 1510 return m_hasAcceleratedCompositing && layer->isSelfPaintingLayer() && layer-
>renderer()->flowThreadState() == RenderObject::NotInsideFlowThread; | 1508 return m_hasAcceleratedCompositing && layer->isSelfPaintingLayer() && layer-
>renderer()->flowThreadState() == RenderObject::NotInsideFlowThread; |
| 1511 } | 1509 } |
| 1512 | 1510 |
| 1513 bool RenderLayerCompositor::requiresOwnBackingStore(const RenderLayer* layer, co
nst RenderLayer* compositingAncestorLayer) const | 1511 bool RenderLayerCompositor::requiresOwnBackingStore(const RenderLayer* layer, co
nst RenderLayer* compositingAncestorLayer) const |
| 1514 { | 1512 { |
| 1515 RenderObject* renderer = layer->renderer(); | 1513 RenderObject* renderer = layer->renderer(); |
| 1516 if (compositingAncestorLayer | 1514 if (compositingAncestorLayer |
| 1517 && !(compositingAncestorLayer->backing()->graphicsLayer()->drawsContent(
) | 1515 && !(compositingAncestorLayer->backing()->graphicsLayer()->drawsContent(
) |
| 1518 || compositingAncestorLayer->backing()->paintsIntoWindow() | |
| 1519 || compositingAncestorLayer->backing()->paintsIntoCompositedAncestor
())) | 1516 || compositingAncestorLayer->backing()->paintsIntoCompositedAncestor
())) |
| 1520 return true; | 1517 return true; |
| 1521 | 1518 |
| 1522 if (layer->isRootLayer() | 1519 if (layer->isRootLayer() |
| 1523 || layer->transform() // note: excludes perspective and transformStyle3D
. | 1520 || layer->transform() // note: excludes perspective and transformStyle3D
. |
| 1524 || requiresCompositingForVideo(renderer) | 1521 || requiresCompositingForVideo(renderer) |
| 1525 || requiresCompositingForCanvas(renderer) | 1522 || requiresCompositingForCanvas(renderer) |
| 1526 || requiresCompositingForPlugin(renderer) | 1523 || requiresCompositingForPlugin(renderer) |
| 1527 || requiresCompositingForFrame(renderer) | 1524 || requiresCompositingForFrame(renderer) |
| 1528 || requiresCompositingForBackfaceVisibilityHidden(renderer) | 1525 || requiresCompositingForBackfaceVisibilityHidden(renderer) |
| (...skipping 956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2485 } | 2482 } |
| 2486 case RootLayerAttachedViaEnclosingFrame: { | 2483 case RootLayerAttachedViaEnclosingFrame: { |
| 2487 // The layer will get hooked up via RenderLayerBacking::updateGraphi
csLayerConfiguration() | 2484 // The layer will get hooked up via RenderLayerBacking::updateGraphi
csLayerConfiguration() |
| 2488 // for the frame's renderer in the parent document. | 2485 // for the frame's renderer in the parent document. |
| 2489 m_renderView->document()->ownerElement()->scheduleSyntheticStyleChan
ge(); | 2486 m_renderView->document()->ownerElement()->scheduleSyntheticStyleChan
ge(); |
| 2490 break; | 2487 break; |
| 2491 } | 2488 } |
| 2492 } | 2489 } |
| 2493 | 2490 |
| 2494 m_rootLayerAttachment = attachment; | 2491 m_rootLayerAttachment = attachment; |
| 2495 rootLayerAttachmentChanged(); | |
| 2496 } | 2492 } |
| 2497 | 2493 |
| 2498 void RenderLayerCompositor::detachRootLayer() | 2494 void RenderLayerCompositor::detachRootLayer() |
| 2499 { | 2495 { |
| 2500 if (!m_rootContentLayer || m_rootLayerAttachment == RootLayerUnattached) | 2496 if (!m_rootContentLayer || m_rootLayerAttachment == RootLayerUnattached) |
| 2501 return; | 2497 return; |
| 2502 | 2498 |
| 2503 switch (m_rootLayerAttachment) { | 2499 switch (m_rootLayerAttachment) { |
| 2504 case RootLayerAttachedViaEnclosingFrame: { | 2500 case RootLayerAttachedViaEnclosingFrame: { |
| 2505 // The layer will get unhooked up via RenderLayerBacking::updateGraphics
LayerConfiguration() | 2501 // The layer will get unhooked up via RenderLayerBacking::updateGraphics
LayerConfiguration() |
| (...skipping 14 matching lines...) Expand all Loading... |
| 2520 return; | 2516 return; |
| 2521 | 2517 |
| 2522 page->chrome()->client()->attachRootGraphicsLayer(frame, 0); | 2518 page->chrome()->client()->attachRootGraphicsLayer(frame, 0); |
| 2523 } | 2519 } |
| 2524 break; | 2520 break; |
| 2525 case RootLayerUnattached: | 2521 case RootLayerUnattached: |
| 2526 break; | 2522 break; |
| 2527 } | 2523 } |
| 2528 | 2524 |
| 2529 m_rootLayerAttachment = RootLayerUnattached; | 2525 m_rootLayerAttachment = RootLayerUnattached; |
| 2530 rootLayerAttachmentChanged(); | |
| 2531 } | 2526 } |
| 2532 | 2527 |
| 2533 void RenderLayerCompositor::updateRootLayerAttachment() | 2528 void RenderLayerCompositor::updateRootLayerAttachment() |
| 2534 { | 2529 { |
| 2535 ensureRootLayer(); | 2530 ensureRootLayer(); |
| 2536 } | 2531 } |
| 2537 | 2532 |
| 2538 bool RenderLayerCompositor::isMainFrame() const | 2533 bool RenderLayerCompositor::isMainFrame() const |
| 2539 { | 2534 { |
| 2540 return !m_renderView->document()->ownerElement(); | 2535 return !m_renderView->document()->ownerElement(); |
| 2541 } | 2536 } |
| 2542 | 2537 |
| 2543 void RenderLayerCompositor::rootLayerAttachmentChanged() | |
| 2544 { | |
| 2545 // The attachment can affect whether the RenderView layer's paintsIntoWindow
() behavior, | |
| 2546 // so call updateGraphicsLayerGeometry() to udpate that. | |
| 2547 RenderLayer* layer = m_renderView->layer(); | |
| 2548 if (RenderLayerBacking* backing = layer ? layer->backing() : 0) | |
| 2549 backing->updateDrawsContent(); | |
| 2550 } | |
| 2551 | |
| 2552 // IFrames are special, because we hook compositing layers together across ifram
e boundaries | 2538 // IFrames are special, because we hook compositing layers together across ifram
e boundaries |
| 2553 // when both parent and iframe content are composited. So when this frame become
s composited, we have | 2539 // when both parent and iframe content are composited. So when this frame become
s composited, we have |
| 2554 // to use a synthetic style change to get the iframes into RenderLayers in order
to allow them to composite. | 2540 // to use a synthetic style change to get the iframes into RenderLayers in order
to allow them to composite. |
| 2555 void RenderLayerCompositor::notifyIFramesOfCompositingChange() | 2541 void RenderLayerCompositor::notifyIFramesOfCompositingChange() |
| 2556 { | 2542 { |
| 2557 Frame* frame = m_renderView->frameView() ? m_renderView->frameView()->frame(
) : 0; | 2543 Frame* frame = m_renderView->frameView() ? m_renderView->frameView()->frame(
) : 0; |
| 2558 if (!frame) | 2544 if (!frame) |
| 2559 return; | 2545 return; |
| 2560 | 2546 |
| 2561 for (Frame* child = frame->tree()->firstChild(); child; child = child->tree(
)->traverseNext(frame)) { | 2547 for (Frame* child = frame->tree()->firstChild(); child; child = child->tree(
)->traverseNext(frame)) { |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2750 info.addMember(m_layerForScrollCorner, "layerForScrollCorner"); | 2736 info.addMember(m_layerForScrollCorner, "layerForScrollCorner"); |
| 2751 #if ENABLE(RUBBER_BANDING) | 2737 #if ENABLE(RUBBER_BANDING) |
| 2752 info.addMember(m_layerForOverhangAreas, "layerForOverhangAreas"); | 2738 info.addMember(m_layerForOverhangAreas, "layerForOverhangAreas"); |
| 2753 info.addMember(m_contentShadowLayer, "contentShadowLayer"); | 2739 info.addMember(m_contentShadowLayer, "contentShadowLayer"); |
| 2754 info.addMember(m_layerForTopOverhangArea, "layerForTopOverhangArea"); | 2740 info.addMember(m_layerForTopOverhangArea, "layerForTopOverhangArea"); |
| 2755 info.addMember(m_layerForBottomOverhangArea, "layerForBottomOverhangArea"); | 2741 info.addMember(m_layerForBottomOverhangArea, "layerForBottomOverhangArea"); |
| 2756 #endif | 2742 #endif |
| 2757 } | 2743 } |
| 2758 | 2744 |
| 2759 } // namespace WebCore | 2745 } // namespace WebCore |
| OLD | NEW |