Remote Layer Tree: Apply layer changes to LayerTypeCustom layers to the custom layer...
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Nov 2013 22:04:27 +0000 (22:04 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 5 Nov 2013 22:04:27 +0000 (22:04 +0000)
https://bugs.webkit.org/show_bug.cgi?id=123818

Reviewed by Anders Carlsson.

Changes to the properties of a PlatformCALayer of type LayerTypeCustom are intended
to affect the custom CALayer; however, we were bundling them up with the transaction
and applying them to the CALayerHost, leading to important properties being lost.

Instead, apply them to the Web-process-side CALayer when building the transaction.

* Shared/mac/RemoteLayerTreePropertyApplier.h: Added.
* Shared/mac/RemoteLayerTreePropertyApplier.mm: Added.
(WebKit::cgColorFromColor):
(WebKit::toCAFilterType):
(WebKit::RemoteLayerTreePropertyApplier::applyPropertiesToLayer):
(WebKit::RemoteLayerTreePropertyApplier::disableActionsForLayer):
Move code to apply LayerProperties to a CALayer from RemoteLayerTreeHost.
Move code to disable actions on a CALayer from RemoteLayerTreeHost.

* UIProcess/mac/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::commit):
(WebKit::RemoteLayerTreeHost::createLayer):
Use RemoteLayerTreePropertyApplier.
Hand it a map of LayerID->CALayer so that it can look up related layers
for children and mask layers.

* WebKit2.xcodeproj/project.pbxproj:
Add RemoteLayerTreePropertyApplier.{h,mm}

* WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
(PlatformCALayerRemote::recursiveBuildTransaction):
Upon commit, apply changes to LayerTypeCustom layers to the platform layer.
Setting children or maskLayer won't work, since we don't know about other raw CALayers.
This is OK, since nothing uses those properties on custom layers.

* WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.cpp:
(PlatformCALayerRemoteCustom::PlatformCALayerRemoteCustom):
Disable actions on the root custom layer.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@158691 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/Shared/mac/RemoteLayerTreePropertyApplier.h [new file with mode: 0644]
Source/WebKit2/Shared/mac/RemoteLayerTreePropertyApplier.mm [new file with mode: 0644]
Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.mm
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp
Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.cpp

index dcc8df0..b18df95 100644 (file)
@@ -1,3 +1,45 @@
+2013-11-05  Tim Horton  <timothy_horton@apple.com>
+
+        Remote Layer Tree: Apply layer changes to LayerTypeCustom layers to the custom layer in the Web process, not to the CALayerHost
+        https://bugs.webkit.org/show_bug.cgi?id=123818
+
+        Reviewed by Anders Carlsson.
+
+        Changes to the properties of a PlatformCALayer of type LayerTypeCustom are intended
+        to affect the custom CALayer; however, we were bundling them up with the transaction
+        and applying them to the CALayerHost, leading to important properties being lost.
+
+        Instead, apply them to the Web-process-side CALayer when building the transaction.
+
+        * Shared/mac/RemoteLayerTreePropertyApplier.h: Added.
+        * Shared/mac/RemoteLayerTreePropertyApplier.mm: Added.
+        (WebKit::cgColorFromColor):
+        (WebKit::toCAFilterType):
+        (WebKit::RemoteLayerTreePropertyApplier::applyPropertiesToLayer):
+        (WebKit::RemoteLayerTreePropertyApplier::disableActionsForLayer):
+        Move code to apply LayerProperties to a CALayer from RemoteLayerTreeHost.
+        Move code to disable actions on a CALayer from RemoteLayerTreeHost.
+
+        * UIProcess/mac/RemoteLayerTreeHost.mm:
+        (WebKit::RemoteLayerTreeHost::commit):
+        (WebKit::RemoteLayerTreeHost::createLayer):
+        Use RemoteLayerTreePropertyApplier.
+        Hand it a map of LayerID->CALayer so that it can look up related layers
+        for children and mask layers.
+
+        * WebKit2.xcodeproj/project.pbxproj:
+        Add RemoteLayerTreePropertyApplier.{h,mm}
+
+        * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
+        (PlatformCALayerRemote::recursiveBuildTransaction):
+        Upon commit, apply changes to LayerTypeCustom layers to the platform layer.
+        Setting children or maskLayer won't work, since we don't know about other raw CALayers.
+        This is OK, since nothing uses those properties on custom layers.
+
+        * WebProcess/WebPage/mac/PlatformCALayerRemoteCustom.cpp:
+        (PlatformCALayerRemoteCustom::PlatformCALayerRemoteCustom):
+        Disable actions on the root custom layer.
+
 2013-11-05  Anders Carlsson  <andersca@apple.com>
 
         Begin work on a WKRemoteObjectDecoder object
