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

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

Issue 13959008: Remove NonCompositedContentHost (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase. add setBackgroundColor to setIsAcceleratedCompositingActive 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
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;
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
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 934 matching lines...) Expand 10 before | Expand all | Expand 10 after
2463 } 2460 }
2464 case RootLayerAttachedViaEnclosingFrame: { 2461 case RootLayerAttachedViaEnclosingFrame: {
2465 // The layer will get hooked up via RenderLayerBacking::updateGraphi csLayerConfiguration() 2462 // The layer will get hooked up via RenderLayerBacking::updateGraphi csLayerConfiguration()
2466 // for the frame's renderer in the parent document. 2463 // for the frame's renderer in the parent document.
2467 m_renderView->document()->ownerElement()->scheduleSyntheticStyleChan ge(); 2464 m_renderView->document()->ownerElement()->scheduleSyntheticStyleChan ge();
2468 break; 2465 break;
2469 } 2466 }
2470 } 2467 }
2471 2468
2472 m_rootLayerAttachment = attachment; 2469 m_rootLayerAttachment = attachment;
2473 rootLayerAttachmentChanged();
2474 } 2470 }
2475 2471
2476 void RenderLayerCompositor::detachRootLayer() 2472 void RenderLayerCompositor::detachRootLayer()
2477 { 2473 {
2478 if (!m_rootContentLayer || m_rootLayerAttachment == RootLayerUnattached) 2474 if (!m_rootContentLayer || m_rootLayerAttachment == RootLayerUnattached)
2479 return; 2475 return;
2480 2476
2481 switch (m_rootLayerAttachment) { 2477 switch (m_rootLayerAttachment) {
2482 case RootLayerAttachedViaEnclosingFrame: { 2478 case RootLayerAttachedViaEnclosingFrame: {
2483 // The layer will get unhooked up via RenderLayerBacking::updateGraphics LayerConfiguration() 2479 // The layer will get unhooked up via RenderLayerBacking::updateGraphics LayerConfiguration()
(...skipping 14 matching lines...) Expand all
2498 return; 2494 return;
2499 2495
2500 page->chrome()->client()->attachRootGraphicsLayer(frame, 0); 2496 page->chrome()->client()->attachRootGraphicsLayer(frame, 0);
2501 } 2497 }
2502 break; 2498 break;
2503 case RootLayerUnattached: 2499 case RootLayerUnattached:
2504 break; 2500 break;
2505 } 2501 }
2506 2502
2507 m_rootLayerAttachment = RootLayerUnattached; 2503 m_rootLayerAttachment = RootLayerUnattached;
2508 rootLayerAttachmentChanged();
2509 } 2504 }
2510 2505
2511 void RenderLayerCompositor::updateRootLayerAttachment() 2506 void RenderLayerCompositor::updateRootLayerAttachment()
2512 { 2507 {
2513 ensureRootLayer(); 2508 ensureRootLayer();
2514 } 2509 }
2515 2510
2516 bool RenderLayerCompositor::isMainFrame() const 2511 bool RenderLayerCompositor::isMainFrame() const
2517 { 2512 {
2518 return !m_renderView->document()->ownerElement(); 2513 return !m_renderView->document()->ownerElement();
2519 } 2514 }
2520 2515
2521 void RenderLayerCompositor::rootLayerAttachmentChanged()
2522 {
2523 // The attachment can affect whether the RenderView layer's paintsIntoWindow () behavior,
2524 // so call updateGraphicsLayerGeometry() to udpate that.
2525 RenderLayer* layer = m_renderView->layer();
2526 if (RenderLayerBacking* backing = layer ? layer->backing() : 0)
2527 backing->updateDrawsContent();
2528 }
2529
2530 // IFrames are special, because we hook compositing layers together across ifram e boundaries 2516 // IFrames are special, because we hook compositing layers together across ifram e boundaries
2531 // when both parent and iframe content are composited. So when this frame become s composited, we have 2517 // when both parent and iframe content are composited. So when this frame become s composited, we have
2532 // to use a synthetic style change to get the iframes into RenderLayers in order to allow them to composite. 2518 // to use a synthetic style change to get the iframes into RenderLayers in order to allow them to composite.
2533 void RenderLayerCompositor::notifyIFramesOfCompositingChange() 2519 void RenderLayerCompositor::notifyIFramesOfCompositingChange()
2534 { 2520 {
2535 Frame* frame = m_renderView->frameView() ? m_renderView->frameView()->frame( ) : 0; 2521 Frame* frame = m_renderView->frameView() ? m_renderView->frameView()->frame( ) : 0;
2536 if (!frame) 2522 if (!frame)
2537 return; 2523 return;
2538 2524
2539 for (Frame* child = frame->tree()->firstChild(); child; child = child->tree( )->traverseNext(frame)) { 2525 for (Frame* child = frame->tree()->firstChild(); child; child = child->tree( )->traverseNext(frame)) {
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
2728 info.addMember(m_layerForScrollCorner, "layerForScrollCorner"); 2714 info.addMember(m_layerForScrollCorner, "layerForScrollCorner");
2729 #if ENABLE(RUBBER_BANDING) 2715 #if ENABLE(RUBBER_BANDING)
2730 info.addMember(m_layerForOverhangAreas, "layerForOverhangAreas"); 2716 info.addMember(m_layerForOverhangAreas, "layerForOverhangAreas");
2731 info.addMember(m_contentShadowLayer, "contentShadowLayer"); 2717 info.addMember(m_contentShadowLayer, "contentShadowLayer");
2732 info.addMember(m_layerForTopOverhangArea, "layerForTopOverhangArea"); 2718 info.addMember(m_layerForTopOverhangArea, "layerForTopOverhangArea");
2733 info.addMember(m_layerForBottomOverhangArea, "layerForBottomOverhangArea"); 2719 info.addMember(m_layerForBottomOverhangArea, "layerForBottomOverhangArea");
2734 #endif 2720 #endif
2735 } 2721 }
2736 2722
2737 } // namespace WebCore 2723 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698