Title: [157547] trunk/Source
Revision
157547
Author
[email protected]
Date
2013-10-16 18:46:32 -0700 (Wed, 16 Oct 2013)

Log Message

Remote Layer Tree: Complete support for simple layer properties
https://bugs.webkit.org/show_bug.cgi?id=122933

Reviewed by Anders Carlsson.

Add remote layer tree support for maskLayer, contentsRect, contentsScale,
minificationFilter, magnificationFilter, speed, and timeOffset.

No new tests, not yet testable.

* Shared/mac/RemoteLayerTreeTransaction.h:
* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
(WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
(WebKit::dumpProperty):
(WebKit::dumpChangedLayers):
Add the new properties.

* UIProcess/mac/RemoteLayerTreeHost.mm:
(WebKit::toCAFilterType):
(WebKit::RemoteLayerTreeHost::commit):
Apply the new properties.

* WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
(PlatformCALayerRemote::setSublayers):
(PlatformCALayerRemote::appendSublayer):
(PlatformCALayerRemote::insertSublayer):
Ensure that passed-in sublayers are always also PlatformCALayerRemote instances.
These are ASSERT_WITH_SECURITY_IMPLICATION as we will later unconditionally static_cast
them to PlatformCALayerRemote.

(PlatformCALayerRemote::setMask):
(PlatformCALayerRemote::setContentsRect):
(PlatformCALayerRemote::setMinificationFilter):
(PlatformCALayerRemote::setMagnificationFilter):
(PlatformCALayerRemote::setSpeed):
(PlatformCALayerRemote::setTimeOffset):
(PlatformCALayerRemote::contentsScale):
(PlatformCALayerRemote::setContentsScale):
Remove setFrame, store the new properties.

* WebProcess/WebPage/mac/PlatformCALayerRemote.h:
Remove setFrame, add isRemote, fix pointer side on playerLayer.

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::setName):
Don't dump the CALayer pointer if we own a PlatformCALayerRemote.

(WebCore::GraphicsLayerCA::recursiveCommitChanges):
Fix the visible tile wash (my fault!), and make it use setPosition and
setBounds instead of setFrame; while more convenient, it is the only
caller of setFrame, so we'll remove it.

* platform/graphics/ca/PlatformCALayer.h:
(WebCore::PlatformCALayer::isRemote): Added.

* platform/graphics/ca/mac/PlatformCALayerMac.h:
* platform/graphics/ca/mac/PlatformCALayerMac.mm:
(nullActionsDictionary):
(toCAFilterType):
(PlatformCALayerMac::synchronouslyDisplayTilesInRect):
(PlatformCALayerMac::playerLayer):
Remove setFrame, fix some pointer sides.

* platform/graphics/ca/win/PlatformCALayerWin.cpp:
* platform/graphics/ca/win/PlatformCALayerWin.h:
Remove setFrame.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (157546 => 157547)


--- trunk/Source/WebCore/ChangeLog	2013-10-17 01:23:56 UTC (rev 157546)
+++ trunk/Source/WebCore/ChangeLog	2013-10-17 01:46:32 UTC (rev 157547)
@@ -1,3 +1,36 @@
+2013-10-16  Tim Horton  <[email protected]>
+
+        Remote Layer Tree: Complete support for simple layer properties
+        https://bugs.webkit.org/show_bug.cgi?id=122933
+
+        Reviewed by Anders Carlsson.
+
+        No new tests, not yet testable.
+
+        * platform/graphics/ca/GraphicsLayerCA.cpp:
+        (WebCore::GraphicsLayerCA::setName):
+        Don't dump the CALayer pointer if we own a PlatformCALayerRemote.
+
+        (WebCore::GraphicsLayerCA::recursiveCommitChanges):
+        Fix the visible tile wash (my fault!), and make it use setPosition and
+        setBounds instead of setFrame; while more convenient, it is the only
+        caller of setFrame, so we'll remove it.
+
+        * platform/graphics/ca/PlatformCALayer.h:
+        (WebCore::PlatformCALayer::isRemote): Added.
+
+        * platform/graphics/ca/mac/PlatformCALayerMac.h:
+        * platform/graphics/ca/mac/PlatformCALayerMac.mm:
+        (nullActionsDictionary):
+        (toCAFilterType):
+        (PlatformCALayerMac::synchronouslyDisplayTilesInRect):
+        (PlatformCALayerMac::playerLayer):
+        Remove setFrame, fix some pointer sides.
+
+        * platform/graphics/ca/win/PlatformCALayerWin.cpp:
+        * platform/graphics/ca/win/PlatformCALayerWin.h:
+        Remove setFrame.
+
 2013-10-16  Andreas Kling  <[email protected]>
 
         Take RenderObjects out of the arena.

Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (157546 => 157547)


