Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Side by Side Diff: Source/core/rendering/RenderLayerCompositor.cpp

Issue 15425006: Revert "Remove NonCompositedContentHost" and follow-up rebaselining. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/rendering/RenderLayerCompositor.h ('k') | Source/core/rendering/RenderObject.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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;
1151 if (Settings* settings = m_renderView->document()->settings()) { 1153 if (Settings* settings = m_renderView->document()->settings()) {
1152 if (isMainFrame() || settings->compositedScrollingForFramesEnabled() ) 1154 if (settings->compositedScrollingForFramesEnabled())
1153 scrollingCoordinator->scrollableAreaScrollLayerDidChange(frameVi ew); 1155 scrollingCoordinator->scrollableAreaScrollLayerDidChange(frameVi ew);
1154 } 1156 }
1155 } 1157 }
1156 1158
1157 m_scrollLayer->setPosition(FloatPoint(-scrollPosition.x(), -scrollPosition.y ())); 1159 m_scrollLayer->setPosition(FloatPoint(-scrollPosition.x(), -scrollPosition.y ()));
1158 1160
1159 if (GraphicsLayer* fixedBackgroundLayer = fixedRootBackgroundLayer()) 1161 if (GraphicsLayer* fixedBackgroundLayer = fixedRootBackgroundLayer())
1160 fixedBackgroundLayer->setPosition(IntPoint(frameView->scrollOffsetForFix edPosition())); 1162 fixedBackgroundLayer->setPosition(IntPoint(frameView->scrollOffsetForFix edPosition()));
1161 } 1163 }
1162 1164
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
1506 // FIXME: We disable accelerated compositing for elements in a RenderFlowThr ead as it doesn't work properly. 1508 // FIXME: We disable accelerated compositing for elements in a RenderFlowThr ead as it doesn't work properly.
1507 // See http://webkit.org/b/84900 to re-enable it. 1509 // See http://webkit.org/b/84900 to re-enable it.
1508 return m_hasAcceleratedCompositing && layer->isSelfPaintingLayer() && layer- >renderer()->flowThreadState() == RenderObject::NotInsideFlowThread; 1510 return m_hasAcceleratedCompositing && layer->isSelfPaintingLayer() && layer- >renderer()->flowThreadState() == RenderObject::NotInsideFlowThread;
1509 } 1511 }
1510 1512
1511 bool RenderLayerCompositor::requiresOwnBackingStore(const RenderLayer* layer, co nst RenderLayer* compositingAncestorLayer) const 1513 bool RenderLayerCompositor::requiresOwnBackingStore(const RenderLayer* layer, co nst RenderLayer* compositingAncestorLayer) const
1512 { 1514 {
1513 RenderObject* renderer = layer->renderer(); 1515 RenderObject* renderer = layer->renderer();
1514 if (compositingAncestorLayer 1516 if (compositingAncestorLayer
1515 && !(compositingAncestorLayer->backing()->graphicsLayer()->drawsContent( ) 1517 && !(compositingAncestorLayer->backing()->graphicsLayer()->drawsContent( )
1518 || compositingAncestorLayer->backing()->paintsIntoWindow()
1516 || compositingAncestorLayer->backing()->paintsIntoCompositedAncestor ())) 1519 || compositingAncestorLayer->backing()->paintsIntoCompositedAncestor ()))
1517 return true; 1520 return true;
1518 1521
1519 if (layer->isRootLayer() 1522 if (layer->isRootLayer()
1520 || layer->transform() // note: excludes perspective and transformStyle3D . 1523 || layer->transform() // note: excludes perspective and transformStyle3D .
1521 || requiresCompositingForVideo(renderer) 1524 || requiresCompositingForVideo(renderer)
1522 || requiresCompositingForCanvas(renderer) 1525 || requiresCompositingForCanvas(renderer)
1523 || requiresCompositingForPlugin(renderer) 1526 || requiresCompositingForPlugin(renderer)
1524 || requiresCompositingForFrame(renderer) 1527 || requiresCompositingForFrame(renderer)
1525 || requiresCompositingForBackfaceVisibilityHidden(renderer) 1528 || requiresCompositingForBackfaceVisibilityHidden(renderer)
(...skipping 956 matching lines...) Expand 10 before | Expand all | Expand 10 after
2482 } 2485 }
2483 case RootLayerAttachedViaEnclosingFrame: { 2486 case RootLayerAttachedViaEnclosingFrame: {
2484 // The layer will get hooked up via RenderLayerBacking::updateGraphi csLayerConfiguration() 2487 // The layer will get hooked up via RenderLayerBacking::updateGraphi csLayerConfiguration()
2485 // for the frame's renderer in the parent document. 2488 // for the frame's renderer in the parent document.
2486 m_renderView->document()->ownerElement()->scheduleSyntheticStyleChan ge(); 2489 m_renderView->document()->ownerElement()->scheduleSyntheticStyleChan ge();
2487 break; 2490 break;
2488 } 2491 }
2489 } 2492 }
2490 2493
2491 m_rootLayerAttachment = attachment; 2494 m_rootLayerAttachment = attachment;
2495 rootLayerAttachmentChanged();
2492 } 2496 }
2493 2497
2494 void RenderLayerCompositor::detachRootLayer() 2498 void RenderLayerCompositor::detachRootLayer()
2495 { 2499 {
2496 if (!m_rootContentLayer || m_rootLayerAttachment == RootLayerUnattached) 2500 if (!m_rootContentLayer || m_rootLayerAttachment == RootLayerUnattached)
2497 return; 2501 return;
2498 2502
2499 switch (m_rootLayerAttachment) { 2503 switch (m_rootLayerAttachment) {
2500 case RootLayerAttachedViaEnclosingFrame: { 2504 case RootLayerAttachedViaEnclosingFrame: {
2501 // The layer will get unhooked up via RenderLayerBacking::updateGraphics LayerConfiguration() 2505 // The layer will get unhooked up via RenderLayerBacking::updateGraphics LayerConfiguration()
(...skipping 14 matching lines...) Expand all
2516 return; 2520 return;
2517 2521
2518 page->chrome()->client()->attachRootGraphicsLayer(frame, 0); 2522 page->chrome()->client()->attachRootGraphicsLayer(frame, 0);
2519 } 2523 }
2520 break; 2524 break;
2521 case RootLayerUnattached: 2525 case RootLayerUnattached:
2522 break; 2526 break;
2523 } 2527 }
2524 2528
2525 m_rootLayerAttachment = RootLayerUnattached; 2529 m_rootLayerAttachment = RootLayerUnattached;
2530 rootLayerAttachmentChanged();
2526 } 2531 }
2527 2532
2528 void RenderLayerCompositor::updateRootLayerAttachment() 2533 void RenderLayerCompositor::updateRootLayerAttachment()
2529 { 2534 {
2530 ensureRootLayer(); 2535 ensureRootLayer();
2531 } 2536 }
2532 2537
2533 bool RenderLayerCompositor::isMainFrame() const 2538 bool RenderLayerCompositor::isMainFrame() const
2534 { 2539 {
2535 return !m_renderView->document()->ownerElement(); 2540 return !m_renderView->document()->ownerElement();
2536 } 2541 }
2537 2542
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
2538 // IFrames are special, because we hook compositing layers together across ifram e boundaries 2552 // IFrames are special, because we hook compositing layers together across ifram e boundaries
2539 // when both parent and iframe content are composited. So when this frame become s composited, we have 2553 // when both parent and iframe content are composited. So when this frame become s composited, we have
2540 // to use a synthetic style change to get the iframes into RenderLayers in order to allow them to composite. 2554 // to use a synthetic style change to get the iframes into RenderLayers in order to allow them to composite.
2541 void RenderLayerCompositor::notifyIFramesOfCompositingChange() 2555 void RenderLayerCompositor::notifyIFramesOfCompositingChange()
2542 { 2556 {
2543 Frame* frame = m_renderView->frameView() ? m_renderView->frameView()->frame( ) : 0; 2557 Frame* frame = m_renderView->frameView() ? m_renderView->frameView()->frame( ) : 0;
2544 if (!frame) 2558 if (!frame)
2545 return; 2559 return;
2546 2560
2547 for (Frame* child = frame->tree()->firstChild(); child; child = child->tree( )->traverseNext(frame)) { 2561 for (Frame* child = frame->tree()->firstChild(); child; child = child->tree( )->traverseNext(frame)) {
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
2736 info.addMember(m_layerForScrollCorner, "layerForScrollCorner"); 2750 info.addMember(m_layerForScrollCorner, "layerForScrollCorner");
2737 #if ENABLE(RUBBER_BANDING) 2751 #if ENABLE(RUBBER_BANDING)
2738 info.addMember(m_layerForOverhangAreas, "layerForOverhangAreas"); 2752 info.addMember(m_layerForOverhangAreas, "layerForOverhangAreas");
2739 info.addMember(m_contentShadowLayer, "contentShadowLayer"); 2753 info.addMember(m_contentShadowLayer, "contentShadowLayer");
2740 info.addMember(m_layerForTopOverhangArea, "layerForTopOverhangArea"); 2754 info.addMember(m_layerForTopOverhangArea, "layerForTopOverhangArea");
2741 info.addMember(m_layerForBottomOverhangArea, "layerForBottomOverhangArea"); 2755 info.addMember(m_layerForBottomOverhangArea, "layerForBottomOverhangArea");
2742 #endif 2756 #endif
2743 } 2757 }
2744 2758
2745 } // namespace WebCore 2759 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderLayerCompositor.h ('k') | Source/core/rendering/RenderObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698