Remote Layer Tree: Complete support for simple layer properties
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Oct 2013 01:46:32 +0000 (01:46 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Oct 2013 01:46:32 +0000 (01:46 +0000)
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.

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

13 files changed:
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
Source/WebCore/platform/graphics/ca/PlatformCALayer.h
Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.h
Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm
Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp
Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.h
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h
Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm
Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.mm
Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp
Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h

index 3639971..c83069f 100644 (file)
@@ -1,3 +1,36 @@
+2013-10-16  Tim Horton  <timothy_horton@apple.com>
+
+        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  <akling@apple.com>
 
         Take RenderObjects out of the arena.
index 3f6124c..d6e2bbe 100644 (file)
@@ -375,7 +375,12 @@ void GraphicsLayerCA::willBeDestroyed()
 
 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 @@ void GraphicsLayerCA::recursiveCommitChanges(const CommitState& commitState, con
         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 @@ void GraphicsLayerCA::recursiveCommitChanges(const CommitState& commitState, con
         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;
index e57a542..2c13774 100644 (file)
@@ -96,6 +96,7 @@ public:
     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 @@ public:
 
     virtual void setName(const String&) = 0;
 
-    virtual void setFrame(const FloatRect&) = 0;
-
     virtual void setSpeed(float) = 0;
 
     virtual void setTimeOffset(CFTimeInterval) = 0;
index 968edb1..6042670 100644 (file)
@@ -126,8 +126,6 @@ public:
 
     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 @@ public:
 private:
     PlatformCALayerMac(LayerType, PlatformLayer*, PlatformCALayerClient* owner);
 
-    virtual AVPlayerLayerplayerLayer() const OVERRIDE;
+    virtual AVPlayerLayer *playerLayer() const OVERRIDE;
 
     RetainPtr<NSObject> m_delegate;
     OwnPtr<PlatformCALayerList> m_customSublayers;
index ab85e41..b9b49e0 100644 (file)
@@ -141,10 +141,10 @@ void PlatformCALayerMac::setOwner(PlatformCALayerClient* owner)
         [static_cast<WebAnimationDelegate*>(m_delegate.get()) setOwner:this];        
 }
 
-static NSDictionarynullActionsDictionary()
+static NSDictionary *nullActionsDictionary()
 {
-    NSNullnullValue = [NSNull null];
-    NSDictionaryactions = [NSDictionary dictionaryWithObjectsAndKeys:
+    NSNull *nullValue = [NSNull null];
+    NSDictionary *actions = [NSDictionary dictionaryWithObjectsAndKeys:
                              nullValue, @"anchorPoint",
                              nullValue, @"anchorPointZ",
                              nullValue, @"bounds",
@@ -161,7 +161,7 @@ static NSDictionary* nullActionsDictionary()
     return actions;
 }
 
-static NSStringtoCAFilterType(PlatformCALayer::FilterType type)
+static NSString *toCAFilterType(PlatformCALayer::FilterType type)
 {
     switch (type) {
     case PlatformCALayer::Linear: return kCAFilterLinear;
@@ -696,13 +696,6 @@ void PlatformCALayerMac::setName(const String& value)
     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 @@ void PlatformCALayerMac::synchronouslyDisplayTilesInRect(const FloatRect& rect)
     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 @@ void PlatformCALayerMac::synchronouslyDisplayTilesInRect(const FloatRect& rect)
     END_BLOCK_OBJC_EXCEPTIONS
 }
 
-AVPlayerLayerPlatformCALayerMac::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)
index 85141f0..4453f3d 100644 (file)
@@ -528,12 +528,6 @@ void PlatformCALayerWin::setName(const String& value)
     setNeedsCommit();
 }
 
-void PlatformCALayerWin::setFrame(const FloatRect& value)
-{
-    intern(this)->setFrame(value);
-    setNeedsLayout();
-}
-
 void PlatformCALayerWin::setSpeed(float value)
 {
     CACFLayerSetSpeed(m_layer.get(), value);
index 177fa7a..aa439f8 100644 (file)
@@ -119,8 +119,6 @@ public:
 
     virtual void setName(const String&) OVERRIDE;
 
-    virtual void setFrame(const FloatRect&) OVERRIDE;
-
     virtual void setSpeed(float) OVERRIDE;
 
     virtual void setTimeOffset(CFTimeInterval) OVERRIDE;
index d0b33d4..2e6edc1 100644 (file)
@@ -1,3 +1,47 @@
+2013-10-16  Tim Horton  <timothy_horton@apple.com>
+
+        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  <ryuan.choi@samsung.com>
 
         Unreviewed build fix attempt on EFL port after r157520 and r157523
index 37c0e0d..7d48404 100644 (file)
@@ -64,7 +64,14 @@ public:
         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 @@ public:
         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();
index 10950ec..89b4909 100644 (file)
@@ -116,6 +116,27 @@ void RemoteLayerTreeTransaction::LayerProperties::encode(CoreIPC::ArgumentEncode
 
     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 @@ bool RemoteLayerTreeTransaction::LayerProperties::decode(CoreIPC::ArgumentDecode
             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 @@ static void dumpProperty(StringBuilder& builder, String name, const Transformati
     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 @@ static void dumpChangedLayers(StringBuilder& builder, const HashMap<RemoteLayerT
             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");
     }
 }
index b10ce50..feb0847 100644 (file)
@@ -78,6 +78,22 @@ static RetainPtr<CGColorRef> cgColorFromColor(Color color)
     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 @@ void RemoteLayerTreeHost::commit(const RemoteLayerTreeTransaction& transaction)
 
         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())
index 0d05a2f..6d851ce 100644 (file)
@@ -114,6 +114,12 @@ void PlatformCALayerRemote::removeFromSuperlayer()
 
 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::removeAllSublayers()
 
 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 @@ PassRefPtr<PlatformCAAnimation> PlatformCALayerRemote::animationForKey(const Str
 
 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::setContents(CFTypeRef value)
 
 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 @@ void PlatformCALayerRemote::setName(const String& value)
     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()
index 0ca7919..6bbbb37 100644 (file)
@@ -45,6 +45,8 @@ public:
 
     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 @@ public:
 
     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 @@ public:
 private:
     PlatformCALayerRemote(WebCore::PlatformCALayer::LayerType, WebCore::PlatformCALayerClient* owner, RemoteLayerTreeContext* context);
 
-    virtual AVPlayerLayerplayerLayer() const OVERRIDE;
+    virtual AVPlayerLayer *playerLayer() const OVERRIDE;
 
     RemoteLayerTreeTransaction::LayerID m_layerID;
     RemoteLayerTreeTransaction::LayerProperties m_properties;