--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp	2013-10-17 01:23:56 UTC (rev 157546)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp	2013-10-17 01:46:32 UTC (rev 157547)
@@ -375,7 +375,12 @@
 
 void GraphicsLayerCA::setName(const String& name)
 {
-    String longName = String::format("CALayer(%p) GraphicsLayer(%p) ", m_layer->platformLayer(), this) + name;
+    String caLayerDescription;
+
+    if (!m_layer->isRemote())
+        caLayerDescription = String::format("CALayer(%p) ", m_layer->platformLayer());
+
+    String longName = caLayerDescription + String::format("GraphicsLayer(%p) ", this) + name;
     GraphicsLayer::setName(longName);
     noteLayerPropertyChanged(NameChanged);
 }
@@ -1141,7 +1146,7 @@
         static Color washFillColor(255, 0, 0, 50);
         static Color washBorderColor(255, 0, 0, 100);
         
-        m_visibleTileWashLayer = createPlatformCALayer(createPlatformCALayer, this);
+        m_visibleTileWashLayer = createPlatformCALayer(PlatformCALayer::LayerTypeLayer, this);
         String name = String::format("Visible Tile Wash Layer %p", m_visibleTileWashLayer->platformLayer());
         m_visibleTileWashLayer->setName(name);
         m_visibleTileWashLayer->setAnchorPoint(FloatPoint3D(0, 0, 0));
@@ -1151,8 +1156,10 @@
         noteSublayersChanged(DontScheduleFlush);
     }
 
-    if (m_visibleTileWashLayer)
-        m_visibleTileWashLayer->setFrame(m_visibleRect);
+    if (m_visibleTileWashLayer) {
+        m_visibleTileWashLayer->setPosition(m_visibleRect.location());
+        m_visibleTileWashLayer->setBounds(FloatRect(FloatPoint(), m_visibleRect.size()));
+    }
 #endif
 
     bool hadChanges = m_uncommittedChanges;

Modified: trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h (157546 => 157547)


--- trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h	2013-10-17 01:23:56 UTC (rev 157546)
+++ trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h	2013-10-17 01:46:32 UTC (rev 157547)
@@ -96,6 +96,7 @@
     virtual void setContentsChanged() = 0;
 
     LayerType layerType() const { return m_layerType; }
+    virtual bool isRemote() const { return false; }
 
     virtual PlatformCALayer* superlayer() const = 0;
     virtual void removeFromSuperlayer() = 0;
@@ -175,8 +176,6 @@
 
     virtual void setName(const String&) = 0;
 
-    virtual void setFrame(const FloatRect&) = 0;
-
     virtual void setSpeed(float) = 0;
 
     virtual void setTimeOffset(CFTimeInterval) = 0;

Modified: trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.h (157546 => 157547)


--- trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.h	2013-10-17 01:23:56 UTC (rev 157546)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.h	2013-10-17 01:46:32 UTC (rev 157547)
@@ -126,8 +126,6 @@
 
     virtual void setName(const String&) OVERRIDE;
 
-    virtual void setFrame(const FloatRect&) OVERRIDE;
-
     virtual void setSpeed(float) OVERRIDE;
 
     virtual void setTimeOffset(CFTimeInterval) OVERRIDE;
@@ -144,7 +142,7 @@
 private:
     PlatformCALayerMac(LayerType, PlatformLayer*, PlatformCALayerClient* owner);
 
-    virtual AVPlayerLayer* playerLayer() const OVERRIDE;
+    virtual AVPlayerLayer *playerLayer() const OVERRIDE;
 
     RetainPtr<NSObject> m_delegate;
     OwnPtr<PlatformCALayerList> m_customSublayers;

Modified: trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm (157546 => 157547)


--- trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm	2013-10-17 01:23:56 UTC (rev 157546)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm	2013-10-17 01:46:32 UTC (rev 157547)
@@ -141,10 +141,10 @@
         [static_cast<WebAnimationDelegate*>(m_delegate.get()) setOwner:this];        
 }
 