diff --git a/Source/WebKit2/Shared/mac/RemoteLayerTreePropertyApplier.h b/Source/WebKit2/Shared/mac/RemoteLayerTreePropertyApplier.h
new file mode 100644 (file)
index 0000000..5804dca
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef RemoteLayerTreePropertyApplier_h
+#define RemoteLayerTreePropertyApplier_h
+
+#include "RemoteLayerTreeTransaction.h"
+#include <wtf/HashMap.h>
+
+namespace WebKit {
+
+class RemoteLayerTreePropertyApplier {
+public:
+    typedef HashMap<RemoteLayerTreeTransaction::LayerID, CALayer *> RelatedLayerMap;
+    static void applyPropertiesToLayer(CALayer *, RemoteLayerTreeTransaction::LayerProperties, RelatedLayerMap);
+    static void disableActionsForLayer(CALayer *);
+};
+
+} // namespace WebKit
+
+#endif // RemoteLayerTreePropertyApplier_h
diff --git a/Source/WebKit2/Shared/mac/RemoteLayerTreePropertyApplier.mm b/Source/WebKit2/Shared/mac/RemoteLayerTreePropertyApplier.mm
new file mode 100644 (file)
index 0000000..86d3349
--- /dev/null
@@ -0,0 +1,178 @@
+/*
+ * Copyright (C) 2013 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "config.h"
+#import "RemoteLayerTreePropertyApplier.h"
+
+#import "PlatformCALayerRemote.h"
+#import <WebCore/PlatformCAFilters.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+static RetainPtr<CGColorRef> cgColorFromColor(Color color)
+{
+    CGFloat components[4];
+    color.getRGBA(components[0], components[1], components[2], components[3]);
+
+    RetainPtr<CGColorSpaceRef> colorSpace = adoptCF(CGColorSpaceCreateDeviceRGB());
+    return adoptCF(CGColorCreate(colorSpace.get(), components));
+}
+
+static NSString *toCAFilterType(PlatformCALayer::FilterType type)
+{
+    switch (type) {
+    case PlatformCALayer::Linear:
+        return kCAFilterLinear;
+    case PlatformCALayer::Nearest:
+        return kCAFilterNearest;
+    case PlatformCALayer::Trilinear:
+        return kCAFilterTrilinear;
+    };
+    
+    ASSERT_NOT_REACHED();
+    return 0;
+}
+
+void RemoteLayerTreePropertyApplier::applyPropertiesToLayer(CALayer *layer, RemoteLayerTreeTransaction::LayerProperties properties, RelatedLayerMap relatedLayers)
+{
+    if (properties.changedProperties & RemoteLayerTreeTransaction::NameChanged)
+        layer.name = properties.name;
+
+    if (properties.changedProperties & RemoteLayerTreeTransaction::PositionChanged) {
+        layer.position = CGPointMake(properties.position.x(), properties.position.y());
+        layer.zPosition = properties.position.z();
+    }
+
+    if (properties.changedProperties & RemoteLayerTreeTransaction::AnchorPointChanged) {
+        layer.anchorPoint = CGPointMake(properties.anchorPoint.x(), properties.anchorPoint.y());
+        layer.anchorPointZ = properties.anchorPoint.z();
+    }
+
+    if (properties.changedProperties & RemoteLayerTreeTransaction::SizeChanged)
+        layer.bounds = FloatRect(FloatPoint(), properties.size);
+
+    if (properties.changedProperties & RemoteLayerTreeTransaction::BackgroundColorChanged)
+        layer.backgroundColor = cgColorFromColor(properties.backgroundColor).get();
+
+    if (properties.changedProperties & RemoteLayerTreeTransaction::ChildrenChanged) {
+        RetainPtr<NSMutableArray> children = adoptNS([[NSMutableArray alloc] initWithCapacity:properties.children.size()]);
+        for (auto child : properties.children)
+            [children addObject:relatedLayers.get(child)];
+        layer.sublayers = children.get();
+    }
+
+    if (properties.changedProperties & RemoteLayerTreeTransaction::BorderColorChanged)
+        layer.borderColor = cgColorFromColor(properties.borderColor).get();
+
+    if (properties.changedProperties & RemoteLayerTreeTransaction::BorderWidthChanged)
+        layer.borderWidth = properties.borderWidth;
+
+    if (properties.changedProperties & RemoteLayerTreeTransaction::OpacityChanged)
+        layer.opacity = properties.opacity;
+
+    if (properties.changedProperties & RemoteLayerTreeTransaction::TransformChanged)
+        layer.transform = properties.transform;
+
+    if (properties.changedProperties & RemoteLayerTreeTransaction::SublayerTransformChanged)
+        layer.sublayerTransform = properties.sublayerTransform;
+
+    if (properties.changedProperties & RemoteLayerTreeTransaction::HiddenChanged)
+        layer.hidden = properties.hidden;
+
+    if (properties.changedProperties & RemoteLayerTreeTransaction::GeometryFlippedChanged)
+        layer.geometryFlipped = properties.geometryFlipped;
+
+    if (properties.changedProperties & RemoteLayerTreeTransaction::DoubleSidedChanged)
+        layer.doubleSided = properties.doubleSided;
+
+    if (properties.changedProperties & RemoteLayerTreeTransaction::MasksToBoundsChanged)
+        layer.masksToBounds = properties.masksToBounds;
+
+    if (properties.changedProperties & RemoteLayerTreeTransaction::OpaqueChanged)
+        layer.opaque = properties.opaque;
+
+    if (properties.changedProperties & RemoteLayerTreeTransaction::MaskLayerChanged) {
+        CALayer *maskLayer = relatedLayers.get(properties.maskLayer);
+        ASSERT(!maskLayer.superlayer);
+        if (!maskLayer.superlayer)
+            layer.mask = maskLayer;
+    }
+
+    if (properties.changedProperties & RemoteLayerTreeTransaction::ContentsRectChanged)
+        layer.contentsRect = properties.contentsRect;
+
+    if (properties.changedProperties & RemoteLayerTreeTransaction::ContentsScaleChanged)
+        layer.contentsScale = properties.contentsScale;
+
+    if (properties.changedProperties & RemoteLayerTreeTransaction::MinificationFilterChanged)
+        layer.minificationFilter = toCAFilterType(properties.minificationFilter);
+
+    if (properties.changedProperties & RemoteLayerTreeTransaction::MagnificationFilterChanged)
+        layer.magnificationFilter = toCAFilterType(properties.magnificationFilter);
+
+    if (properties.changedProperties & RemoteLayerTreeTransaction::SpeedChanged)
+        layer.speed = properties.speed;
+
+    if (properties.changedProperties & RemoteLayerTreeTransaction::TimeOffsetChanged)
+        layer.timeOffset = properties.timeOffset;
+
+    if (properties.changedProperties & RemoteLayerTreeTransaction::BackingStoreChanged) {
+        if (properties.backingStore.acceleratesDrawing())
+            layer.contents = (id)properties.backingStore.surface().get();
+        else
+            layer.contents = (id)properties.backingStore.image().get();
+    }
+
+    if (properties.changedProperties & RemoteLayerTreeTransaction::FiltersChanged)
+        PlatformCAFilters::setFiltersOnLayer(layer, properties.filters);
+
+    if (properties.changedProperties & RemoteLayerTreeTransaction::EdgeAntialiasingMaskChanged)
+        layer.edgeAntialiasingMask = properties.edgeAntialiasingMask;
+}
+
+void RemoteLayerTreePropertyApplier::disableActionsForLayer(CALayer *layer)
+{
+    NSNull *nullValue = [NSNull null];
+    layer.style = @{
+        @"actions" : @{
+            @"anchorPoint" : nullValue,
+            @"anchorPointZ" : nullValue,
+            @"bounds" : nullValue,
+            @"contents" : nullValue,
+            @"contentsRect" : nullValue,
+            @"opacity" : nullValue,
+            @"position" : nullValue,
+            @"shadowColor" : nullValue,
+            @"sublayerTransform" : nullValue,
+            @"sublayers" : nullValue,
+            @"transform" : nullValue,
+            @"zPosition" : nullValue
+        }
+    };
+}
+
+} // namespace WebKit
index a1cba05..21d86a5 100644 (file)
 #import "RemoteLayerTreeHost.h"
 
 #import "RemoteLayerTreeHostMessages.h"
+#import "RemoteLayerTreePropertyApplier.h"
 #import "RemoteLayerTreeTransaction.h"
 #import "ShareableBitmap.h"
 #import "WebPageProxy.h"
 #import "WebProcessProxy.h"
-#import <WebCore/PlatformCAFilters.h>
 #import <WebCore/PlatformLayer.h>
 #import <WebKitSystemInterface.h>
 
 
 using namespace WebCore;
 
-static NSDictionary *nullActionsDictionary()
-{
-    NSNull* nullValue = [NSNull null];
-    return @{
-        @"anchorPoint" : nullValue,
-        @"anchorPointZ" : nullValue,
-        @"bounds" : nullValue,
-        @"contents" : nullValue,
-        @"contentsRect" : nullValue,
-        @"opacity" : nullValue,
-        @"position" : nullValue,
-        @"shadowColor" : nullValue,
-        @"sublayerTransform" : nullValue,
-        @"sublayers" : nullValue,
-        @"transform" : nullValue,
-        @"zPosition" : nullValue };
-}
-
 namespace WebKit {
 
 RemoteLayerTreeHost::RemoteLayerTreeHost(WebPageProxy* webPageProxy)
@@ -71,32 +53,6 @@ RemoteLayerTreeHost::~RemoteLayerTreeHost()
     m_webPageProxy->process()->removeMessageReceiver(Messages::RemoteLayerTreeHost::messageReceiverName(), m_webPageProxy->pageID());
 }
 
-static RetainPtr<CGColorRef> cgColorFromColor(Color color)
-{
-    CGFloat components[4];
-    color.getRGBA(components[0], components[1], components[2], components[3]);
-
-    RetainPtr<CGColorSpaceRef> colorSpace = adoptCF(CGColorSpaceCreateDeviceRGB());
-    RetainPtr<CGColorRef> cgColor = adoptCF(CGColorCreate(colorSpace.get(), components));
-    return cgColor;
-}
-
-static NSString *toCAFilterType(PlatformCALayer::FilterType type)
-{
-    switch (type) {
-    case PlatformCALayer::Linear:
-        return kCAFilterLinear;
-    case PlatformCALayer::Nearest:
-        return kCAFilterNearest;
-    case PlatformCALayer::Trilinear:
-        return kCAFilterTrilinear;
-    };
-
-    ASSERT_NOT_REACHED();
-    return 0;
-}
-
-
 void RemoteLayerTreeHost::commit(const RemoteLayerTreeTransaction& transaction)
 {
 #if !defined(NDEBUG)
@@ -119,99 +75,16 @@ void RemoteLayerTreeHost::commit(const RemoteLayerTreeTransaction& transaction)
         CALayer *layer = getLayer(layerID);
         ASSERT(layer);
 
-        if (properties.changedProperties & RemoteLayerTreeTransaction::NameChanged)
-            layer.name = properties.name;
-
-        if (properties.changedProperties & RemoteLayerTreeTransaction::PositionChanged) {
-            layer.position = CGPointMake(properties.position.x(), properties.position.y());
-            layer.zPosition = properties.position.z();
-        }
-
-        if (properties.changedProperties & RemoteLayerTreeTransaction::AnchorPointChanged) {
-            layer.anchorPoint = CGPointMake(properties.anchorPoint.x(), properties.anchorPoint.y());
-            layer.anchorPointZ = properties.anchorPoint.z();
-        }
-
-        if (properties.changedProperties & RemoteLayerTreeTransaction::SizeChanged)
-            layer.bounds = FloatRect(FloatPoint(), properties.size);
-
-        if (properties.changedProperties & RemoteLayerTreeTransaction::BackgroundColorChanged)
-            layer.backgroundColor = cgColorFromColor(properties.backgroundColor).get();
-
+        RemoteLayerTreePropertyApplier::RelatedLayerMap relatedLayers;
         if (properties.changedProperties & RemoteLayerTreeTransaction::ChildrenChanged) {
-            RetainPtr<NSMutableArray> children = adoptNS([[NSMutableArray alloc] initWithCapacity:properties.children.size()]);
             for (auto child : properties.children)
-                [children addObject:getLayer(child)];
-            layer.sublayers = children.get();
-        }
-
-        if (properties.changedProperties & RemoteLayerTreeTransaction::BorderColorChanged)
-            layer.borderColor = cgColorFromColor(properties.borderColor).get();
-
-        if (properties.changedProperties & RemoteLayerTreeTransaction::BorderWidthChanged)
-            layer.borderWidth = properties.borderWidth;
-
-        if (properties.changedProperties & RemoteLayerTreeTransaction::OpacityChanged)
-            layer.opacity = properties.opacity;
-
-        if (properties.changedProperties & RemoteLayerTreeTransaction::TransformChanged)
-            layer.transform = properties.transform;
-
-        if (properties.changedProperties & RemoteLayerTreeTransaction::SublayerTransformChanged)
-            layer.sublayerTransform = properties.sublayerTransform;
-
-        if (properties.changedProperties & RemoteLayerTreeTransaction::HiddenChanged)
-            layer.hidden = properties.hidden;
-
-        if (properties.changedProperties & RemoteLayerTreeTransaction::GeometryFlippedChanged)
-            layer.geometryFlipped = properties.geometryFlipped;
-
-        if (properties.changedProperties & RemoteLayerTreeTransaction::DoubleSidedChanged)
-            layer.doubleSided = properties.doubleSided;
-
-        if (properties.changedProperties & RemoteLayerTreeTransaction::MasksToBoundsChanged)
-            layer.masksToBounds = properties.masksToBounds;
-
-        if (properties.changedProperties & RemoteLayerTreeTransaction::OpaqueChanged)
-            layer.opaque = properties.opaque;
-
-        if (properties.changedProperties & RemoteLayerTreeTransaction::MaskLayerChanged) {
-            CALayer *maskLayer = getLayer(properties.maskLayer);
-            ASSERT(!maskLayer.superlayer);
-            if (!maskLayer.superlayer)
-                layer.mask = maskLayer;
-        }
-
-        if (properties.changedProperties & RemoteLayerTreeTransaction::ContentsRectChanged)
-            layer.contentsRect = properties.contentsRect;
-
-        if (properties.changedProperties & RemoteLayerTreeTransaction::ContentsScaleChanged)
-            layer.contentsScale = properties.contentsScale;
-
-        if (properties.changedProperties & RemoteLayerTreeTransaction::MinificationFilterChanged)
-            layer.minificationFilter = toCAFilterType(properties.minificationFilter);
-
-        if (properties.changedProperties & RemoteLayerTreeTransaction::MagnificationFilterChanged)
-            layer.magnificationFilter = toCAFilterType(properties.magnificationFilter);
-
-        if (properties.changedProperties & RemoteLayerTreeTransaction::SpeedChanged)
-            layer.speed = properties.speed;
-
-        if (properties.changedProperties & RemoteLayerTreeTransaction::TimeOffsetChanged)
-            layer.timeOffset = properties.timeOffset;
-
-        if (properties.changedProperties & RemoteLayerTreeTransaction::BackingStoreChanged) {
-            if (properties.backingStore.acceleratesDrawing())
-                layer.contents = (id)properties.backingStore.surface().get();
-            else
-                layer.contents = (id)properties.backingStore.image().get();
+                relatedLayers.set(child, getLayer(child));
         }
 
-        if (properties.changedProperties & RemoteLayerTreeTransaction::FiltersChanged)
-            PlatformCAFilters::setFiltersOnLayer(layer, properties.filters);
+        if (properties.changedProperties & RemoteLayerTreeTransaction::MaskLayerChanged)
+            relatedLayers.set(properties.maskLayer, getLayer(properties.maskLayer));
 
-        if (properties.changedProperties & RemoteLayerTreeTransaction::EdgeAntialiasingMaskChanged)
-            layer.edgeAntialiasingMask = properties.edgeAntialiasingMask;
+        RemoteLayerTreePropertyApplier::applyPropertiesToLayer(layer, properties, relatedLayers);
     }
 
     for (auto destroyedLayer : transaction.destroyedLayers())
@@ -249,7 +122,7 @@ CALayer *RemoteLayerTreeHost::createLayer(RemoteLayerTreeTransaction::LayerCreat
         ASSERT_NOT_REACHED();
     }
 
-    [layer setStyle:@{ @"actions" : nullActionsDictionary() }];
+    RemoteLayerTreePropertyApplier::disableActionsForLayer(layer.get());
 
     return layer.get();
 }
index 13b6ebe..66adba8 100644 (file)
                2DA049B4180CCCD300AAFA9E /* PlatformCALayerRemote.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DA049B2180CCCD300AAFA9E /* PlatformCALayerRemote.h */; };
                2DA049B7180CCD0A00AAFA9E /* GraphicsLayerCARemote.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2DA049B5180CCD0A00AAFA9E /* GraphicsLayerCARemote.cpp */; };
                2DA049B8180CCD0A00AAFA9E /* GraphicsLayerCARemote.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DA049B6180CCD0A00AAFA9E /* GraphicsLayerCARemote.h */; };
