[CSS Regions] The layers from the flow thread should be collected under the regions...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Sep 2013 08:20:57 +0000 (08:20 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Sep 2013 08:20:57 +0000 (08:20 +0000)
commit7e7f333e88c87246ade12ff63998b61fbf3f622b
tree3eb5e7db3b24008ca6ecd8f3cb6acdae53859f9f
parent2c122d2d390ef0d97d128f5a904b2fbbd72df1b8
[CSS Regions] The layers from the flow thread should be collected under the regions' layers.
https://bugs.webkit.org/show_bug.cgi?id=120457

Patch by Mihai Maerean <mmaerean@adobe.com> on 2013-09-26
Reviewed by David Hyatt.

Source/WebCore:

This patch is based on the work of Alexandru Chiculita at https://bugs.webkit.org/attachment.cgi?id=203872&action=review

The composited layers inside the named flow threads are collected as part of the regions.
When a region displays a layer that needs accelerated compositing we activate the accelerated compositing for
that region too (inside RenderFlowThread::updateAllLayerToRegionMappings).

Tests: fast/regions/layers/accelerated-compositing/crash-transform-inside-region.html
       fast/regions/layers/accelerated-compositing/floated-region-with-transformed-child.html
       fast/regions/layers/accelerated-compositing/move-layer-from-one-region-to-another.html
       fast/regions/layers/accelerated-compositing/propagate-region-box-shadow-border-padding.html
       fast/regions/layers/accelerated-compositing/propagate-region-box-shadow-border-padding-for-video.html
       fast/regions/layers/accelerated-compositing/region-as-layer-in-another-flowthread.html
       fast/regions/layers/accelerated-compositing/transform-transparent-positioned-video-inside-region.html
       fast/regions/layers/accelerated-compositing/transformed-layer-inside-transformed-layer.html
       fast/regions/layers/accelerated-compositing/z-index.html: Added.
       fast/regions/layers/accelerated-compositing/z-index-update.html: Added.

* rendering/FlowThreadController.cpp:
(WebCore::FlowThreadController::updateRenderFlowThreadLayersIfNeeded):
* rendering/RenderFlowThread.cpp:
(WebCore::RenderFlowThread::layout): When the layout of the flow thread is over (including the 2 phase layout),
we update all the mappings between the layers inside the flow thread and the regions where those layers will be
painted.
(WebCore::RenderFlowThread::hasCompositingRegionDescendant): Whether any of the regions has a compositing descendant.
(WebCore::RenderFlowThread::getLayerListForRegion):
(WebCore::RenderFlowThread::regionForCompositedLayer):
(WebCore::RenderFlowThread::cachedRegionForCompositedLayer):
(WebCore::RenderFlowThread::updateLayerToRegionMappings): Triggers an update of the layers if a layer has moved
from a region to another since the last update.
(WebCore::RenderFlowThread::updateAllLayerToRegionMappings):
* rendering/RenderFlowThread.h:
* rendering/RenderGeometryMap.cpp:
(WebCore::RenderGeometryMap::pushRenderFlowThread):
* rendering/RenderGeometryMap.h:
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::calculateLayerBounds): The RenderNamedFlowThread is ignored when we calculate the bounds
of the RenderView.
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::shouldClipCompositedBounds): Not if it's inside an out of flow Flow Thread.
(WebCore::RenderLayerBacking::updateGraphicsLayerGeometry): Now adjusts the ancestorCompositingBounds for the FlowThread.
(WebCore::enclosingFlowThreadAncestor):
(WebCore::RenderLayerBacking::adjustAncestorCompositingBoundsForFlowThread): Make sure that the region propagates
its borders, paddings, outlines or box-shadows to layers inside it.
* rendering/RenderLayerBacking.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::computeCompositingRequirements): Now calls computeRegionCompositingRequirements.
(WebCore::RenderLayerCompositor::computeRegionCompositingRequirements):
(WebCore::RenderLayerCompositor::rebuildCompositingLayerTree): Do not iterate the RenderFlowThread directly. We
are going to collect composited layers as part of regions.
(WebCore::RenderLayerCompositor::rebuildRegionCompositingLayerTree):
(WebCore::RenderLayerCompositor::canBeComposited): CSS Regions flow threads do not need to be composited as we
use composited RenderRegions to render the background of the RenderFlowThread.
(WebCore::RenderLayerCompositor::requiresCompositingForIndirectReason): If it's a region.
* rendering/RenderLayerCompositor.h:
* rendering/RenderMultiColumnSet.cpp:
(WebCore::RenderMultiColumnSet::adjustRegionBoundsFromFlowThreadPortionRect):
* rendering/RenderMultiColumnSet.h:
* rendering/RenderElement.cpp:
(WebCore::RenderObject::propagateStyleToAnonymousChildren): Not for RenderFlowThreads, as they are updated
through the RenderView::styleDidChange function.
* rendering/RenderRegion.cpp:
(WebCore::RenderRegion::setRequiresLayerForCompositing):
(WebCore::RenderRegion::adjustRegionBoundsFromFlowThreadPortionRect):
* rendering/RenderRegion.h:
(WebCore::toRenderRegion):
* rendering/RenderRegionSet.h:
(WebCore::RenderRegionSet::requiresLayer): Never.
* rendering/RenderTreeAsText.cpp:
(WebCore::writeLayers):

LayoutTests:

