• simon.fraser@apple.com's avatar
    2010-04-01 Simon Fraser <simon.fraser@apple.com> · d6bec432
    simon.fraser@apple.com authored
            Reviewed by Darin Adler.
    
            Assertion failure (willBeComposited == needsToBeComposited(layer)) in
            RenderLayerCompositor::computeCompositingRequirements() on hulu.com
            https://bugs.webkit.org/show_bug.cgi?id=36516
    
            Fix assertions added in r56017. That changed replaced calls to needsToBeComposited()
            with use of the local 'willBeComposited' variable, but that fails to take into
            account the fact that needsToBeComposited() also tests layer->isSelfPaintingLayer().
    
            Fix by adding a canBeComposited() method that we call before testing
            whether the layer should go into compositing mode.
    
            Test: compositing/self-painting-layers2.html
    
            * rendering/RenderLayerCompositor.cpp:
            (WebCore::RenderLayerCompositor::calculateCompositedBounds): Repace use of isSelfPaintingLayer()
            with a call to canBeComposited().
            (WebCore::RenderLayerCompositor::computeCompositingRequirements): Call canBeComposited() to ensure
            that we only toggle 'willBeComposited' for layers that can.
            (WebCore::RenderLayerCompositor::needsToBeComposited): Call canBeComposited().
            (WebCore::RenderLayerCompositor::canBeComposited): Test if compositing is enabled, and whether
            the layer is self-painting.
            * rendering/RenderLayerCompositor.h: Add canBeComposited().
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@56949 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    d6bec432