+               2DDE0AFA18298CC900F97EAA /* RemoteLayerTreePropertyApplier.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DDE0AF818298CC900F97EAA /* RemoteLayerTreePropertyApplier.h */; };
+               2DDE0AFB18298CC900F97EAA /* RemoteLayerTreePropertyApplier.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2DDE0AF918298CC900F97EAA /* RemoteLayerTreePropertyApplier.mm */; };
                31099973146C75A20029DEB9 /* WebNotificationClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31099971146C759B0029DEB9 /* WebNotificationClient.cpp */; };
                310999C7146C9E3D0029DEB9 /* WebNotificationClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 31099968146C71F50029DEB9 /* WebNotificationClient.h */; };
                312C0C4A146DDC8A0016C911 /* WKNotificationProvider.h in Headers */ = {isa = PBXBuildFile; fileRef = 312C0C49146DDC8A0016C911 /* WKNotificationProvider.h */; settings = {ATTRIBUTES = (Private, ); }; };
                2DA049B2180CCCD300AAFA9E /* PlatformCALayerRemote.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformCALayerRemote.h; sourceTree = "<group>"; };
                2DA049B5180CCD0A00AAFA9E /* GraphicsLayerCARemote.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GraphicsLayerCARemote.cpp; sourceTree = "<group>"; };
                2DA049B6180CCD0A00AAFA9E /* GraphicsLayerCARemote.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GraphicsLayerCARemote.h; sourceTree = "<group>"; };
+               2DDE0AF818298CC900F97EAA /* RemoteLayerTreePropertyApplier.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteLayerTreePropertyApplier.h; sourceTree = "<group>"; };
+               2DDE0AF918298CC900F97EAA /* RemoteLayerTreePropertyApplier.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RemoteLayerTreePropertyApplier.mm; sourceTree = "<group>"; };
                31099968146C71F50029DEB9 /* WebNotificationClient.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebNotificationClient.h; sourceTree = "<group>"; };
                31099971146C759B0029DEB9 /* WebNotificationClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebNotificationClient.cpp; sourceTree = "<group>"; };
                312C0C49146DDC8A0016C911 /* WKNotificationProvider.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKNotificationProvider.h; sourceTree = "<group>"; };
                                E1CC1B8F12D7EADF00625838 /* PrintInfoMac.mm */,
                                2D47B56A1810714E003A3AEE /* RemoteLayerBackingStore.mm */,
                                2D47B56B1810714E003A3AEE /* RemoteLayerBackingStore.h */,
