Changeset 164406 in webkit


Ignore:
Timestamp:
Feb 19, 2014 6:03:40 PM (10 years ago)
Author:
Simon Fraser
Message:

Avoid sending redundant layer properties to the UI process, and avoid allocation of RemoteLayerBackingStore unless we need it
https://bugs.webkit.org/show_bug.cgi?id=129076

Reviewed by Tim Horton.

Normally we rely on GraphicsLayerCA to avoid redundant property
setting on PlatformCALayers, but for contents layers GraphicsLayerCA
sets properties on every update.

Make PlatformCALayerRemote more efficient in this case by not
setting dirty flags for unchanged property sets.

Also avoid creation of RemoteLayerBackingStore unless we
actually need one.

  • WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:

(PlatformCALayerRemote::ensureBackingStore):
(PlatformCALayerRemote::updateBackingStore):
(PlatformCALayerRemote::setBounds):
(PlatformCALayerRemote::setPosition):
(PlatformCALayerRemote::setAnchorPoint):
(PlatformCALayerRemote::setMasksToBounds):
(PlatformCALayerRemote::setAcceleratesDrawing):
(PlatformCALayerRemote::setBorderWidth):
(PlatformCALayerRemote::setBorderColor):
(PlatformCALayerRemote::setContentsScale):

  • WebProcess/WebPage/mac/PlatformCALayerRemote.h:
Location:
trunk/Source/WebKit2
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r164405 r164406  
     12014-02-19  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Avoid sending redundant layer properties to the UI process, and avoid allocation of RemoteLayerBackingStore unless we need it
     4        https://bugs.webkit.org/show_bug.cgi?id=129076
     5
     6        Reviewed by Tim Horton.
     7       
     8        Normally we rely on GraphicsLayerCA to avoid redundant property
     9        setting on PlatformCALayers, but for contents layers GraphicsLayerCA
     10        sets properties on every update.
     11       
     12        Make PlatformCALayerRemote more efficient in this case by not
     13        setting dirty flags for unchanged property sets.
     14       
     15        Also avoid creation of RemoteLayerBackingStore unless we
     16        actually need one.
     17
     18        * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
     19        (PlatformCALayerRemote::ensureBackingStore):
     20        (PlatformCALayerRemote::updateBackingStore):
     21        (PlatformCALayerRemote::setBounds):
     22        (PlatformCALayerRemote::setPosition):
     23        (PlatformCALayerRemote::setAnchorPoint):
     24        (PlatformCALayerRemote::setMasksToBounds):
     25        (PlatformCALayerRemote::setAcceleratesDrawing):
     26        (PlatformCALayerRemote::setBorderWidth):
     27        (PlatformCALayerRemote::setBorderColor):
     28        (PlatformCALayerRemote::setContentsScale):
     29        * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
     30
    1312014-02-19  Simon Fraser  <simon.fraser@apple.com>
    232
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp

    r164405 r164406  
    152152    if (!m_properties.backingStore)
    153153        m_properties.backingStore = std::make_unique<RemoteLayerBackingStore>();
     154
     155    updateBackingStore();
     156}
     157
     158void PlatformCALayerRemote::updateBackingStore()
     159{
     160    if (!m_properties.backingStore)
     161        return;
     162
    154163    m_properties.backingStore->ensureBackingStore(this, expandedIntSize(m_properties.size), m_properties.contentsScale, m_acceleratesDrawing);
    155164}
     
    305314void PlatformCALayerRemote::setBounds(const FloatRect& value)
    306315{
     316    if (value.size() == m_properties.size)
     317        return;
     318
    307319    m_properties.size = value.size();
    308320    m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::SizeChanged);
     
    311323        m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::CustomAppearanceChanged);
    312324
    313     ensureBackingStore();
     325    updateBackingStore();
    314326}
    315327
     
    321333void PlatformCALayerRemote::setPosition(const FloatPoint3D& value)
    322334{
     335    if (value == m_properties.position)
     336        return;
     337
    323338    m_properties.position = value;
    324339    m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::PositionChanged);
     
    332347void PlatformCALayerRemote::setAnchorPoint(const FloatPoint3D& value)
    333348{
     349    if (value == m_properties.anchorPoint)
     350        return;
     351
    334352    m_properties.anchorPoint = value;
    335353    m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::AnchorPointChanged);
     
    388406void PlatformCALayerRemote::setMasksToBounds(bool value)
    389407{
     408    if (value == m_properties.masksToBounds)
     409        return;
     410
    390411    m_properties.masksToBounds = value;
    391412    m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::MasksToBoundsChanged);
     
    400421{
    401422    m_acceleratesDrawing = acceleratesDrawing;
    402     ensureBackingStore();
     423    updateBackingStore();
    403424}
    404425
     
    443464void PlatformCALayerRemote::setBorderWidth(float value)
    444465{
     466    if (value == m_properties.borderWidth)
     467        return;
     468
    445469    m_properties.borderWidth = value;
    446470    m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::BorderWidthChanged);
     
    449473void PlatformCALayerRemote::setBorderColor(const Color& value)
    450474{
     475    if (value == m_properties.borderColor)
     476        return;
     477
    451478    m_properties.borderColor = value;
    452479    m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::BorderColorChanged);
     
    510537    m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::ContentsScaleChanged);
    511538
    512     ensureBackingStore();
     539    updateBackingStore();
    513540}
    514541
  • trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h

    r164405 r164406  
    156156    virtual bool isPlatformCALayerRemote() const override { return true; }
    157157    void ensureBackingStore();
     158    void updateBackingStore();
    158159    void removeSublayer(PlatformCALayerRemote*);
    159160
Note: See TracChangeset for help on using the changeset viewer.