* fast/regions/layers/accelerated-compositing/crash-transform-inside-region.html: Added.
* fast/regions/layers/accelerated-compositing/crash-transform-inside-region-expected.html: Added.
* fast/regions/layers/accelerated-compositing/floated-region-with-transformed-child.html: Added.
* fast/regions/layers/accelerated-compositing/floated-region-with-transformed-child-expected.html: Added.
* fast/regions/layers/accelerated-compositing/move-layer-from-one-region-to-another.html: Added.
* fast/regions/layers/accelerated-compositing/move-layer-from-one-region-to-another-expected.html: Added.
* fast/regions/layers/accelerated-compositing/propagate-region-box-shadow-border-padding.html: Added.
* fast/regions/layers/accelerated-compositing/propagate-region-box-shadow-border-padding-expected.html: Added.
* fast/regions/layers/accelerated-compositing/propagate-region-box-shadow-border-padding-for-video.html: Added.
* fast/regions/layers/accelerated-compositing/propagate-region-box-shadow-border-padding-for-video-expected.html: Added.
* fast/regions/layers/accelerated-compositing/region-as-layer-in-another-flowthread.html: Added.
* fast/regions/layers/accelerated-compositing/region-as-layer-in-another-flowthread-expected.html: Added.
* fast/regions/layers/accelerated-compositing/transformed-layer-inside-transformed-layer.html: Added.
* fast/regions/layers/accelerated-compositing/transformed-layer-inside-transformed-layer-expected.html: Added.
* fast/regions/layers/accelerated-compositing/transform-transparent-positioned-video-inside-region.html: Added.
* fast/regions/layers/accelerated-compositing/transform-transparent-positioned-video-inside-region-expected.html: Added.
* fast/regions/layers/accelerated-compositing/z-index.html: Added.
* fast/regions/layers/accelerated-compositing/z-index-expected.html: Added.
* fast/regions/layers/accelerated-compositing/z-index-update-expected.html: Added.
* fast/regions/layers/accelerated-compositing/z-index-update.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@156451 268f45cc-cd09-0410-ab3c-d52691b4dbfc
40 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/regions/layers/accelerated-compositing/crash-transform-inside-region-expected.html [new file with mode: 0644]
LayoutTests/fast/regions/layers/accelerated-compositing/crash-transform-inside-region.html [new file with mode: 0644]
LayoutTests/fast/regions/layers/accelerated-compositing/floated-region-with-transformed-child-expected.html [new file with mode: 0644]
LayoutTests/fast/regions/layers/accelerated-compositing/floated-region-with-transformed-child.html [new file with mode: 0644]
LayoutTests/fast/regions/layers/accelerated-compositing/move-layer-from-one-region-to-another-expected.html [new file with mode: 0644]
LayoutTests/fast/regions/layers/accelerated-compositing/move-layer-from-one-region-to-another.html [new file with mode: 0644]
LayoutTests/fast/regions/layers/accelerated-compositing/propagate-region-box-shadow-border-padding-expected.html [new file with mode: 0644]
LayoutTests/fast/regions/layers/accelerated-compositing/propagate-region-box-shadow-border-padding-for-video-expected.html [new file with mode: 0644]
LayoutTests/fast/regions/layers/accelerated-compositing/propagate-region-box-shadow-border-padding-for-video.html [new file with mode: 0644]
LayoutTests/fast/regions/layers/accelerated-compositing/propagate-region-box-shadow-border-padding.html [new file with mode: 0644]
LayoutTests/fast/regions/layers/accelerated-compositing/region-as-layer-in-another-flowthread-expected.html [new file with mode: 0644]
LayoutTests/fast/regions/layers/accelerated-compositing/region-as-layer-in-another-flowthread.html [new file with mode: 0644]
LayoutTests/fast/regions/layers/accelerated-compositing/transform-transparent-positioned-video-inside-region-expected.html [new file with mode: 0644]
LayoutTests/fast/regions/layers/accelerated-compositing/transform-transparent-positioned-video-inside-region.html [new file with mode: 0644]
LayoutTests/fast/regions/layers/accelerated-compositing/transformed-layer-inside-transformed-layer-expected.html [new file with mode: 0644]
LayoutTests/fast/regions/layers/accelerated-compositing/transformed-layer-inside-transformed-layer.html [new file with mode: 0644]
LayoutTests/fast/regions/layers/accelerated-compositing/z-index-expected.html [new file with mode: 0644]
LayoutTests/fast/regions/layers/accelerated-compositing/z-index-update-expected.html [new file with mode: 0644]
LayoutTests/fast/regions/layers/accelerated-compositing/z-index-update.html [new file with mode: 0644]
LayoutTests/fast/regions/layers/accelerated-compositing/z-index.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/rendering/FlowThreadController.cpp
Source/WebCore/rendering/RenderElement.cpp
Source/WebCore/rendering/RenderFlowThread.cpp
Source/WebCore/rendering/RenderFlowThread.h
Source/WebCore/rendering/RenderGeometryMap.cpp
Source/WebCore/rendering/RenderGeometryMap.h
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayer.h
Source/WebCore/rendering/RenderLayerBacking.cpp
Source/WebCore/rendering/RenderLayerBacking.h
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/rendering/RenderLayerCompositor.h
Source/WebCore/rendering/RenderMultiColumnSet.cpp
Source/WebCore/rendering/RenderMultiColumnSet.h
Source/WebCore/rendering/RenderRegion.cpp
Source/WebCore/rendering/RenderRegion.h
Source/WebCore/rendering/RenderRegionSet.h
Source/WebCore/rendering/RenderTreeAsText.cpp