+                               2DDE0AF818298CC900F97EAA /* RemoteLayerTreePropertyApplier.h */,
+                               2DDE0AF918298CC900F97EAA /* RemoteLayerTreePropertyApplier.mm */,
                                1AF1AC6A1651759E00C17D7F /* RemoteLayerTreeTransaction.h */,
                                1AF1AC691651759E00C17D7F /* RemoteLayerTreeTransaction.mm */,
                                1AAB4AA91296F1540023952F /* SandboxExtensionMac.mm */,
                                312C0C4A146DDC8A0016C911 /* WKNotificationProvider.h in Headers */,
                                1AD09F2C1743F8E600A95E50 /* WKNPAPIPlugInContainer.h in Headers */,
                                BC407602124FF0270068F20A /* WKNumber.h in Headers */,
+                               2DDE0AFA18298CC900F97EAA /* RemoteLayerTreePropertyApplier.h in Headers */,
                                7CD5EBB91746A15B000C1C45 /* WKObjCTypeWrapperRef.h in Headers */,
                                378E1A40181EDA010031007A /* WKObject.h in Headers */,
                                BC857FE612B843D800EDEB2E /* WKOpenPanelParameters.h in Headers */,
                                BCF69FA31176D01400471A52 /* WebNavigationData.cpp in Sources */,
                                31A2EC48148997C200810D71 /* WebNotification.cpp in Sources */,
                                31099973146C75A20029DEB9 /* WebNotificationClient.cpp in Sources */,
