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

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

Issue 13959008: Remove NonCompositedContentHost (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Adding back LCD text workaround Created 7 years, 8 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 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after
1081 { 1081 {
1082 FrameView* frameView = m_renderView->frameView(); 1082 FrameView* frameView = m_renderView->frameView();
1083 IntPoint scrollPosition = frameView->scrollPosition(); 1083 IntPoint scrollPosition = frameView->scrollPosition();
1084 1084
1085 if (!m_scrollLayer) 1085 if (!m_scrollLayer)
1086 return; 1086 return;
1087 1087
1088 // If there's a scrolling coordinator that manages scrolling for this frame view, 1088 // If there's a scrolling coordinator that manages scrolling for this frame view,
1089 // it will also manage updating the scroll layer position. 1089 // it will also manage updating the scroll layer position.
1090 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator( )) { 1090 if (ScrollingCoordinator* scrollingCoordinator = this->scrollingCoordinator( )) {
1091 if (scrollingCoordinator->coordinatesScrollingForFrameView(frameView))
1092 return;
1093 if (Settings* settings = m_renderView->document()->settings()) { 1091 if (Settings* settings = m_renderView->document()->settings()) {
1094 if (settings->compositedScrollingForFramesEnabled()) 1092 if (isMainFrame() || settings->compositedScrollingForFramesEnabled() )
1095 scrollingCoordinator->scrollableAreaScrollLayerDidChange(frameVi ew); 1093 scrollingCoordinator->scrollableAreaScrollLayerDidChange(frameVi ew);
1096 } 1094 }
1097 } 1095 }
1098 1096
1099 m_scrollLayer->setPosition(FloatPoint(-scrollPosition.x(), -scrollPosition.y ())); 1097 m_scrollLayer->setPosition(FloatPoint(-scrollPosition.x(), -scrollPosition.y ()));
1100 1098
1101 if (GraphicsLayer* fixedBackgroundLayer = fixedRootBackgroundLayer()) 1099 if (GraphicsLayer* fixedBackgroundLayer = fixedRootBackgroundLayer())
1102 fixedBackgroundLayer->setPosition(IntPoint(frameView->scrollOffsetForFix edPosition())); 1100 fixedBackgroundLayer->setPosition(IntPoint(frameView->scrollOffsetForFix edPosition()));
1103 } 1101 }
1104 1102
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
1474 // FIXME: We disable accelerated compositing for elements in a RenderFlowThr ead as it doesn't work properly. 1472 // FIXME: We disable accelerated compositing for elements in a RenderFlowThr ead as it doesn't work properly.
1475 // See http://webkit.org/b/84900 to re-enable it. 1473 // See http://webkit.org/b/84900 to re-enable it.
1476 return m_hasAcceleratedCompositing && layer->isSelfPaintingLayer() && layer- >renderer()->flowThreadState() == RenderObject::NotInsideFlowThread; 1474 return m_hasAcceleratedCompositing && layer->isSelfPaintingLayer() && layer- >renderer()->flowThreadState() == RenderObject::NotInsideFlowThread;
1477 } 1475 }
1478 1476
1479 bool RenderLayerCompositor::requiresOwnBackingStore(const RenderLayer* layer, co nst RenderLayer* compositingAncestorLayer) const 1477 bool RenderLayerCompositor::requiresOwnBackingStore(const RenderLayer* layer, co nst RenderLayer* compositingAncestorLayer) const
1480 { 1478 {
1481 RenderObject* renderer = layer->renderer(); 1479 RenderObject* renderer = layer->renderer();
1482 if (compositingAncestorLayer 1480 if (compositingAncestorLayer
1483 && !(compositingAncestorLayer->backing()->graphicsLayer()->drawsContent( ) 1481 && !(compositingAncestorLayer->backing()->graphicsLayer()->drawsContent( )
1484 || compositingAncestorLayer->backing()->paintsIntoWindow()
1485 || compositingAncestorLayer->backing()->paintsIntoCompositedAncestor ())) 1482 || compositingAncestorLayer->backing()->paintsIntoCompositedAncestor ()))
1486 return true; 1483 return true;
1487 1484
1488 if (layer->isRootLayer() 1485 if (layer->isRootLayer()
1489 || layer->transform() // note: excludes perspective and transformStyle3D . 1486 || layer->transform() // note: excludes perspective and transformStyle3D .
1490 || requiresCompositingForVideo(renderer) 1487 || requiresCompositingForVideo(renderer)
1491 || requiresCompositingForCanvas(renderer) 1488 || requiresCompositingForCanvas(renderer)
1492 || requiresCompositingForPlugin(renderer) 1489 || requiresCompositingForPlugin(renderer)
1493 || requiresCompositingForFrame(renderer) 1490 || requiresCompositingForFrame(renderer)
1494 || (canRender3DTransforms() && renderer->style()->backfaceVisibility() = = BackfaceVisibilityHidden) 1491 || (canRender3DTransforms() && renderer->style()->backfaceVisibility() = = BackfaceVisibilityHidden)
(...skipping 945 matching lines...) Expand 10 before | Expand all | Expand 10 after
2440 } 2437 }
2441 case RootLayerAttachedViaEnclosingFrame: { 2438 case RootLayerAttachedViaEnclosingFrame: {
2442 // The layer will get hooked up via RenderLayerBacking::updateGraphi csLayerConfiguration() 2439 // The layer will get hooked up via RenderLayerBacking::updateGraphi csLayerConfiguration()
2443 // for the frame's renderer in the parent document. 2440 // for the frame's renderer in the parent document.
2444 m_renderView->document()->ownerElement()->scheduleSetNeedsStyleRecal c(SyntheticStyleChange); 2441 m_renderView->document()->ownerElement()->scheduleSetNeedsStyleRecal c(SyntheticStyleChange);
2445 break; 2442 break;
2446 } 2443 }
2447 } 2444 }
2448 2445
2449 m_rootLayerAttachment = attachment; 2446 m_rootLayerAttachment = attachment;
2450 rootLayerAttachmentChanged();
2451 } 2447 }
2452 2448
2453 void RenderLayerCompositor::detachRootLayer() 2449 void RenderLayerCompositor::detachRootLayer()
2454 { 2450 {
2455 if (!m_rootContentLayer || m_rootLayerAttachment == RootLayerUnattached) 2451 if (!m_rootContentLayer || m_rootLayerAttachment == RootLayerUnattached)
2456 return; 2452 return;
2457 2453
2458 switch (m_rootLayerAttachment) { 2454 switch (m_rootLayerAttachment) {
2459 case RootLayerAttachedViaEnclosingFrame: { 2455 case RootLayerAttachedViaEnclosingFrame: {
2460 // The layer will get unhooked up via RenderLayerBacking::updateGraphics LayerConfiguration() 2456 // The layer will get unhooked up via RenderLayerBacking::updateGraphics LayerConfiguration()
(...skipping 14 matching lines...) Expand all
2475 return; 2471 return;
2476 2472
2477 page->chrome()->client()->attachRootGraphicsLayer(frame, 0); 2473 page->chrome()->client()->attachRootGraphicsLayer(frame, 0);
2478 } 2474 }
2479 break; 2475 break;
2480 case RootLayerUnattached: 2476 case RootLayerUnattached:
2481 break; 2477 break;
2482 } 2478 }
2483 2479
2484 m_rootLayerAttachment = RootLayerUnattached; 2480 m_rootLayerAttachment = RootLayerUnattached;
2485 rootLayerAttachmentChanged();
2486 } 2481 }
2487 2482
2488 void RenderLayerCompositor::updateRootLayerAttachment() 2483 void RenderLayerCompositor::updateRootLayerAttachment()
2489 { 2484 {
2490 ensureRootLayer(); 2485 ensureRootLayer();
2491 } 2486 }
2492 2487
2493 bool RenderLayerCompositor::isMainFrame() const 2488 bool RenderLayerCompositor::isMainFrame() const
2494 { 2489 {
2495 return !m_renderView->document()->ownerElement(); 2490 return !m_renderView->document()->ownerElement();
2496 } 2491 }
2497 2492
2498 void RenderLayerCompositor::rootLayerAttachmentChanged()
2499 {
2500 // The attachment can affect whether the RenderView layer's paintsIntoWindow () behavior,
2501 // so call updateGraphicsLayerGeometry() to udpate that.
2502 RenderLayer* layer = m_renderView->layer();
2503 if (RenderLayerBacking* backing = layer ? layer->backing() : 0)
2504 backing->updateDrawsContent();
2505 }
2506
2507 // IFrames are special, because we hook compositing layers together across ifram e boundaries 2493 // IFrames are special, because we hook compositing layers together across ifram e boundaries
2508 // when both parent and iframe content are composited. So when this frame become s composited, we have 2494 // when both parent and iframe content are composited. So when this frame become s composited, we have
2509 // to use a synthetic style change to get the iframes into RenderLayers in order to allow them to composite. 2495 // to use a synthetic style change to get the iframes into RenderLayers in order to allow them to composite.
2510 void RenderLayerCompositor::notifyIFramesOfCompositingChange() 2496 void RenderLayerCompositor::notifyIFramesOfCompositingChange()
2511 { 2497 {
2512 Frame* frame = m_renderView->frameView() ? m_renderView->frameView()->frame( ) : 0; 2498 Frame* frame = m_renderView->frameView() ? m_renderView->frameView()->frame( ) : 0;
2513 if (!frame) 2499 if (!frame)
2514 return; 2500 return;
2515 2501
2516 for (Frame* child = frame->tree()->firstChild(); child; child = child->tree( )->traverseNext(frame)) { 2502 for (Frame* child = frame->tree()->firstChild(); child; child = child->tree( )->traverseNext(frame)) {
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
2716 info.addMember(m_layerForScrollCorner, "layerForScrollCorner"); 2702 info.addMember(m_layerForScrollCorner, "layerForScrollCorner");
2717 #if ENABLE(RUBBER_BANDING) 2703 #if ENABLE(RUBBER_BANDING)
2718 info.addMember(m_layerForOverhangAreas, "layerForOverhangAreas"); 2704 info.addMember(m_layerForOverhangAreas, "layerForOverhangAreas");
2719 info.addMember(m_contentShadowLayer, "contentShadowLayer"); 2705 info.addMember(m_contentShadowLayer, "contentShadowLayer");
2720 info.addMember(m_layerForTopOverhangArea, "layerForTopOverhangArea"); 2706 info.addMember(m_layerForTopOverhangArea, "layerForTopOverhangArea");
2721 info.addMember(m_layerForBottomOverhangArea, "layerForBottomOverhangArea"); 2707 info.addMember(m_layerForBottomOverhangArea, "layerForBottomOverhangArea");
2722 #endif 2708 #endif
2723 } 2709 }
2724 2710
2725 } // namespace WebCore 2711 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698