OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2009, 2010, 2011 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
43 #include "core/page/animation/AnimationController.h" | 43 #include "core/page/animation/AnimationController.h" |
44 #include "core/page/scrolling/ScrollingCoordinator.h" | 44 #include "core/page/scrolling/ScrollingCoordinator.h" |
45 #include "core/platform/graphics/FontCache.h" | 45 #include "core/platform/graphics/FontCache.h" |
46 #include "core/platform/graphics/GraphicsContext.h" | 46 #include "core/platform/graphics/GraphicsContext.h" |
47 #include "core/platform/graphics/GraphicsLayer.h" | 47 #include "core/platform/graphics/GraphicsLayer.h" |
48 #include "core/plugins/PluginView.h" | 48 #include "core/plugins/PluginView.h" |
49 #include "core/rendering/RenderApplet.h" | 49 #include "core/rendering/RenderApplet.h" |
50 #include "core/rendering/RenderEmbeddedObject.h" | 50 #include "core/rendering/RenderEmbeddedObject.h" |
51 #include "core/rendering/RenderIFrame.h" | 51 #include "core/rendering/RenderIFrame.h" |
52 #include "core/rendering/RenderImage.h" | 52 #include "core/rendering/RenderImage.h" |
53 #include "core/rendering/RenderLayer.h" | |
53 #include "core/rendering/RenderLayerCompositor.h" | 54 #include "core/rendering/RenderLayerCompositor.h" |
54 #include "core/rendering/RenderVideo.h" | 55 #include "core/rendering/RenderVideo.h" |
55 #include "core/rendering/RenderView.h" | 56 #include "core/rendering/RenderView.h" |
56 #include "core/rendering/style/KeyframeList.h" | 57 #include "core/rendering/style/KeyframeList.h" |
57 #include <wtf/CurrentTime.h> | 58 #include <wtf/CurrentTime.h> |
58 #include <wtf/text/StringBuilder.h> | 59 #include <wtf/text/StringBuilder.h> |
59 | 60 |
60 #include "core/platform/graphics/filters/custom/CustomFilterOperation.h" | 61 #include "core/platform/graphics/filters/custom/CustomFilterOperation.h" |
61 #include "core/rendering/FilterEffectRenderer.h" | 62 #include "core/rendering/FilterEffectRenderer.h" |
62 | 63 |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
339 void RenderLayerBacking::updateAfterWidgetResize() | 340 void RenderLayerBacking::updateAfterWidgetResize() |
340 { | 341 { |
341 if (renderer()->isRenderPart()) { | 342 if (renderer()->isRenderPart()) { |
342 if (RenderLayerCompositor* innerCompositor = RenderLayerCompositor::fram eContentsCompositor(toRenderPart(renderer()))) { | 343 if (RenderLayerCompositor* innerCompositor = RenderLayerCompositor::fram eContentsCompositor(toRenderPart(renderer()))) { |
343 innerCompositor->frameViewDidChangeSize(); | 344 innerCompositor->frameViewDidChangeSize(); |
344 innerCompositor->frameViewDidChangeLocation(contentsBox().location() ); | 345 innerCompositor->frameViewDidChangeLocation(contentsBox().location() ); |
345 } | 346 } |
346 } | 347 } |
347 } | 348 } |
348 | 349 |
350 void RenderLayerBacking::updateCompositingReasons() | |
351 { | |
352 m_graphicsLayer->setCompositingReasons(m_owningLayer->compositingReasons()); | |
353 | |
354 if (m_ancestorClippingLayer) | |
355 m_ancestorClippingLayer->setCompositingReasons(CompositingReasonLayerFor Clip); | |
enne (OOO)
2013/05/21 20:19:28
What about just setting these reasons when you cre
| |
356 | |
357 if (m_contentsContainmentLayer) | |
358 m_contentsContainmentLayer->setCompositingReasons(CompositingReasonNone) ; | |
359 | |
360 if (m_foregroundLayer) | |
361 m_foregroundLayer->setCompositingReasons(CompositingReasonLayerForForegr ound); | |
362 | |
363 if (m_backgroundLayer) | |
364 m_backgroundLayer->setCompositingReasons(CompositingReasonNone); | |
365 | |
366 if (m_childContainmentLayer) | |
367 m_childContainmentLayer->setCompositingReasons(CompositingReasonNone); | |
368 | |
369 if (m_maskLayer) | |
370 m_maskLayer->setCompositingReasons(CompositingReasonNone); | |
371 | |
372 if (m_layerForHorizontalScrollbar) | |
373 m_layerForHorizontalScrollbar->setCompositingReasons(CompositingReasonLa yerForScrollbar); | |
374 | |
375 if (m_layerForVerticalScrollbar) | |
376 m_layerForVerticalScrollbar->setCompositingReasons(CompositingReasonLaye rForScrollbar); | |
377 | |
378 if (m_layerForScrollCorner) | |
379 m_layerForScrollCorner->setCompositingReasons(CompositingReasonLayerForS crollbar); | |
380 | |
381 // Is this the correct reason? | |
382 if (m_scrollingLayer) | |
383 m_scrollingLayer->setCompositingReasons(CompositingReasonLayerForDescend antClip); | |
384 | |
385 if (m_scrollingContentsLayer) | |
386 m_scrollingContentsLayer->setCompositingReasons(CompositingReasonLayerFo rScrollingContainer); | |
387 } | |
388 | |
349 void RenderLayerBacking::updateAfterLayout(UpdateAfterLayoutFlags flags) | 389 void RenderLayerBacking::updateAfterLayout(UpdateAfterLayoutFlags flags) |
350 { | 390 { |
351 RenderLayerCompositor* layerCompositor = compositor(); | 391 RenderLayerCompositor* layerCompositor = compositor(); |
352 if (!layerCompositor->compositingLayersNeedRebuild()) { | 392 if (!layerCompositor->compositingLayersNeedRebuild()) { |
353 // Calling updateGraphicsLayerGeometry() here gives incorrect results, b ecause the | 393 // Calling updateGraphicsLayerGeometry() here gives incorrect results, b ecause the |
354 // position of this layer's GraphicsLayer depends on the position of our compositing | 394 // position of this layer's GraphicsLayer depends on the position of our compositing |
355 // ancestor's GraphicsLayer. That cannot be determined until all the des cendant | 395 // ancestor's GraphicsLayer. That cannot be determined until all the des cendant |
356 // RenderLayers of that ancestor have been processed via updateLayerPosi tions(). | 396 // RenderLayers of that ancestor have been processed via updateLayerPosi tions(). |
357 // | 397 // |
358 // The solution is to update compositing children of this layer here, | 398 // The solution is to update compositing children of this layer here, |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
711 } | 751 } |
712 | 752 |
713 // If this layer was created just for clipping or to apply perspective, it d oesn't need its own backing store. | 753 // If this layer was created just for clipping or to apply perspective, it d oesn't need its own backing store. |
714 setRequiresOwnBackingStore(compositor()->requiresOwnBackingStore(m_owningLay er, compAncestor)); | 754 setRequiresOwnBackingStore(compositor()->requiresOwnBackingStore(m_owningLay er, compAncestor)); |
715 | 755 |
716 updateContentsRect(isSimpleContainer); | 756 updateContentsRect(isSimpleContainer); |
717 updateBackgroundColor(isSimpleContainer); | 757 updateBackgroundColor(isSimpleContainer); |
718 updateDrawsContent(isSimpleContainer); | 758 updateDrawsContent(isSimpleContainer); |
719 updateAfterWidgetResize(); | 759 updateAfterWidgetResize(); |
720 registerScrollingLayers(); | 760 registerScrollingLayers(); |
761 | |
762 updateCompositingReasons(); | |
721 } | 763 } |
722 | 764 |
723 void RenderLayerBacking::registerScrollingLayers() | 765 void RenderLayerBacking::registerScrollingLayers() |
724 { | 766 { |
725 // Register fixed position layers and their containers with the scrolling co ordinator. | 767 // Register fixed position layers and their containers with the scrolling co ordinator. |
726 ScrollingCoordinator* scrollingCoordinator = scrollingCoordinatorFromLayer(m _owningLayer); | 768 ScrollingCoordinator* scrollingCoordinator = scrollingCoordinatorFromLayer(m _owningLayer); |
727 if (!scrollingCoordinator) | 769 if (!scrollingCoordinator) |
728 return; | 770 return; |
729 | 771 |
730 compositor()->updateViewportConstraintStatus(m_owningLayer); | 772 compositor()->updateViewportConstraintStatus(m_owningLayer); |
(...skipping 1224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1955 info.addMember(m_childContainmentLayer, "childContainmentLayer"); | 1997 info.addMember(m_childContainmentLayer, "childContainmentLayer"); |
1956 info.addMember(m_maskLayer, "maskLayer"); | 1998 info.addMember(m_maskLayer, "maskLayer"); |
1957 info.addMember(m_layerForHorizontalScrollbar, "layerForHorizontalScrollbar") ; | 1999 info.addMember(m_layerForHorizontalScrollbar, "layerForHorizontalScrollbar") ; |
1958 info.addMember(m_layerForVerticalScrollbar, "layerForVerticalScrollbar"); | 2000 info.addMember(m_layerForVerticalScrollbar, "layerForVerticalScrollbar"); |
1959 info.addMember(m_layerForScrollCorner, "layerForScrollCorner"); | 2001 info.addMember(m_layerForScrollCorner, "layerForScrollCorner"); |
1960 info.addMember(m_scrollingLayer, "scrollingLayer"); | 2002 info.addMember(m_scrollingLayer, "scrollingLayer"); |
1961 info.addMember(m_scrollingContentsLayer, "scrollingContentsLayer"); | 2003 info.addMember(m_scrollingContentsLayer, "scrollingContentsLayer"); |
1962 } | 2004 } |
1963 | 2005 |
1964 } // namespace WebCore | 2006 } // namespace WebCore |
OLD | NEW |