-static NSDictionary* nullActionsDictionary()
+static NSDictionary *nullActionsDictionary()
 {
-    NSNull* nullValue = [NSNull null];
-    NSDictionary* actions = [NSDictionary dictionaryWithObjectsAndKeys:
+    NSNull *nullValue = [NSNull null];
+    NSDictionary *actions = [NSDictionary dictionaryWithObjectsAndKeys:
                              nullValue, @"anchorPoint",
                              nullValue, @"anchorPointZ",
                              nullValue, @"bounds",
@@ -161,7 +161,7 @@
     return actions;
 }
 
-static NSString* toCAFilterType(PlatformCALayer::FilterType type)
+static NSString *toCAFilterType(PlatformCALayer::FilterType type)
 {
     switch (type) {
     case PlatformCALayer::Linear: return kCAFilterLinear;
@@ -696,13 +696,6 @@
     END_BLOCK_OBJC_EXCEPTIONS
 }
 
-void PlatformCALayerMac::setFrame(const FloatRect& value)
-{
-    BEGIN_BLOCK_OBJC_EXCEPTIONS
-    [m_layer.get() setFrame:value];
-    END_BLOCK_OBJC_EXCEPTIONS
-}
-
 void PlatformCALayerMac::setSpeed(float value)
 {
     BEGIN_BLOCK_OBJC_EXCEPTIONS
@@ -743,7 +736,7 @@
     if (m_layerType != LayerTypeWebTiledLayer)
         return;
 
-    WebTiledLayer *tiledLayer = static_cast<WebTiledLayer*>(m_layer.get());
+    WebTiledLayer *tiledLayer = static_cast<WebTiledLayer *>(m_layer.get());
 
     BEGIN_BLOCK_OBJC_EXCEPTIONS
     BOOL oldCanDrawConcurrently = [tiledLayer canDrawConcurrently];
@@ -753,10 +746,10 @@
     END_BLOCK_OBJC_EXCEPTIONS
 }
 
-AVPlayerLayer* PlatformCALayerMac::playerLayer() const
+AVPlayerLayer *PlatformCALayerMac::playerLayer() const
 {
     ASSERT([m_layer.get() isKindOfClass:getAVPlayerLayerClass()]);
-    return (AVPlayerLayer*)m_layer.get();
+    return (AVPlayerLayer *)m_layer.get();
 }
 
 #endif // USE(ACCELERATED_COMPOSITING)

Modified: trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp (157546 => 157547)


--- trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp	2013-10-17 01:23:56 UTC (rev 157546)
+++ trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp	2013-10-17 01:46:32 UTC (rev 157547)
@@ -528,12 +528,6 @@
     setNeedsCommit();
 }
 
-void PlatformCALayerWin::setFrame(const FloatRect& value)
-{
-    intern(this)->setFrame(value);
-    setNeedsLayout();
-}
-
 void PlatformCALayerWin::setSpeed(float value)
 {
     CACFLayerSetSpeed(m_layer.get(), value);

Modified: trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.h (157546 => 157547)


--- trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.h	2013-10-17 01:23:56 UTC (rev 157546)
+++ trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.h	2013-10-17 01:46:32 UTC (rev 157547)
@@ -119,8 +119,6 @@
 
     virtual void setName(const String&) OVERRIDE;
 
-    virtual void setFrame(const FloatRect&) OVERRIDE;
-
     virtual void setSpeed(float) OVERRIDE;
 
     virtual void setTimeOffset(CFTimeInterval) OVERRIDE;

Modified: trunk/Source/WebKit2/ChangeLog (157546 => 157547)


--- trunk/Source/WebKit2/ChangeLog	2013-10-17 01:23:56 UTC (rev 157546)
+++ trunk/Source/WebKit2/ChangeLog	2013-10-17 01:46:32 UTC (rev 157547)
@@ -1,3 +1,47 @@
+2013-10-16  Tim Horton  <[email protected]>
+
+        Remote Layer Tree: Complete support for simple layer properties
+        https://bugs.webkit.org/show_bug.cgi?id=122933
+
+        Reviewed by Anders Carlsson.
+
+        Add remote layer tree support for maskLayer, contentsRect, contentsScale,
+        minificationFilter, magnificationFilter, speed, and timeOffset.
+
+        * Shared/mac/RemoteLayerTreeTransaction.h:
+        * Shared/mac/RemoteLayerTreeTransaction.mm:
+        (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
+        (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
+        (WebKit::dumpProperty):
+        (WebKit::dumpChangedLayers):
+        Add the new properties.
+
+        * UIProcess/mac/RemoteLayerTreeHost.mm:
+        (WebKit::toCAFilterType):
+        (WebKit::RemoteLayerTreeHost::commit):
+        Apply the new properties.
+
+        * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
+        (PlatformCALayerRemote::setSublayers):
+        (PlatformCALayerRemote::appendSublayer):
+        (PlatformCALayerRemote::insertSublayer):
+        Ensure that passed-in sublayers are always also PlatformCALayerRemote instances.
+        These are ASSERT_WITH_SECURITY_IMPLICATION as we will later unconditionally static_cast
+        them to PlatformCALayerRemote.
+
+        (PlatformCALayerRemote::setMask):
+        (PlatformCALayerRemote::setContentsRect):
+        (PlatformCALayerRemote::setMinificationFilter):
+        (PlatformCALayerRemote::setMagnificationFilter):
+        (PlatformCALayerRemote::setSpeed):
+        (PlatformCALayerRemote::setTimeOffset):
+        (PlatformCALayerRemote::contentsScale):
+        (PlatformCALayerRemote::setContentsScale):
+        Remove setFrame, store the new properties.
+
+        * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
+        Remove setFrame, add isRemote, fix pointer side on playerLayer.
+
 2013-10-16  Ryuan Choi  <[email protected]>
 
         Unreviewed build fix attempt on EFL port after r157520 and r157523

Modified: trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h (157546 => 157547)


--- trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h	2013-10-17 01:23:56 UTC (rev 157546)
+++ trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h	2013-10-17 01:46:32 UTC (rev 157547)
@@ -64,7 +64,14 @@
         GeometryFlippedChanged = 1 << 13,
         DoubleSidedChanged = 1 << 14,
         MasksToBoundsChanged = 1 << 15,
-        OpaqueChanged = 1 << 16
+        OpaqueChanged = 1 << 16,
+        MaskLayerChanged = 1 << 17,
+        ContentsRectChanged = 1 << 18,
+        ContentsScaleChanged = 1 << 19,
+        MinificationFilterChanged = 1 << 20,
+        MagnificationFilterChanged = 1 << 21,
+        SpeedChanged = 1 << 22,
+        TimeOffsetChanged = 1 << 23
     };
 
     struct LayerCreationProperties {
@@ -103,6 +110,13 @@
         bool doubleSided;
         bool masksToBounds;
         bool opaque;
+        LayerID maskLayer;
+        WebCore::FloatRect contentsRect;
+        float contentsScale;
+        WebCore::PlatformCALayer::FilterType minificationFilter;
+        WebCore::PlatformCALayer::FilterType magnificationFilter;
+        float speed;
+        double timeOffset;
     };
 
     explicit RemoteLayerTreeTransaction();

Modified: trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm (157546 => 157547)


--- trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm	2013-10-17 01:23:56 UTC (rev 157546)
+++ trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm	2013-10-17 01:46:32 UTC (rev 157547)
@@ -116,6 +116,27 @@
 
     if (changedProperties & OpaqueChanged)
         encoder << opaque;
+
+    if (changedProperties & MaskLayerChanged)
+        encoder << maskLayer;
+
+    if (changedProperties & ContentsRectChanged)
+        encoder << contentsRect;
+
+    if (changedProperties & ContentsScaleChanged)
+        encoder << contentsScale;
+
+    if (changedProperties & MinificationFilterChanged)
+        encoder.encodeEnum(minificationFilter);
+
+    if (changedProperties & MagnificationFilterChanged)
+        encoder.encodeEnum(magnificationFilter);
+
+    if (changedProperties & SpeedChanged)
+        encoder << speed;
+
+    if (changedProperties & TimeOffsetChanged)
+        encoder << timeOffset;
 }
 
 bool RemoteLayerTreeTransaction::LayerProperties::decode(CoreIPC::ArgumentDecoder& decoder, LayerProperties& result)
@@ -208,6 +229,41 @@
             return false;
     }
 
+    if (result.changedProperties & MaskLayerChanged) {
+        if (!decoder.decode(result.maskLayer))
+            return false;
+    }
+
+    if (result.changedProperties & ContentsRectChanged) {
+        if (!decoder.decode(result.contentsRect))
+            return false;
+    }
+
+    if (result.changedProperties & ContentsScaleChanged) {
+        if (!decoder.decode(result.contentsScale))
+            return false;
+    }
+
+    if (result.changedProperties & MinificationFilterChanged) {
+        if (!decoder.decodeEnum(result.minificationFilter))
+            return false;
+    }
+
+    if (result.changedProperties & MagnificationFilterChanged) {
+        if (!decoder.decodeEnum(result.magnificationFilter))
+            return false;
+    }
+
+    if (result.changedProperties & SpeedChanged) {
+        if (!decoder.decode(result.speed))
+            return false;
+    }
+
+    if (result.changedProperties & TimeOffsetChanged) {
+        if (!decoder.decode(result.timeOffset))
+            return false;
+    }
+
     return true;
 }
 
@@ -300,6 +356,32 @@
     builder.append(ts.release());
 }
 
