Changeset 234849 in webkit


Ignore:
Timestamp:
Aug 14, 2018 9:48:45 AM (6 years ago)
Author:
Antti Koivisto
Message:

RemoteLayerTreeTransaction should use OptionSet for change flags
https://bugs.webkit.org/show_bug.cgi?id=188547

Reviewed by Simon Fraser.

  • Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:

(WebKit::RemoteLayerTreePropertyApplier::applyProperties):

  • Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:

(WebKit::RemoteLayerTreeTransaction::LayerProperties::notePropertiesChanged):
(WebKit::RemoteLayerTreeTransaction::LayerProperties::resetChangedProperties):

Also remove unused everChangedProperties.

  • Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:

(WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
(WebKit::RemoteLayerTreeTransaction::LayerProperties::encode const):
(WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):

  • WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:

(WebKit::PlatformCALayerRemote::recursiveBuildTransaction):

  • WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:

(WebKit::RemoteLayerTreeDrawingArea::flushLayers):

Location:
trunk/Source/WebKit
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r234816 r234849  
     12018-08-14  Antti Koivisto  <antti@apple.com>
     2
     3        RemoteLayerTreeTransaction should use OptionSet for change flags
     4        https://bugs.webkit.org/show_bug.cgi?id=188547
     5
     6        Reviewed by Simon Fraser.
     7
     8        * Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
     9        (WebKit::RemoteLayerTreePropertyApplier::applyProperties):
     10        * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h:
     11        (WebKit::RemoteLayerTreeTransaction::LayerProperties::notePropertiesChanged):
     12        (WebKit::RemoteLayerTreeTransaction::LayerProperties::resetChangedProperties):
     13
     14        Also remove unused everChangedProperties.
     15
     16        * Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
     17        (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
     18        (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode const):
     19        (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
     20        * WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp:
     21        (WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
     22        * WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
     23        (WebKit::RemoteLayerTreeDrawingArea::flushLayers):
     24
    1252018-08-13  Wenson Hsieh  <wenson_hsieh@apple.com>
    226
  • trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm

    r234393 r234849  
    333333    }
    334334
    335     if (properties.changedProperties & (RemoteLayerTreeTransaction::ContentsHiddenChanged | RemoteLayerTreeTransaction::UserInteractionEnabledChanged))
     335    if (properties.changedProperties.containsAny({ RemoteLayerTreeTransaction::ContentsHiddenChanged, RemoteLayerTreeTransaction::UserInteractionEnabledChanged }))
    336336        view.userInteractionEnabled = !properties.contentsHidden && properties.userInteractionEnabled;
    337337
  • trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.h

    r233781 r234849  
    5555class RemoteLayerTreeTransaction {
    5656public:
    57     enum LayerChanges {
    58         NoChange                        = 0,
     57    enum LayerChange {
    5958        NameChanged                     = 1LLU << 1,
    6059        ChildrenChanged                 = 1LLU << 2,
     
    9594        UserInteractionEnabledChanged   = 1LLU << 37,
    9695    };
    97     typedef uint64_t LayerChange;
    9896
    9997    struct LayerCreationProperties {
     
    117115        static bool decode(IPC::Decoder&, LayerProperties&);
    118116
    119         void notePropertiesChanged(LayerChange changeFlags)
     117        void notePropertiesChanged(OptionSet<LayerChange> changeFlags)
    120118        {
    121119            changedProperties |= changeFlags;
    122             everChangedProperties |= changeFlags;
    123120        }
    124121
    125122        void resetChangedProperties()
    126123        {
    127             changedProperties = RemoteLayerTreeTransaction::NoChange;
     124            changedProperties = { };
    128125        }
    129126
    130         LayerChange changedProperties;
    131         LayerChange everChangedProperties;
     127        OptionSet<LayerChange> changedProperties;
    132128
    133129        String name;
  • trunk/Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm

    r234610 r234849  
    7676
    7777RemoteLayerTreeTransaction::LayerProperties::LayerProperties()
    78     : changedProperties(NoChange)
    79     , everChangedProperties(NoChange)
    80     , anchorPoint(0.5, 0.5, 0)
     78    : anchorPoint(0.5, 0.5, 0)
    8179    , contentsRect(FloatPoint(), FloatSize(1, 1))
    8280    , maskLayerID(0)
     
    109107RemoteLayerTreeTransaction::LayerProperties::LayerProperties(const LayerProperties& other)
    110108    : changedProperties(other.changedProperties)
    111     , everChangedProperties(other.everChangedProperties)
    112109    , name(other.name)
    113110    , children(other.children)
     
    159156void RemoteLayerTreeTransaction::LayerProperties::encode(IPC::Encoder& encoder) const
    160157{
    161     encoder.encodeEnum(changedProperties);
     158    encoder.encode(changedProperties);
    162159
    163160    if (changedProperties & NameChanged)
     
    281278bool RemoteLayerTreeTransaction::LayerProperties::decode(IPC::Decoder& decoder, LayerProperties& result)
    282279{
    283     if (!decoder.decodeEnum(result.changedProperties))
     280    if (!decoder.decode(result.changedProperties))
    284281        return false;
    285282
  • trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.cpp

    r234393 r234849  
    155155        m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::BackingStoreChanged);
    156156
    157     if (m_properties.changedProperties != RemoteLayerTreeTransaction::NoChange) {
     157    if (m_properties.changedProperties) {
    158158        if (m_properties.changedProperties & RemoteLayerTreeTransaction::ChildrenChanged) {
    159159            m_properties.children.resize(m_children.size());
  • trunk/Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm

    r233872 r234849  
    398398    Vector<RetainPtr<CGContextRef>> contextsToFlush;
    399399    for (auto& layer : layerTransaction.changedLayers()) {
    400         if (layer->properties().changedProperties & RemoteLayerTreeTransaction::LayerChanges::BackingStoreChanged) {
     400        if (layer->properties().changedProperties & RemoteLayerTreeTransaction::BackingStoreChanged) {
    401401            hadAnyChangedBackingStore = true;
    402402            if (layer->properties().backingStore) {
Note: See TracChangeset for help on using the changeset viewer.