Changeset 170306 in webkit


Ignore:
Timestamp:
Jun 23, 2014, 12:00:32 PM (11 years ago)
Author:
Simon Fraser
Message:

Adding a mask on a simple color compositing layer removes the content
https://bugs.webkit.org/show_bug.cgi?id=134127

Reviewed by Dean Jackson.

Source/WebCore:

In r169053 I moved some updateDrawsContent() into updateAfterDescendents(),
but this isn't called when a composited layer gains or loses a mask (which
doesn't cause a layout). This caused us to fail to allocate backing store
when gaining a mask, resulting in missing content.

Fix by calling updateAfterDescendents() from RenderLayer::styleChange()
when the layer config isn't changing.

Also remove a condition in isSimpleContainerCompositingLayer() that caused us
to fall off the simple layer path for masked layers, since this works just
fine.

Test: compositing/masks/solid-color-masked.html

  • rendering/RenderLayer.cpp:

(WebCore::RenderLayer::calculateClipRects):

  • rendering/RenderLayerBacking.cpp:

(WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer):

LayoutTests:

  • compositing/masks/mask-layer-size-expected.txt:
  • compositing/masks/solid-color-masked-expected.html: Added.
  • compositing/masks/solid-color-masked.html: Added.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r170304 r170306  
     12014-06-23  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Adding a mask on a simple color compositing layer removes the content
     4        https://bugs.webkit.org/show_bug.cgi?id=134127
     5
     6        Reviewed by Dean Jackson.
     7
     8        * compositing/masks/mask-layer-size-expected.txt:
     9        * compositing/masks/solid-color-masked-expected.html: Added.
     10        * compositing/masks/solid-color-masked.html: Added.
     11
    1122014-06-23  David Hyatt  <hyatt@apple.com>
    213
  • trunk/LayoutTests/compositing/masks/mask-layer-size-expected.txt

    r168244 r170306  
    1111          (bounds 400.00 200.00)
    1212          (contentsOpaque 1)
    13           (drawsContent 1)
    1413        )
    1514      )
  • trunk/Source/WebCore/ChangeLog

    r170304 r170306  
     12014-06-23  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Adding a mask on a simple color compositing layer removes the content
     4        https://bugs.webkit.org/show_bug.cgi?id=134127
     5
     6        Reviewed by Dean Jackson.
     7       
     8        In r169053 I moved some updateDrawsContent() into updateAfterDescendents(),
     9        but this isn't called when a composited layer gains or loses a mask (which
     10        doesn't cause a layout). This caused us to fail to allocate backing store
     11        when gaining a mask, resulting in missing content.
     12       
     13        Fix by calling updateAfterDescendents() from RenderLayer::styleChange()
     14        when the layer config isn't changing.
     15       
     16        Also remove a condition in isSimpleContainerCompositingLayer() that caused us
     17        to fall off the simple layer path for masked layers, since this works just
     18        fine.
     19
     20        Test: compositing/masks/solid-color-masked.html
     21
     22        * rendering/RenderLayer.cpp:
     23        (WebCore::RenderLayer::calculateClipRects):
     24        * rendering/RenderLayerBacking.cpp:
     25        (WebCore::RenderLayerBacking::isSimpleContainerCompositingLayer):
     26
    1272014-06-23  David Hyatt  <hyatt@apple.com>
    228
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r170282 r170306  
    63966396        || needsCompositingLayersRebuiltForOverflow(oldStyle, &newStyle))
    63976397        compositor().setCompositingLayersNeedRebuild();
    6398     else if (isComposited())
     6398    else if (isComposited()) {
     6399        // FIXME: updating geometry here is potentially harmful, because layout is not up-to-date.
    63996400        backing()->updateGeometry();
     6401        backing()->updateAfterDescendents();
     6402    }
    64006403
    64016404    if (oldStyle) {
  • trunk/Source/WebCore/rendering/RenderLayerBacking.cpp

    r170220 r170306  
    17041704bool RenderLayerBacking::isSimpleContainerCompositingLayer() const
    17051705{
    1706     if (renderer().hasMask()) // masks require special treatment
    1707         return false;
    1708 
    17091706    if (renderer().isReplaced() && (!isCompositedPlugin(&renderer()) || isRestartedPlugin(&renderer())))
    17101707        return false;
Note: See TracChangeset for help on using the changeset viewer.