+static void dumpProperty(StringBuilder& builder, String name, const PlatformCALayer::FilterType filterType)
+{
+    builder.append('\n');
+    writeIndent(builder, 3);
+    builder.append('(');
+    builder.append(name);
+    builder.append(' ');
+
+    switch (filterType) {
+        case PlatformCALayer::Linear:
+            builder.append("linear");
+            break;
+        case PlatformCALayer::Nearest:
+            builder.append("nearest");
+            break;
+        case PlatformCALayer::Trilinear:
+            builder.append("trilinear");
+            break;
+        default:
+            ASSERT_NOT_REACHED();
+            break;
+    }
+
+    builder.append(")");
+}
+
 static void dumpChangedLayers(StringBuilder& builder, const HashMap<RemoteLayerTreeTransaction::LayerID, RemoteLayerTreeTransaction::LayerProperties>& changedLayerProperties)
 {
     if (changedLayerProperties.isEmpty())
@@ -453,6 +535,58 @@
             builder.append(')');
         }
 
+        if (layerProperties.changedProperties & RemoteLayerTreeTransaction::MaskLayerChanged) {
+            builder.append('\n');
+            writeIndent(builder, 3);
+            builder.append("(maskLayer ");
+            builder.appendNumber(layerProperties.maskLayer);
+            builder.append(')');
+        }
+
+        if (layerProperties.changedProperties & RemoteLayerTreeTransaction::ContentsRectChanged) {
+            builder.append('\n');
+            writeIndent(builder, 3);
+            builder.append("(contentsRect ");
+            builder.appendNumber(layerProperties.contentsRect.x());
+            builder.append(' ');
+            builder.appendNumber(layerProperties.contentsRect.y());
+            builder.append(' ');
+            builder.appendNumber(layerProperties.contentsRect.width());
+            builder.append(' ');
+            builder.appendNumber(layerProperties.contentsRect.height());
+            builder.append(')');
+        }
+
+        if (layerProperties.changedProperties & RemoteLayerTreeTransaction::ContentsScaleChanged) {
+            builder.append('\n');
+            writeIndent(builder, 3);
+            builder.append("(contentsScale ");
+            builder.appendNumber(layerProperties.contentsScale);
+            builder.append(')');
+        }
+
+        if (layerProperties.changedProperties & RemoteLayerTreeTransaction::MinificationFilterChanged)
+            dumpProperty(builder, "minificationFilter", layerProperties.minificationFilter);
+
+        if (layerProperties.changedProperties & RemoteLayerTreeTransaction::MagnificationFilterChanged)
+            dumpProperty(builder, "magnificationFilter", layerProperties.magnificationFilter);
+
+        if (layerProperties.changedProperties & RemoteLayerTreeTransaction::SpeedChanged) {
+            builder.append('\n');
+            writeIndent(builder, 3);
+            builder.append("(speed ");
+            builder.appendNumber(layerProperties.speed);
+            builder.append(')');
+        }
+
+        if (layerProperties.changedProperties & RemoteLayerTreeTransaction::TimeOffsetChanged) {
+            builder.append('\n');
+            writeIndent(builder, 3);
+            builder.append("(timeOffset ");
+            builder.appendNumber(layerProperties.timeOffset);
+            builder.append(')');
+        }
+
         builder.append(")\n");
     }
 }

