[webkit-changes] [WebKit/WebKit] dfde44: Generate serialization for LayerProperties

Alex Christensen noreply at github.com
Wed Aug 2 22:57:03 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: dfde447bae87cf7742a1d28613646004d33f4d86
      https://github.com/WebKit/WebKit/commit/dfde447bae87cf7742a1d28613646004d33f4d86
  Author: Alex Christensen <achristensen at apple.com>
  Date:   2023-08-02 (Wed, 02 Aug 2023)

  Changed paths:
    M Source/WebKit/Scripts/generate-serializers.py
    M Source/WebKit/Scripts/webkit/tests/GeneratedSerializers.cpp
    M Source/WebKit/Scripts/webkit/tests/GeneratedSerializers.h
    M Source/WebKit/Scripts/webkit/tests/SerializedTypeInfo.cpp
    M Source/WebKit/Scripts/webkit/tests/TestSerializedType.serialization.in
    M Source/WebKit/Scripts/webkit/tests/WebKitPlatformGeneratedSerializers.cpp
    M Source/WebKit/Shared/RemoteLayerTree/LayerProperties.h
    M Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.h
    M Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStoreCollection.mm
    M Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTree.serialization.in
    M Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm
    M Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm
    M Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm
    M Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.mm

  Log Message:
  -----------
  Generate serialization for LayerProperties
https://bugs.webkit.org/show_bug.cgi?id=259626

Reviewed by Brady Eidson.

LayerProperties is basically a bunch of std::optionals, but efficiently packed
with all their bools stored as a bit in an OptionSet.  So it's a tuple of optionals.

This introduces a new primitive, an OptionalTuple that is serialized by sending
a uint64_t of all the bools followed by the tuple members if the bit is 1.
This can also be used for RemoteScrollingCoordinatorTransaction.

I think OptionalTuple is a monad.  It's never been completely clear to me
what is and what is not a monad.

* Source/WebKit/Scripts/generate-serializers.py:
(SerializedType.has_optional_tuple_bits):
(MemberVariable.optional_tuple_bit):
(encode_optional_tuple):
(decode_optional_tuple):
(generate_impl):
(generate_optional_tuple_type_info):
(generate_serialized_type_info):
* Source/WebKit/Scripts/webkit/tests/GeneratedSerializers.cpp:
(IPC::ArgumentCoder<WebKit::LayerProperties>::encode):
(IPC::ArgumentCoder<WebKit::LayerProperties>::decode):
* Source/WebKit/Scripts/webkit/tests/GeneratedSerializers.h:
* Source/WebKit/Scripts/webkit/tests/SerializedTypeInfo.cpp:
(WebKit::allSerializedTypes):
* Source/WebKit/Scripts/webkit/tests/TestSerializedType.serialization.in:
* Source/WebKit/Scripts/webkit/tests/WebKitPlatformGeneratedSerializers.cpp:
* Source/WebKit/Shared/RemoteLayerTree/LayerProperties.h:
(WebKit::RemoteLayerBackingStoreOrProperties::RemoteLayerBackingStoreOrProperties):
* Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStore.h:
* Source/WebKit/Shared/RemoteLayerTree/RemoteLayerBackingStoreCollection.mm:
(WebKit::RemoteLayerBackingStoreCollection::didFlushLayers):
* Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTree.serialization.in:
* Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreePropertyApplier.mm:
(WebKit::RemoteLayerTreePropertyApplier::applyPropertiesToLayer):
* Source/WebKit/Shared/RemoteLayerTree/RemoteLayerTreeTransaction.mm:
(WebKit::dumpChangedLayers):
(IPC::ArgumentCoder<WebKit::RemoteLayerBackingStoreOrProperties>::encode):
(WebKit::LayerProperties::encode const): Deleted.
(WebKit::LayerProperties::decode): Deleted.
* Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::commitLayerTree):
* Source/WebKit/WebProcess/WebPage/RemoteLayerTree/PlatformCALayerRemote.mm:
(WebKit::PlatformCALayerRemote::recursiveBuildTransaction):
(WebKit::PlatformCALayerRemote::didCommit):
(WebKit::PlatformCALayerRemote::ensureBackingStore):
(WebKit::PlatformCALayerRemote::updateBackingStore):
(WebKit::PlatformCALayerRemote::setNeedsDisplayInRect):
(WebKit::PlatformCALayerRemote::setNeedsDisplay):
(WebKit::PlatformCALayerRemote::addAnimationForKey):
(WebKit::PlatformCALayerRemote::removeAnimationForKey):
(WebKit::PlatformCALayerRemote::setBackingStoreAttached):
(WebKit::PlatformCALayerRemote::hasContents const):
(WebKit::PlatformCALayerRemote::setContents):
(WebKit::PlatformCALayerRemote::setDelegatedContents):
(WebKit::PlatformCALayerRemote::enumerateRectsBeingDrawn):
(WebKit::PlatformCALayerRemote::backingStoreBytesPerPixel const):
(WebKit::PlatformCALayerRemote::clearAcceleratedEffectsAndBaseValues):
(WebKit::PlatformCALayerRemote::setAcceleratedEffectsAndBaseValues):

Canonical link: https://commits.webkit.org/266533@main




More information about the webkit-changes mailing list