+                               2DDE0AFB18298CC900F97EAA /* RemoteLayerTreePropertyApplier.mm in Sources */,
                                31312620148FF82C00BA2A39 /* WebNotificationManager.cpp in Sources */,
                                31BA924D148831260062EDB5 /* WebNotificationManagerMessageReceiver.cpp in Sources */,
                                31A2EC4A148997C200810D71 /* WebNotificationManagerProxy.cpp in Sources */,
index 80bf288..f20a83a 100644 (file)
@@ -33,6 +33,7 @@
 #import "PlatformCALayerRemoteTiledBacking.h"
 #import "RemoteLayerBackingStore.h"
 #import "RemoteLayerTreeContext.h"
+#import "RemoteLayerTreePropertyApplier.h"
 #import <WebCore/AnimationUtilities.h>
 #import <WebCore/GraphicsContext.h>
 #import <WebCore/GraphicsLayerCA.h>
@@ -116,6 +117,12 @@ void PlatformCALayerRemote::recursiveBuildTransaction(RemoteLayerTreeTransaction
                 m_properties.children.append(toPlatformCALayerRemote(layer.get())->layerID());
         }
 
+        if (m_layerType == LayerTypeCustom) {
+            RemoteLayerTreePropertyApplier::applyPropertiesToLayer(platformLayer(), m_properties, RemoteLayerTreePropertyApplier::RelatedLayerMap());
+            m_properties.changedProperties = RemoteLayerTreeTransaction::NoChange;
+            return;
+        }
+
         transaction.layerPropertiesChanged(this, m_properties);
         m_properties.changedProperties = RemoteLayerTreeTransaction::NoChange;
     }
index 32bc5eb..039e9b1 100644 (file)
@@ -31,6 +31,7 @@
 
 #import "LayerHostingContext.h"
 #import "RemoteLayerTreeContext.h"
+#import "RemoteLayerTreePropertyApplier.h"
 #import "WebProcess.h"
 #import <WebCore/GraphicsLayerCA.h>
 #import <WebCore/PlatformCALayerMac.h>
@@ -57,6 +58,7 @@ PlatformCALayerRemoteCustom::PlatformCALayerRemoteCustom(PlatformLayer* customLa
     m_layerHostingContext->setRootLayer(customLayer);
 
     m_platformLayer = customLayer;
+    RemoteLayerTreePropertyApplier::disableActionsForLayer(customLayer);
 }
 
 PlatformCALayerRemoteCustom::~PlatformCALayerRemoteCustom()