⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 176291 in webkit


Ignore:
Timestamp:
Nov 18, 2014, 3:07:28 PM (12 years ago)
Author:
Simon Fraser
Message:

Merge r175656. rdar://problem/18978402

Location:
branches/safari-600.3-branch
Files:
4 added
5 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-600.3-branch/LayoutTests/ChangeLog

    r176271 r176291  
     12014-11-05  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Avoid backing store for opacity:0 descendant layers
     4        https://bugs.webkit.org/show_bug.cgi?id=138448
     5
     6        Reviewed by Dean Jackson.
     7       
     8        Test for no backing store with opacity:0 child, and that we get backing
     9        store when dynamically changing the opacity to non-0.
     10
     11        * compositing/backing/no-backing-for-opacity-0-child-expected.txt: Added.
     12        * compositing/backing/no-backing-for-opacity-0-child.html: Added.
     13        * compositing/backing/toggle-opacity-0-child-expected.txt: Added.
     14        * compositing/backing/toggle-opacity-0-child.html: Added.
     15
    1162014-11-18  Matthew Hanson  <matthew_hanson@apple.com>
    217
  • branches/safari-600.3-branch/Source/WebCore/ChangeLog

    r176284 r176291  
     12014-11-05  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Avoid backing store for opacity:0 descendant layers
     4        https://bugs.webkit.org/show_bug.cgi?id=138448
     5
     6        Reviewed by Dean Jackson.
     7       
     8        If a composited layer has no rendered content but a painting zero-opacity descendant
     9        layer, than we can avoid making backing store.
     10       
     11        When the opacity on such a child changes, we need to trigger a tree rebuild
     12        to force the backing store to come back (this could be optimized later).
     13
     14        Tests: compositing/backing/no-backing-for-opacity-0-child.html
     15               compositing/backing/toggle-opacity-0-child.html
     16
     17        * rendering/RenderLayer.cpp:
     18        (WebCore::RenderLayer::calculateClipRects):
     19        * rendering/RenderLayerCompositor.cpp:
     20        (WebCore::styleChangeRequiresLayerRebuild):
     21        * rendering/RenderObject.cpp:
     22        (WebCore::RenderObject::containerForRepaint):
     23
    1242014-11-18  Dana Burkart  <dburkart@apple.com>
    225
  • branches/safari-600.3-branch/Source/WebCore/rendering/RenderLayer.cpp

    r176242 r176291  
    62776277    ASSERT(!m_visibleDescendantStatusDirty);
    62786278
    6279     if (!hasVisibleContent())
     6279    if (!hasVisibleContent() || !renderer().style().opacity())
    62806280        return false;
    62816281
     
    64226422}
    64236423
     6424inline bool RenderLayer::needsCompositingLayersRebuiltForOpacity(const RenderStyle* oldStyle, const RenderStyle* newStyle) const
     6425{
     6426    if (!oldStyle || !newStyle)
     6427        return false;
     6428
     6429    if (!oldStyle->opacity() != !newStyle->opacity()) {
     6430        RenderLayerModelObject* repaintContainer = renderer().containerForRepaint();
     6431        if (RenderLayerBacking* ancestorBacking = repaintContainer->layer()->backing()) {
     6432            if (newStyle->opacity() != ancestorBacking->graphicsLayer()->drawsContent())
     6433                return true;
     6434        }
     6435    }
     6436    return false;
     6437}
     6438
    64246439void RenderLayer::styleChanged(StyleDifference diff, const RenderStyle* oldStyle)
    64256440{
     
    64816496    if (compositor().updateLayerCompositingState(*this)
    64826497        || needsCompositingLayersRebuiltForClip(oldStyle, &newStyle)
    6483         || needsCompositingLayersRebuiltForOverflow(oldStyle, &newStyle))
     6498        || needsCompositingLayersRebuiltForOverflow(oldStyle, &newStyle)
     6499        || needsCompositingLayersRebuiltForOpacity(oldStyle, &newStyle))
    64846500        compositor().setCompositingLayersNeedRebuild();
    64856501    else if (isComposited()) {
  • branches/safari-600.3-branch/Source/WebCore/rendering/RenderLayer.h

    r171408 r176291  
    832832    bool needsCompositingLayersRebuiltForClip(const RenderStyle* oldStyle, const RenderStyle* newStyle) const;
    833833    bool needsCompositingLayersRebuiltForOverflow(const RenderStyle* oldStyle, const RenderStyle* newStyle) const;
     834    bool needsCompositingLayersRebuiltForOpacity(const RenderStyle* oldStyle, const RenderStyle* newStyle) const;
    834835
    835836    bool paintsWithTransparency(PaintBehavior paintBehavior) const
  • branches/safari-600.3-branch/Source/WebCore/rendering/RenderObject.cpp

    r175515 r176291  
    12281228RenderLayerModelObject* RenderObject::containerForRepaint() const
    12291229{
    1230     RenderLayerModelObject* repaintContainer = 0;
     1230    RenderLayerModelObject* repaintContainer = nullptr;
    12311231
    12321232    if (view().usesCompositing()) {
Note: See TracChangeset for help on using the changeset viewer.