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

Changeset 276232 in webkit


Ignore:
Timestamp:
Apr 18, 2021, 2:14:38 PM (5 years ago)
Author:
weinig@apple.com
Message:

GraphicsLayer::distributeOpacity, GraphicsLayer::setOpacityInternal and GraphicsLayer::accumulatedOpacity are never used
https://bugs.webkit.org/show_bug.cgi?id=224732

Reviewed by Darin Adler.

Remove dead code.

  • platform/graphics/GraphicsLayer.cpp:

(WebCore::GraphicsLayer::accumulatedOpacity const): Deleted.
(WebCore::GraphicsLayer::distributeOpacity): Deleted.

  • platform/graphics/GraphicsLayer.h:

(WebCore::GraphicsLayer::setOpacityInternal): Deleted.

  • platform/graphics/ca/GraphicsLayerCA.cpp:
  • platform/graphics/ca/GraphicsLayerCA.h:
Location:
trunk/Source/WebCore
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r276231 r276232  
     12021-04-18  Sam Weinig  <weinig@apple.com>
     2
     3        GraphicsLayer::distributeOpacity, GraphicsLayer::setOpacityInternal and GraphicsLayer::accumulatedOpacity are never used
     4        https://bugs.webkit.org/show_bug.cgi?id=224732
     5
     6        Reviewed by Darin Adler.
     7
     8        Remove dead code.
     9
     10        * platform/graphics/GraphicsLayer.cpp:
     11        (WebCore::GraphicsLayer::accumulatedOpacity const): Deleted.
     12        (WebCore::GraphicsLayer::distributeOpacity): Deleted.
     13        * platform/graphics/GraphicsLayer.h:
     14        (WebCore::GraphicsLayer::setOpacityInternal): Deleted.
     15        * platform/graphics/ca/GraphicsLayerCA.cpp:
     16        * platform/graphics/ca/GraphicsLayerCA.h:
     17
    1182021-04-18  Antoine Quint  <graouts@webkit.org>
    219
  • trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp

    r271699 r276232  
    656656{
    657657    m_zPosition = position;
    658 }
    659 
    660 float GraphicsLayer::accumulatedOpacity() const
    661 {
    662     if (!preserves3D())
    663         return 1;
    664        
    665     return m_opacity * (parent() ? parent()->accumulatedOpacity() : 1);
    666 }
    667 
    668 void GraphicsLayer::distributeOpacity(float accumulatedOpacity)
    669 {
    670     // If this is a transform layer we need to distribute our opacity to all our children
    671    
    672     // Incoming accumulatedOpacity is the contribution from our parent(s). We mutiply this by our own
    673     // opacity to get the total contribution
    674     accumulatedOpacity *= m_opacity;
    675    
    676     setOpacityInternal(accumulatedOpacity);
    677    
    678     if (preserves3D()) {
    679         for (auto& layer : children())
    680             layer->distributeOpacity(accumulatedOpacity);
    681     }
    682658}
    683659
  • trunk/Source/WebCore/platform/graphics/GraphicsLayer.h

    r276085 r276232  
    564564    WEBCORE_EXPORT virtual void setZPosition(float);
    565565
    566     WEBCORE_EXPORT virtual void distributeOpacity(float);
    567     WEBCORE_EXPORT virtual float accumulatedOpacity() const;
    568 
    569566    virtual FloatSize pixelAlignmentOffset() const { return FloatSize(); }
    570567   
     
    662659
    663660    virtual bool shouldRepaintOnSizeChange() const { return drawsContent(); }
    664 
    665     virtual void setOpacityInternal(float) { }
    666661
    667662    // The layer being replicated.
  • trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp

    r276085 r276232  
    43804380}
    43814381
    4382 void GraphicsLayerCA::setOpacityInternal(float accumulatedOpacity)
    4383 {
    4384     LayerMap* layerCloneMap = nullptr;
    4385    
    4386     if (preserves3D()) {
    4387         m_layer->setOpacity(accumulatedOpacity);
    4388         layerCloneMap = m_layerClones ? &m_layerClones->primaryLayerClones : nullptr;
    4389     } else {
    4390         primaryLayer()->setOpacity(accumulatedOpacity);
    4391         layerCloneMap = primaryLayerClones();
    4392     }
    4393 
    4394     if (layerCloneMap) {
    4395         for (auto& clone : *layerCloneMap) {
    4396             if (m_replicaLayer && isReplicatedRootClone(clone.key))
    4397                 continue;
    4398             clone.value->setOpacity(m_opacity);
    4399         }
    4400     }
    4401 }
    4402 
    44034382void GraphicsLayerCA::updateOpacityOnLayer()
    44044383{
  • trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h

    r276085 r276232  
    189189    WEBCORE_EXPORT Vector<std::pair<String, double>> acceleratedAnimationsForTesting() const final;
    190190
    191 protected:
    192     WEBCORE_EXPORT void setOpacityInternal(float) override;
    193    
    194191private:
    195192    bool isGraphicsLayerCA() const override { return true; }
Note: See TracChangeset for help on using the changeset viewer.