Modified: trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.mm (157546 => 157547)


--- trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.mm	2013-10-17 01:23:56 UTC (rev 157546)
+++ trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.mm	2013-10-17 01:46:32 UTC (rev 157547)
@@ -78,6 +78,22 @@
     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)
 {
 #ifndef NDEBUG
@@ -155,6 +171,31 @@
 
         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.contentsRect = properties.contentsRect;
+
+        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;
     }
 
     for (auto destroyedLayer : transaction.destroyedLayers())

Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp (157546 => 157547)


--- trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp	2013-10-17 01:23:56 UTC (rev 157546)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp	2013-10-17 01:46:32 UTC (rev 157547)
@@ -114,6 +114,12 @@
 
 void PlatformCALayerRemote::setSublayers(const PlatformCALayerList& list)
 {
+#ifndef ASSERT_DISABLED
+    for (const auto& layer : list) {
+        ASSERT_WITH_SECURITY_IMPLICATION(layer->isRemote());
+    }
+#endif
+
     m_children = list;
     m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::ChildrenChanged);
 }
@@ -126,12 +132,16 @@
 
 void PlatformCALayerRemote::appendSublayer(PlatformCALayer* layer)
 {
+    ASSERT_WITH_SECURITY_IMPLICATION(layer->isRemote());
+
     m_children.append(layer);
     m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::ChildrenChanged);
 }
 
 void PlatformCALayerRemote::insertSublayer(PlatformCALayer* layer, size_t index)
 {
+    ASSERT_WITH_SECURITY_IMPLICATION(layer->isRemote());
+
     m_children.insert(index, layer);
     m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::ChildrenChanged);
 }
