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 1124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1135 { | 1135 { |
1136 FrameView* frameView = m_renderView->frameView(); | 1136 FrameView* frameView = m_renderView->frameView(); |
1137 IntPoint scrollPosition = frameView->scrollPosition(); | 1137 IntPoint scrollPosition = frameView->scrollPosition(); |
1138 | 1138 |
1139 if (!m_scrollLayer) | 1139 if (!m_scrollLayer) |
1140 return; | 1140 return; |
1141 | 1141 |
1142 // If there's a scrolling coordinator that manages scrolling for this frame
view, | 1142 // If there's a scrolling coordinator that manages scrolling for this frame
view, |
1143 // it will also manage updating the scroll layer position. | 1143 // it will also manage updating the scroll layer position. |
1144 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator(
)) { | 1144 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator(
)) { |
1145 if (scrollingCoordinator->coordinatesScrollingForFrameView(frameView)) | |
1146 return; | |
1147 if (Settings* settings = m_renderView->document()->settings()) { | 1145 if (Settings* settings = m_renderView->document()->settings()) { |
1148 if (settings->compositedScrollingForFramesEnabled()) | 1146 if (isMainFrame() || settings->compositedScrollingForFramesEnabled()
) |
1149 scrollingCoordinator->scrollableAreaScrollLayerDidChange(frameVi
ew); | 1147 scrollingCoordinator->scrollableAreaScrollLayerDidChange(frameVi
ew); |
1150 } | 1148 } |
1151 } | 1149 } |
1152 | 1150 |
1153 m_scrollLayer->setPosition(FloatPoint(-scrollPosition.x(), -scrollPosition.y
())); | 1151 m_scrollLayer->setPosition(FloatPoint(-scrollPosition.x(), -scrollPosition.y
())); |
1154 | 1152 |
1155 if (GraphicsLayer* fixedBackgroundLayer = fixedRootBackgroundLayer()) | 1153 if (GraphicsLayer* fixedBackgroundLayer = fixedRootBackgroundLayer()) |
1156 fixedBackgroundLayer->setPosition(IntPoint(frameView->scrollOffsetForFix
edPosition())); | 1154 fixedBackgroundLayer->setPosition(IntPoint(frameView->scrollOffsetForFix
edPosition())); |
1157 } | 1155 } |
1158 | 1156 |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1502 // FIXME: We disable accelerated compositing for elements in a RenderFlowThr
ead as it doesn't work properly. | 1500 // FIXME: We disable accelerated compositing for elements in a RenderFlowThr
ead as it doesn't work properly. |
1503 // See http://webkit.org/b/84900 to re-enable it. | 1501 // See http://webkit.org/b/84900 to re-enable it. |
1504 return m_hasAcceleratedCompositing && layer->isSelfPaintingLayer() && layer-
>renderer()->flowThreadState() == RenderObject::NotInsideFlowThread; | 1502 return m_hasAcceleratedCompositing && layer->isSelfPaintingLayer() && layer-
>renderer()->flowThreadState() == RenderObject::NotInsideFlowThread; |
1505 } | 1503 } |
1506 | 1504 |
1507 bool RenderLayerCompositor::requiresOwnBackingStore(const RenderLayer* layer, co
nst RenderLayer* compositingAncestorLayer) const | 1505 bool RenderLayerCompositor::requiresOwnBackingStore(const RenderLayer* layer, co
nst RenderLayer* compositingAncestorLayer) const |
1508 { | 1506 { |
1509 RenderObject* renderer = layer->renderer(); | 1507 RenderObject* renderer = layer->renderer(); |
1510 if (compositingAncestorLayer | 1508 if (compositingAncestorLayer |
1511 && !(compositingAncestorLayer->backing()->graphicsLayer()->drawsContent(
) | 1509 && !(compositingAncestorLayer->backing()->graphicsLayer()->drawsContent(
) |
1512 || compositingAncestorLayer->backing()->paintsIntoWindow() | |
1513 || compositingAncestorLayer->backing()->paintsIntoCompositedAncestor
())) | 1510 || compositingAncestorLayer->backing()->paintsIntoCompositedAncestor
())) |
1514 return true; | 1511 return true; |
1515 | 1512 |
1516 if (layer->isRootLayer() | 1513 if (layer->isRootLayer() |
1517 || layer->transform() // note: excludes perspective and transformStyle3D
. | 1514 || layer->transform() // note: excludes perspective and transformStyle3D
. |
1518 || requiresCompositingForVideo(renderer) | 1515 || requiresCompositingForVideo(renderer) |
1519 || requiresCompositingForCanvas(renderer) | 1516 || requiresCompositingForCanvas(renderer) |
1520 || requiresCompositingForPlugin(renderer) | 1517 || requiresCompositingForPlugin(renderer) |
1521 || requiresCompositingForFrame(renderer) | 1518 || requiresCompositingForFrame(renderer) |
1522 || requiresCompositingForBackfaceVisibilityHidden(renderer) | 1519 || requiresCompositingForBackfaceVisibilityHidden(renderer) |
(...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2476 } | 2473 } |
2477 case RootLayerAttachedViaEnclosingFrame: { | 2474 case RootLayerAttachedViaEnclosingFrame: { |
2478 // The layer will get hooked up via RenderLayerBacking::updateGraphi
csLayerConfiguration() | 2475 // The layer will get hooked up via RenderLayerBacking::updateGraphi
csLayerConfiguration() |
2479 // for the frame's renderer in the parent document. | 2476 // for the frame's renderer in the parent document. |
2480 m_renderView->document()->ownerElement()->scheduleSyntheticStyleChan
ge(); | 2477 m_renderView->document()->ownerElement()->scheduleSyntheticStyleChan
ge(); |
2481 break; | 2478 break; |
2482 } | 2479 } |
2483 } | 2480 } |
2484 | 2481 |
2485 m_rootLayerAttachment = attachment; | 2482 m_rootLayerAttachment = attachment; |
2486 rootLayerAttachmentChanged(); | |
2487 } | 2483 } |
2488 | 2484 |
2489 void RenderLayerCompositor::detachRootLayer() | 2485 void RenderLayerCompositor::detachRootLayer() |
2490 { | 2486 { |
2491 if (!m_rootContentLayer || m_rootLayerAttachment == RootLayerUnattached) | 2487 if (!m_rootContentLayer || m_rootLayerAttachment == RootLayerUnattached) |
2492 return; | 2488 return; |
2493 | 2489 |
2494 switch (m_rootLayerAttachment) { | 2490 switch (m_rootLayerAttachment) { |
2495 case RootLayerAttachedViaEnclosingFrame: { | 2491 case RootLayerAttachedViaEnclosingFrame: { |
2496 // The layer will get unhooked up via RenderLayerBacking::updateGraphics
LayerConfiguration() | 2492 // The layer will get unhooked up via RenderLayerBacking::updateGraphics
LayerConfiguration() |
(...skipping 14 matching lines...) Expand all Loading... |
2511 return; | 2507 return; |
2512 | 2508 |
2513 page->chrome().client()->attachRootGraphicsLayer(frame, 0); | 2509 page->chrome().client()->attachRootGraphicsLayer(frame, 0); |
2514 } | 2510 } |
2515 break; | 2511 break; |
2516 case RootLayerUnattached: | 2512 case RootLayerUnattached: |
2517 break; | 2513 break; |
2518 } | 2514 } |
2519 | 2515 |
2520 m_rootLayerAttachment = RootLayerUnattached; | 2516 m_rootLayerAttachment = RootLayerUnattached; |
2521 rootLayerAttachmentChanged(); | |
2522 } | 2517 } |
2523 | 2518 |
2524 void RenderLayerCompositor::updateRootLayerAttachment() | 2519 void RenderLayerCompositor::updateRootLayerAttachment() |
2525 { | 2520 { |
2526 ensureRootLayer(); | 2521 ensureRootLayer(); |
2527 } | 2522 } |
2528 | 2523 |
2529 bool RenderLayerCompositor::isMainFrame() const | 2524 bool RenderLayerCompositor::isMainFrame() const |
2530 { | 2525 { |
2531 return !m_renderView->document()->ownerElement(); | 2526 return !m_renderView->document()->ownerElement(); |
2532 } | 2527 } |
2533 | 2528 |
2534 void RenderLayerCompositor::rootLayerAttachmentChanged() | |
2535 { | |
2536 // The attachment can affect whether the RenderView layer's paintsIntoWindow
() behavior, | |
2537 // so call updateGraphicsLayerGeometry() to udpate that. | |
2538 RenderLayer* layer = m_renderView->layer(); | |
2539 if (RenderLayerBacking* backing = layer ? layer->backing() : 0) | |
2540 backing->updateDrawsContent(); | |
2541 } | |
2542 | |
2543 // IFrames are special, because we hook compositing layers together across ifram
e boundaries | 2529 // IFrames are special, because we hook compositing layers together across ifram
e boundaries |
2544 // when both parent and iframe content are composited. So when this frame become
s composited, we have | 2530 // when both parent and iframe content are composited. So when this frame become
s composited, we have |
2545 // to use a synthetic style change to get the iframes into RenderLayers in order
to allow them to composite. | 2531 // to use a synthetic style change to get the iframes into RenderLayers in order
to allow them to composite. |
2546 void RenderLayerCompositor::notifyIFramesOfCompositingChange() | 2532 void RenderLayerCompositor::notifyIFramesOfCompositingChange() |
2547 { | 2533 { |
2548 Frame* frame = m_renderView->frameView() ? m_renderView->frameView()->frame(
) : 0; | 2534 Frame* frame = m_renderView->frameView() ? m_renderView->frameView()->frame(
) : 0; |
2549 if (!frame) | 2535 if (!frame) |
2550 return; | 2536 return; |
2551 | 2537 |
2552 for (Frame* child = frame->tree()->firstChild(); child; child = child->tree(
)->traverseNext(frame)) { | 2538 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... |
2741 info.addMember(m_layerForScrollCorner, "layerForScrollCorner"); | 2727 info.addMember(m_layerForScrollCorner, "layerForScrollCorner"); |
2742 #if ENABLE(RUBBER_BANDING) | 2728 #if ENABLE(RUBBER_BANDING) |
2743 info.addMember(m_layerForOverhangAreas, "layerForOverhangAreas"); | 2729 info.addMember(m_layerForOverhangAreas, "layerForOverhangAreas"); |
2744 info.addMember(m_contentShadowLayer, "contentShadowLayer"); | 2730 info.addMember(m_contentShadowLayer, "contentShadowLayer"); |
2745 info.addMember(m_layerForTopOverhangArea, "layerForTopOverhangArea"); | 2731 info.addMember(m_layerForTopOverhangArea, "layerForTopOverhangArea"); |
2746 info.addMember(m_layerForBottomOverhangArea, "layerForBottomOverhangArea"); | 2732 info.addMember(m_layerForBottomOverhangArea, "layerForBottomOverhangArea"); |
2747 #endif | 2733 #endif |
2748 } | 2734 } |
2749 | 2735 |
2750 } // namespace WebCore | 2736 } // namespace WebCore |
OLD | NEW |