@@ -161,6 +171,10 @@
 
 void PlatformCALayerRemote::setMask(PlatformCALayer* layer)
 {
+    ASSERT_WITH_SECURITY_IMPLICATION(layer->isRemote());
+
+    m_properties.maskLayer = static_cast<PlatformCALayerRemote*>(layer)->layerID();
+    m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::MaskLayerChanged);
 }
 
 bool PlatformCALayerRemote::isOpaque() const
@@ -283,14 +297,20 @@
 
 void PlatformCALayerRemote::setContentsRect(const FloatRect& value)
 {
+    m_properties.contentsRect = value;
+    m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::ContentsRectChanged);
 }
 
 void PlatformCALayerRemote::setMinificationFilter(FilterType value)
 {
+    m_properties.minificationFilter = value;
+    m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::MinificationFilterChanged);
 }
 
 void PlatformCALayerRemote::setMagnificationFilter(FilterType value)
 {
+    m_properties.magnificationFilter = value;
+    m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::MagnificationFilterChanged);
 }
 
 Color PlatformCALayerRemote::backgroundColor() const
@@ -348,25 +368,27 @@
     m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::NameChanged);
 }
 
-void PlatformCALayerRemote::setFrame(const FloatRect& value)
-{
-}
-
 void PlatformCALayerRemote::setSpeed(float value)
 {
+    m_properties.speed = value;
+    m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::SpeedChanged);
 }
 
 void PlatformCALayerRemote::setTimeOffset(CFTimeInterval value)
 {
+    m_properties.timeOffset = value;
+    m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::TimeOffsetChanged);
 }
 
 float PlatformCALayerRemote::contentsScale() const
 {
-    return 0;
+    return m_properties.contentsScale;
 }
 
 void PlatformCALayerRemote::setContentsScale(float value)
 {
+    m_properties.contentsScale = value;
+    m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::ContentsScaleChanged);
 }
 
 TiledBacking* PlatformCALayerRemote::tiledBacking()

Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h (157546 => 157547)


--- trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h	2013-10-17 01:23:56 UTC (rev 157546)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h	2013-10-17 01:46:32 UTC (rev 157547)
@@ -45,6 +45,8 @@
 
     RemoteLayerTreeTransaction::LayerID layerID() { return m_layerID; }
 
+    virtual bool isRemote() const OVERRIDE { return true; }
+
     virtual bool usesTiledBackingLayer() const OVERRIDE { return false; }
 
     virtual PlatformLayer* platformLayer() const OVERRIDE { return nullptr; }
@@ -129,8 +131,6 @@
 
     virtual void setName(const String&) OVERRIDE;
 
-    virtual void setFrame(const WebCore::FloatRect&) OVERRIDE;
-
     virtual void setSpeed(float) OVERRIDE;
 
     virtual void setTimeOffset(CFTimeInterval) OVERRIDE;
@@ -147,7 +147,7 @@
 private:
     PlatformCALayerRemote(WebCore::PlatformCALayer::LayerType, WebCore::PlatformCALayerClient* owner, RemoteLayerTreeContext* context);
 
-    virtual AVPlayerLayer* playerLayer() const OVERRIDE;
+    virtual AVPlayerLayer *playerLayer() const OVERRIDE;
 
     RemoteLayerTreeTransaction::LayerID m_layerID;
     RemoteLayerTreeTransaction::LayerProperties m_properties;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to