[iOS WK2] Assert in ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren()...
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Feb 2015 17:13:59 +0000 (17:13 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Feb 2015 17:13:59 +0000 (17:13 +0000)
https://bugs.webkit.org/show_bug.cgi?id=141223
rdar://problem/18458993

Reviewed by Tim Horton.
Source/WebCore:

It's possible to submit a RemoteLayerTree transaction that contains data
about a created layer, but doesn't have any properties for that layer. This
happens when the newly created layer isn't reached during the traversal that
gathers layer properties (i.e. it's not rooted). However, whether we create
a scrolling layer or not requires having properties; they are missing, so we
create a normal layer, but then the scrolling tree commit asserts that we
should have a scrolling layer.

Fix by making scrolling layers have a corresponding layer type, which is
stored in layer creation properties. This required exposing layer types
up through GraphicsLayer, but that allows for some nice cleanup:

1. No need to have the hokey shouldUseTiledBacking() GraphicsLayerClient hack
   for creating the page tiled layer.
2. The notion of "custom behaviors" can be removed from GraphicsLayer entirely.

Not testable because it requires tab switching.

* WebCore.exp.in:
* platform/graphics/GraphicsLayer.cpp:
(WebCore::GraphicsLayer::GraphicsLayer):
* platform/graphics/GraphicsLayer.h:
(WebCore::GraphicsLayer::initialize):
(WebCore::GraphicsLayer::setCustomBehavior): Deleted.
(WebCore::GraphicsLayer::customBehavior): Deleted.
* platform/graphics/GraphicsLayerClient.h:
(WebCore::GraphicsLayerClient::shouldUseTiledBacking): Deleted.
* platform/graphics/GraphicsLayerFactory.h:
* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayer::create):
(WebCore::GraphicsLayerCA::GraphicsLayerCA):
(WebCore::GraphicsLayerCA::initialize):
(WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
(WebCore::GraphicsLayerCA::ensureStructuralLayer):
(WebCore::GraphicsLayerCA::swapFromOrToTiledLayer):
(WebCore::GraphicsLayerCA::updateCustomBehavior): Deleted.
(WebCore::GraphicsLayerCA::setCustomBehavior): Deleted.
* platform/graphics/ca/GraphicsLayerCA.h:
(WebCore::GraphicsLayerCA::moveAnimations):
(WebCore::GraphicsLayerCA::copyAnimations):
* platform/graphics/ca/PlatformCALayer.h:
* platform/graphics/ca/mac/PlatformCALayerMac.h:
* platform/graphics/ca/mac/PlatformCALayerMac.mm:
(PlatformCALayerMac::PlatformCALayerMac):
(PlatformCALayerMac::commonInit):
(PlatformCALayerMac::updateCustomBehavior): Deleted.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::createGraphicsLayer):
(WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
(WebCore::RenderLayerBacking::updateScrollingLayers):
(WebCore::RenderLayerBacking::shouldUseTiledBacking): Deleted.
* rendering/RenderLayerBacking.h:

Source/WebKit2:

It's possible to submit a RemoteLayerTree transaction that contains data
about a created layer, but doesn't have any properties for that layer. This
happens when the newly created layer isn't reached during the traversal that
gathers layer properties (i.e. it's not rooted). However, whether we create
a scrolling layer or not requires having properties; they are missing, so we
create a normal layer, but then the scrolling tree commit asserts that we
should have a scrolling layer.

Fix by making scrolling layers have a corresponding layer type, which is
stored in layer creation properties. This required exposing layer types
up through GraphicsLayer, but that allows for some nice cleanup:

1. No need to have the hokey shouldUseTiledBacking() GraphicsLayerClient hack
   for creating the page tiled layer.
2. The notion of "custom behaviors" can be removed from GraphicsLayer entirely.

* Shared/mac/RemoteLayerBackingStore.mm:
(WebKit::RemoteLayerBackingStore::drawInContext):
* Shared/mac/RemoteLayerTreeTransaction.h:
* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
(WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
(WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
(WebKit::dumpChangedLayers):
(WebKit::RemoteLayerTreeTransaction::description):
* UIProcess/ios/RemoteLayerTreeHostIOS.mm:
(WebKit::RemoteLayerTreeHost::createLayer):
* UIProcess/mac/RemoteLayerTreeHost.mm:
(WebKit::RemoteLayerTreeHost::createLayer):
* WebProcess/WebPage/mac/GraphicsLayerCARemote.h:
* WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
(WebKit::PlatformCALayerRemote::customBehavior): Deleted.
(WebKit::PlatformCALayerRemote::updateCustomBehavior): Deleted.
* WebProcess/WebPage/mac/PlatformCALayerRemote.h:
* WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
* WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
(WebKit::RemoteLayerTreeContext::createGraphicsLayer):

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

32 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/platform/graphics/GraphicsLayer.cpp
Source/WebCore/platform/graphics/GraphicsLayer.h
Source/WebCore/platform/graphics/GraphicsLayerClient.h
Source/WebCore/platform/graphics/GraphicsLayerFactory.h
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
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/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp
Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h
Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.cpp
Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.h
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp
Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h
Source/WebCore/rendering/RenderLayerBacking.cpp
Source/WebCore/rendering/RenderLayerBacking.h
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/mac/RemoteLayerBackingStore.mm
Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h
Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm
Source/WebKit2/UIProcess/ios/RemoteLayerTreeHostIOS.mm
Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.mm
Source/WebKit2/WebProcess/WebPage/mac/GraphicsLayerCARemote.h
Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp
Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h
Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeContext.h
Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeContext.mm

index ea74a3e..bc51b84 100644 (file)
@@ -1,3 +1,64 @@
+2015-02-04  Simon Fraser  <simon.fraser@apple.com>
+
+        [iOS WK2] Assert in ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren() on tab switching
+        https://bugs.webkit.org/show_bug.cgi?id=141223
+        rdar://problem/18458993
+
+        Reviewed by Tim Horton.
+        
+        It's possible to submit a RemoteLayerTree transaction that contains data
+        about a created layer, but doesn't have any properties for that layer. This
+        happens when the newly created layer isn't reached during the traversal that
+        gathers layer properties (i.e. it's not rooted). However, whether we create
+        a scrolling layer or not requires having properties; they are missing, so we
+        create a normal layer, but then the scrolling tree commit asserts that we
+        should have a scrolling layer.
+        
+        Fix by making scrolling layers have a corresponding layer type, which is
+        stored in layer creation properties. This required exposing layer types
+        up through GraphicsLayer, but that allows for some nice cleanup:
+        
+        1. No need to have the hokey shouldUseTiledBacking() GraphicsLayerClient hack
+           for creating the page tiled layer.
+        2. The notion of "custom behaviors" can be removed from GraphicsLayer entirely.
+
+        Not testable because it requires tab switching.
+
+        * WebCore.exp.in:
+        * platform/graphics/GraphicsLayer.cpp:
+        (WebCore::GraphicsLayer::GraphicsLayer):
+        * platform/graphics/GraphicsLayer.h:
+        (WebCore::GraphicsLayer::initialize):
+        (WebCore::GraphicsLayer::setCustomBehavior): Deleted.
+        (WebCore::GraphicsLayer::customBehavior): Deleted.
+        * platform/graphics/GraphicsLayerClient.h:
+        (WebCore::GraphicsLayerClient::shouldUseTiledBacking): Deleted.
+        * platform/graphics/GraphicsLayerFactory.h:
+        * platform/graphics/ca/GraphicsLayerCA.cpp:
+        (WebCore::GraphicsLayer::create):
+        (WebCore::GraphicsLayerCA::GraphicsLayerCA):
+        (WebCore::GraphicsLayerCA::initialize):
+        (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers):
+        (WebCore::GraphicsLayerCA::ensureStructuralLayer):
+        (WebCore::GraphicsLayerCA::swapFromOrToTiledLayer):
+        (WebCore::GraphicsLayerCA::updateCustomBehavior): Deleted.
+        (WebCore::GraphicsLayerCA::setCustomBehavior): Deleted.
+        * platform/graphics/ca/GraphicsLayerCA.h:
+        (WebCore::GraphicsLayerCA::moveAnimations):
+        (WebCore::GraphicsLayerCA::copyAnimations):
+        * platform/graphics/ca/PlatformCALayer.h:
+        * platform/graphics/ca/mac/PlatformCALayerMac.h:
+        * platform/graphics/ca/mac/PlatformCALayerMac.mm:
+        (PlatformCALayerMac::PlatformCALayerMac):
+        (PlatformCALayerMac::commonInit):
+        (PlatformCALayerMac::updateCustomBehavior): Deleted.
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::RenderLayerBacking::createGraphicsLayer):
+        (WebCore::RenderLayerBacking::createPrimaryGraphicsLayer):
+        (WebCore::RenderLayerBacking::updateScrollingLayers):
+        (WebCore::RenderLayerBacking::shouldUseTiledBacking): Deleted.
+        * rendering/RenderLayerBacking.h:
+
 2015-02-04  Dean Jackson  <dino@apple.com>
 
         [Media] Fullscreen button should always come last in inline controls (141245)
index 15bb47e..2d6e7bd 100644 (file)
@@ -311,10 +311,9 @@ __ZN7WebCore13GraphicsLayer17suspendAnimationsEd
 __ZN7WebCore13GraphicsLayer18setBackgroundColorERKNS_5ColorE
 __ZN7WebCore13GraphicsLayer20setReplicatedByLayerEPS0_
 __ZN7WebCore13GraphicsLayer54noteDeviceOrPageScaleFactorChangedIncludingDescendantsEv
-__ZN7WebCore13GraphicsLayer6createEPNS_20GraphicsLayerFactoryERNS_19GraphicsLayerClientE
+__ZN7WebCore13GraphicsLayer6createEPNS_20GraphicsLayerFactoryERNS_19GraphicsLayerClientENS0_4TypeE
 __ZN7WebCore13GraphicsLayer7setSizeERKNS_9FloatSizeE
 __ZN7WebCore13GraphicsLayer8addChildEPS0_
-__ZN7WebCore13GraphicsLayerC2ERNS_19GraphicsLayerClientE
 __ZN7WebCore13GraphicsLayerD2Ev
 __ZN7WebCore13HTTPHeaderMap3setERKN3WTF6StringES4_
 __ZN7WebCore13HTTPHeaderMap6removeENS_14HTTPHeaderNameE
@@ -562,7 +561,7 @@ __ZN7WebCore15GraphicsContext9setShadowERKNS_9FloatSizeEfRKNS_5ColorENS_10ColorS
 __ZN7WebCore15GraphicsContext9translateEff
 __ZN7WebCore15GraphicsContextC1EP9CGContext
 __ZN7WebCore15GraphicsContextD1Ev
-__ZN7WebCore15GraphicsLayerCA10initializeEv
+__ZN7WebCore15GraphicsLayerCA10initializeENS_13GraphicsLayer4TypeE
 __ZN7WebCore15GraphicsLayerCA10setFiltersERKNS_16FilterOperationsE
 __ZN7WebCore15GraphicsLayerCA10setOpacityEf
 __ZN7WebCore15GraphicsLayerCA11setChildrenERKN3WTF6VectorIPNS_13GraphicsLayerELm0ENS1_15CrashOnOverflowEEE
@@ -590,7 +589,6 @@ __ZN7WebCore15GraphicsLayerCA16removeFromParentEv
 __ZN7WebCore15GraphicsLayerCA16resumeAnimationsEv
 __ZN7WebCore15GraphicsLayerCA16setMasksToBoundsEb
 __ZN7WebCore15GraphicsLayerCA17setContentsOpaqueEb
-__ZN7WebCore15GraphicsLayerCA17setCustomBehaviorENS_13GraphicsLayer14CustomBehaviorE
 __ZN7WebCore15GraphicsLayerCA17suspendAnimationsEd
 __ZN7WebCore15GraphicsLayerCA18setBackdropFiltersERKNS_16FilterOperationsE
 __ZN7WebCore15GraphicsLayerCA18setBackgroundColorERKNS_5ColorE
@@ -622,7 +620,7 @@ __ZN7WebCore15GraphicsLayerCA40platformCALayerSetNeedsToRevalidateTilesEv
 __ZN7WebCore15GraphicsLayerCA7setNameERKN3WTF6StringE
 __ZN7WebCore15GraphicsLayerCA7setSizeERKNS_9FloatSizeE
 __ZN7WebCore15GraphicsLayerCA8addChildEPNS_13GraphicsLayerE
-__ZN7WebCore15GraphicsLayerCAC2ERNS_19GraphicsLayerClientE
+__ZN7WebCore15GraphicsLayerCAC2ENS_13GraphicsLayer4TypeERNS_19GraphicsLayerClientE
 __ZN7WebCore15GraphicsLayerCAD2Ev
 __ZN7WebCore15HitTestLocation12rectForPointERKNS_11LayoutPointEjjjj
 __ZN7WebCore15HitTestLocationC1ERKNS_10FloatPointE
index ebe136e..e8f5334 100644 (file)
@@ -71,7 +71,7 @@ void KeyframeValueList::insert(std::unique_ptr<const AnimationValue> value)
     m_values.append(WTF::move(value));
 }
 
-GraphicsLayer::GraphicsLayer(GraphicsLayerClient& client)
+GraphicsLayer::GraphicsLayer(Type, GraphicsLayerClient& client)
     : m_client(client)
     , m_anchorPoint(0.5f, 0.5f, 0)
     , m_opacity(1)
@@ -99,7 +99,6 @@ GraphicsLayer::GraphicsLayer(GraphicsLayerClient& client)
     , m_replicatedLayer(nullptr)
     , m_repaintCount(0)
     , m_customAppearance(NoCustomAppearance)
-    , m_customBehavior(NoCustomBehavior)
 {
 #ifndef NDEBUG
     m_client.verifyNotPainting();
index 65aa236..e58bf24 100644 (file)
@@ -194,11 +194,18 @@ protected:
 class GraphicsLayer {
     WTF_MAKE_NONCOPYABLE(GraphicsLayer); WTF_MAKE_FAST_ALLOCATED;
 public:
-    WEBCORE_EXPORT static std::unique_ptr<GraphicsLayer> create(GraphicsLayerFactory*, GraphicsLayerClient&);
+
+    enum class Type {
+        Normal,
+        PageTiledBacking,
+        Scrolling
+    };
+    
+    WEBCORE_EXPORT static std::unique_ptr<GraphicsLayer> create(GraphicsLayerFactory*, GraphicsLayerClient&, Type = Type::Normal);
     
     WEBCORE_EXPORT virtual ~GraphicsLayer();
 
-    virtual void initialize() { }
+    virtual void initialize(Type) { }
 
     typedef uint64_t PlatformLayerID;
     virtual PlatformLayerID primaryLayerID() const { return 0; }
@@ -429,10 +436,6 @@ public:
     virtual void setCustomAppearance(CustomAppearance customAppearance) { m_customAppearance = customAppearance; }
     CustomAppearance customAppearance() const { return m_customAppearance; }
 
-    enum CustomBehavior { NoCustomBehavior, CustomScrollingBehavior, CustomScrolledContentsBehavior };
-    virtual void setCustomBehavior(CustomBehavior customBehavior) { m_customBehavior = customBehavior; }
-    CustomBehavior customBehavior() const { return m_customBehavior; }
-
     // z-position is the z-equivalent of position(). It's only used for debugging purposes.
     virtual float zPosition() const { return m_zPosition; }
     WEBCORE_EXPORT virtual void setZPosition(float);
@@ -507,6 +510,8 @@ public:
     virtual bool needsClippingMaskLayer() { return true; };
 
 protected:
+    WEBCORE_EXPORT explicit GraphicsLayer(Type, GraphicsLayerClient&);
+
     // Should be called from derived class destructors. Should call willBeDestroyed() on super.
     WEBCORE_EXPORT virtual void willBeDestroyed();
 
@@ -534,8 +539,6 @@ protected:
     GraphicsLayer* replicatedLayer() const { return m_replicatedLayer; }
     virtual void setReplicatedLayer(GraphicsLayer* layer) { m_replicatedLayer = layer; }
 
-    WEBCORE_EXPORT explicit GraphicsLayer(GraphicsLayerClient&);
-
     void dumpProperties(TextStream&, int indent, LayerTreeAsTextBehavior) const;
     virtual void dumpAdditionalProperties(TextStream&, int /*indent*/, LayerTreeAsTextBehavior) const { }
 
@@ -601,7 +604,6 @@ protected:
 
     int m_repaintCount;
     CustomAppearance m_customAppearance;
-    CustomBehavior m_customBehavior;
 };
 
 } // namespace WebCore
index 6ec5480..1dccc57 100644 (file)
@@ -73,7 +73,6 @@ class GraphicsLayerClient {
 public:
     virtual ~GraphicsLayerClient() {}
 
-    virtual bool shouldUseTiledBacking(const GraphicsLayer*) const { return false; }
     virtual void tiledBackingUsageChanged(const GraphicsLayer*, bool /*usingTiledBacking*/) { }
     
     // Callback for when hardware-accelerated animation started.
index 3c0f3d1..bc09caf 100644 (file)
 #ifndef GraphicsLayerFactory_h
 #define GraphicsLayerFactory_h
 
+#include "GraphicsLayer.h"
 #include <wtf/Forward.h>
 
 namespace WebCore {
 
-class GraphicsLayer;
-class GraphicsLayerClient;
-
 class GraphicsLayerFactory {
 public:
     virtual ~GraphicsLayerFactory() { }
 
-    virtual std::unique_ptr<GraphicsLayer> createGraphicsLayer(GraphicsLayerClient&) = 0;
+    virtual std::unique_ptr<GraphicsLayer> createGraphicsLayer(GraphicsLayer::Type, GraphicsLayerClient&) = 0;
 };
 
 } // namespace WebCore
index a21443b..b467870 100644 (file)
@@ -276,15 +276,15 @@ static inline bool supportsAcceleratedFilterAnimations()
 #endif
 }
 
-std::unique_ptr<GraphicsLayer> GraphicsLayer::create(GraphicsLayerFactory* factory, GraphicsLayerClient& client)
+std::unique_ptr<GraphicsLayer> GraphicsLayer::create(GraphicsLayerFactory* factory, GraphicsLayerClient& client, Type layerType)
 {
     std::unique_ptr<GraphicsLayer> graphicsLayer;
     if (!factory)
-        graphicsLayer = std::make_unique<GraphicsLayerCA>(client);
+        graphicsLayer = std::make_unique<GraphicsLayerCA>(layerType, client);
     else
-        graphicsLayer = factory->createGraphicsLayer(client);
+        graphicsLayer = factory->createGraphicsLayer(layerType, client);
 
-    graphicsLayer->initialize();
+    graphicsLayer->initialize(layerType);
 
     return graphicsLayer;
 }
@@ -325,8 +325,8 @@ PassRefPtr<PlatformCAAnimation> GraphicsLayerCA::createPlatformCAAnimation(Platf
 #endif
 }
 
-GraphicsLayerCA::GraphicsLayerCA(GraphicsLayerClient& client)
-    : GraphicsLayer(client)
+GraphicsLayerCA::GraphicsLayerCA(Type layerType, GraphicsLayerClient& client)
+    : GraphicsLayer(layerType, client)
     , m_contentsLayerPurpose(NoContentsLayer)
     , m_isPageTiledBackingLayer(false)
     , m_needsFullRepaint(false)
@@ -335,15 +335,24 @@ GraphicsLayerCA::GraphicsLayerCA(GraphicsLayerClient& client)
 {
 }
 
-void GraphicsLayerCA::initialize()
+void GraphicsLayerCA::initialize(Type layerType)
 {
-    PlatformCALayer::LayerType layerType = PlatformCALayer::LayerTypeWebLayer;
-    if (client().shouldUseTiledBacking(this)) {
-        layerType = PlatformCALayer::LayerTypePageTiledBackingLayer;
+    if (layerType == Type::PageTiledBacking)
         m_isPageTiledBackingLayer = true;
-    }
 
-    m_layer = createPlatformCALayer(layerType, this);
+    PlatformCALayer::LayerType platformLayerType;
+    switch (layerType) {
+    case Type::Normal:
+        platformLayerType = PlatformCALayer::LayerType::LayerTypeWebLayer;
+        break;
+    case Type::PageTiledBacking:
+        platformLayerType = PlatformCALayer::LayerType::LayerTypePageTiledBackingLayer;
+        break;
+    case Type::Scrolling:
+        platformLayerType = PlatformCALayer::LayerType::LayerTypeScrollingLayer;
+        break;
+    }
+    m_layer = createPlatformCALayer(platformLayerType, this);
     noteLayerPropertyChanged(ContentsScaleChanged);
 }
 
@@ -1404,9 +1413,6 @@ void GraphicsLayerCA::commitLayerChangesBeforeSublayers(CommitState& commitState
     if (m_uncommittedChanges & CustomAppearanceChanged)
         updateCustomAppearance();
 
-    if (m_uncommittedChanges & CustomBehaviorChanged)
-        updateCustomBehavior();
-
     if (m_uncommittedChanges & ChildrenChanged) {
         updateSublayerList();
         // Sublayers may set this flag again, so clear it to avoid always updating sublayers in commitLayerChangesAfterSublayers().
@@ -1751,7 +1757,7 @@ void GraphicsLayerCA::ensureStructuralLayer(StructuralLayerPurpose purpose)
             ASSERT(m_structuralLayer->superlayer());
             m_structuralLayer->superlayer()->replaceSublayer(*m_structuralLayer, *m_layer);
 
-            moveOrCopyAnimations(Move, m_structuralLayer.get(), m_layer.get());
+            moveAnimations(m_structuralLayer.get(), m_layer.get());
 
             // Release the structural layer.
             m_structuralLayer = nullptr;
@@ -1808,7 +1814,7 @@ void GraphicsLayerCA::ensureStructuralLayer(StructuralLayerPurpose purpose)
         }
     }
 
-    moveOrCopyAnimations(Move, m_layer.get(), m_structuralLayer.get());
+    moveAnimations(m_layer.get(), m_structuralLayer.get());
 }
 
 GraphicsLayerCA::StructuralLayerPurpose GraphicsLayerCA::structuralLayerPurpose() const
@@ -3001,11 +3007,6 @@ void GraphicsLayerCA::updateCustomAppearance()
     m_layer->updateCustomAppearance(m_customAppearance);
 }
 
-void GraphicsLayerCA::updateCustomBehavior()
-{
-    m_layer->updateCustomBehavior(m_customBehavior);
-}
-
 void GraphicsLayerCA::setShowDebugBorder(bool showBorder)
 {
     if (showBorder == m_showDebugBorder)
@@ -3110,15 +3111,6 @@ void GraphicsLayerCA::setCustomAppearance(CustomAppearance customAppearance)
     noteLayerPropertyChanged(CustomAppearanceChanged);
 }
 
-void GraphicsLayerCA::setCustomBehavior(CustomBehavior customBehavior)
-{
-    if (customBehavior == m_customBehavior)
-        return;
-
-    GraphicsLayer::setCustomBehavior(customBehavior);
-    noteLayerPropertyChanged(CustomBehaviorChanged);
-}
-
 bool GraphicsLayerCA::requiresTiledLayer(float pageScaleFactor) const
 {
     if (!m_drawsContent || m_isPageTiledBackingLayer)
@@ -3188,8 +3180,7 @@ void GraphicsLayerCA::swapFromOrToTiledLayer(bool useTiledLayer)
     m_layer->setName(name);
 #endif
 
-    // move over animations
-    moveOrCopyAnimations(Move, oldLayer.get(), m_layer.get());
+    moveAnimations(oldLayer.get(), m_layer.get());
     
     // need to tell new layer to draw itself
     setNeedsDisplay();
@@ -3426,7 +3417,7 @@ PassRefPtr<PlatformCALayer> GraphicsLayerCA::cloneLayer(PlatformCALayer *layer,
 
     if (cloneLevel == IntermediateCloneLevel) {
         newLayer->setOpacity(layer->opacity());
-        moveOrCopyAnimations(Copy, layer, newLayer.get());
+        copyAnimations(layer, newLayer.get());
     }
 
     setLayerDebugBorder(*newLayer, cloneLayerDebugBorderColor(isShowingDebugBorder()), cloneLayerBorderWidth);
index a7df657..480114c 100644 (file)
@@ -56,10 +56,10 @@ public:
     // to keep the overall tile cost low.
     static const int kTiledLayerTileSize = 512;
 
-    WEBCORE_EXPORT explicit GraphicsLayerCA(GraphicsLayerClient&);
+    WEBCORE_EXPORT explicit GraphicsLayerCA(Type, GraphicsLayerClient&);
     WEBCORE_EXPORT virtual ~GraphicsLayerCA();
 
-    WEBCORE_EXPORT virtual void initialize() override;
+    WEBCORE_EXPORT virtual void initialize(Type) override;
 
     WEBCORE_EXPORT virtual void setName(const String&) override;
 
@@ -143,7 +143,6 @@ public:
     WEBCORE_EXPORT virtual void setDebugBorder(const Color&, float borderWidth) override;
 
     WEBCORE_EXPORT virtual void setCustomAppearance(CustomAppearance) override;
-    WEBCORE_EXPORT virtual void setCustomBehavior(CustomBehavior) override;
 
     WEBCORE_EXPORT virtual void deviceOrPageScaleFactorChanged() override;
 
@@ -384,7 +383,6 @@ private:
     void updateTiles();
     void updateContentsScale(float pageScaleFactor);
     void updateCustomAppearance();
-    void updateCustomBehavior();
 
     enum StructuralLayerPurpose {
         NoStructuralLayer = 0,
@@ -401,8 +399,17 @@ private:
 
     enum MoveOrCopy { Move, Copy };
     static void moveOrCopyLayerAnimation(MoveOrCopy, const String& animationIdentifier, PlatformCALayer *fromLayer, PlatformCALayer *toLayer);
-    void moveOrCopyAnimations(MoveOrCopy, PlatformCALayer * fromLayer, PlatformCALayer * toLayer);
-    
+    void moveOrCopyAnimations(MoveOrCopy, PlatformCALayer* fromLayer, PlatformCALayer* toLayer);
+
+    void moveAnimations(PlatformCALayer* fromLayer, PlatformCALayer* toLayer)
+    {
+        moveOrCopyAnimations(Move, fromLayer, toLayer);
+    }
+    void copyAnimations(PlatformCALayer* fromLayer, PlatformCALayer* toLayer)
+    {
+        moveOrCopyAnimations(Copy, fromLayer, toLayer);
+    }
+
     bool appendToUncommittedAnimations(const KeyframeValueList&, const TransformOperations*, const Animation*, const String& animationName, const FloatSize& boxSize, int animationIndex, double timeOffset, bool isMatrixAnimation);
     bool appendToUncommittedAnimations(const KeyframeValueList&, const FilterOperation*, const Animation*, const String& animationName, int animationIndex, double timeOffset);
 
@@ -440,8 +447,7 @@ private:
         TilesAdded =                    1LLU << 30,
         DebugIndicatorsChanged =        1LLU << 31,
         CustomAppearanceChanged =       1LLU << 32,
-        CustomBehaviorChanged =         1LLU << 33,
-        BlendModeChanged =              1LLU << 34,
+        BlendModeChanged =              1LLU << 33,
     };
     typedef uint64_t LayerChangeFlags;
     enum ScheduleFlushOrNot { ScheduleFlush, DontScheduleFlush };
index 71e4a5b..8845b7c 100644 (file)
@@ -80,6 +80,7 @@ public:
         LayerTypeWebGLLayer,
         LayerTypeBackdropLayer,
         LayerTypeShapeLayer,
+        LayerTypeScrollingLayer,
         LayerTypeCustom
     };
     enum FilterType { Linear, Nearest, Trilinear };
@@ -213,9 +214,6 @@ public:
     virtual GraphicsLayer::CustomAppearance customAppearance() const = 0;
     virtual void updateCustomAppearance(GraphicsLayer::CustomAppearance) = 0;
 
-    virtual GraphicsLayer::CustomBehavior customBehavior() const = 0;
-    virtual void updateCustomBehavior(GraphicsLayer::CustomBehavior) = 0;
-
     virtual TiledBacking* tiledBacking() = 0;
 
 #if PLATFORM(WIN)
index cd1d56e..6fa6d57 100644 (file)
@@ -145,9 +145,6 @@ public:
     virtual GraphicsLayer::CustomAppearance customAppearance() const override { return m_customAppearance; }
     virtual void updateCustomAppearance(GraphicsLayer::CustomAppearance) override;
 
-    virtual GraphicsLayer::CustomBehavior customBehavior() const override { return m_customBehavior; }
-    virtual void updateCustomBehavior(GraphicsLayer::CustomBehavior) override;
-
     virtual TiledBacking* tiledBacking() override;
 
     virtual PassRefPtr<PlatformCALayer> clone(PlatformCALayerClient* owner) const override;
@@ -169,7 +166,6 @@ private:
     RetainPtr<NSObject> m_delegate;
     std::unique_ptr<PlatformCALayerList> m_customSublayers;
     GraphicsLayer::CustomAppearance m_customAppearance;
-    GraphicsLayer::CustomBehavior m_customBehavior;
     std::unique_ptr<FloatRoundedRect> m_shapeRoundedRect;
 };
 
index b515c05..7be1694 100644 (file)
@@ -205,7 +205,6 @@ PlatformCALayer::LayerType PlatformCALayerMac::layerTypeForPlatformLayer(Platfor
 PlatformCALayerMac::PlatformCALayerMac(LayerType layerType, PlatformCALayerClient* owner)
     : PlatformCALayer(layerType, owner)
     , m_customAppearance(GraphicsLayer::NoCustomAppearance)
-    , m_customBehavior(GraphicsLayer::NoCustomBehavior)
 {
     Class layerClass = Nil;
     switch (layerType) {
@@ -213,6 +212,9 @@ PlatformCALayerMac::PlatformCALayerMac(LayerType layerType, PlatformCALayerClien
     case LayerTypeRootLayer:
         layerClass = [CALayer class];
         break;
+    case LayerTypeScrollingLayer:
+        // Scrolling layers only have special behavior with PlatformCALayerRemote.
+        // fallthrough
     case LayerTypeWebLayer:
         layerClass = [WebLayer class];
         break;
@@ -262,7 +264,6 @@ PlatformCALayerMac::PlatformCALayerMac(LayerType layerType, PlatformCALayerClien
 PlatformCALayerMac::PlatformCALayerMac(PlatformLayer* layer, PlatformCALayerClient* owner)
     : PlatformCALayer(layerTypeForPlatformLayer(layer), owner)
     , m_customAppearance(GraphicsLayer::NoCustomAppearance)
-    , m_customBehavior(GraphicsLayer::NoCustomBehavior)
 {
     m_layer = layer;
     commonInit();
@@ -275,7 +276,7 @@ void PlatformCALayerMac::commonInit()
     [m_layer setValue:[NSValue valueWithPointer:this] forKey:platformCALayerPointer];
     
     // Clear all the implicit animations on the CALayer
-    if (m_layerType == LayerTypeAVPlayerLayer || m_layerType == LayerTypeWebGLLayer || m_layerType == LayerTypeCustom)
+    if (m_layerType == LayerTypeAVPlayerLayer || m_layerType == LayerTypeWebGLLayer || m_layerType == LayerTypeScrollingLayer || m_layerType == LayerTypeCustom)
         [m_layer web_disableAllActions];
     else
         [m_layer setDelegate:[WebActionDisablingCALayerDelegate shared]];
@@ -877,19 +878,6 @@ void PlatformCALayerMac::updateCustomAppearance(GraphicsLayer::CustomAppearance
 #endif
 }
 
-void PlatformCALayerMac::updateCustomBehavior(GraphicsLayer::CustomBehavior customBehavior)
-{
-    m_customBehavior = customBehavior;
-
-    // Custom layers can get wrapped in UIViews (which clobbers the layer delegate),
-    // so fall back to the slower way of disabling implicit animations.
-    if (m_customBehavior != GraphicsLayer::NoCustomBehavior) {
-        if ([[m_layer delegate] isKindOfClass:[WebActionDisablingCALayerDelegate class]])
-            [m_layer setDelegate:nil];
-        [m_layer web_disableAllActions];
-    }
-}
-
 TiledBacking* PlatformCALayerMac::tiledBacking()
 {
     if (!usesTiledBackingLayer())
index 5dd7e2f..75eaa1c 100644 (file)
@@ -128,7 +128,6 @@ static void layoutSublayersProc(CACFLayerRef caLayer)
 PlatformCALayerWin::PlatformCALayerWin(LayerType layerType, PlatformLayer* layer, PlatformCALayerClient* owner)
     : PlatformCALayer(layer ? LayerTypeCustom : layerType, owner)
     , m_customAppearance(GraphicsLayer::NoCustomAppearance)
-    , m_customBehavior(GraphicsLayer::NoCustomBehavior)
 {
     if (layer) {
         m_layer = layer;
index 7dace8f..260b649 100644 (file)
@@ -133,9 +133,6 @@ public:
     virtual GraphicsLayer::CustomAppearance customAppearance() const override { return m_customAppearance; }
     virtual void updateCustomAppearance(GraphicsLayer::CustomAppearance customAppearance) override { m_customAppearance = customAppearance; }
 
-    virtual GraphicsLayer::CustomBehavior customBehavior() const override { return m_customBehavior; }
-    virtual void updateCustomBehavior(GraphicsLayer::CustomBehavior customBehavior) override { m_customBehavior = customBehavior; }
-
     virtual TiledBacking* tiledBacking() override;
     
     virtual PlatformCALayer* rootLayer() const override;
@@ -156,7 +153,6 @@ private:
     HashMap<String, RefPtr<PlatformCAAnimation>> m_animations;
     std::unique_ptr<PlatformCALayerList> m_customSublayers;
     GraphicsLayer::CustomAppearance m_customAppearance;
-    GraphicsLayer::CustomBehavior m_customBehavior;
 };
 
 }
index 1e02d1f..c24e780 100644 (file)
 
 namespace WebCore {
 
-std::unique_ptr<GraphicsLayer> GraphicsLayer::create(GraphicsLayerFactory* factory, GraphicsLayerClient& client)
+std::unique_ptr<GraphicsLayer> GraphicsLayer::create(GraphicsLayerFactory* factory, GraphicsLayerClient& client, Type layerType)
 {
     if (!factory)
-        return std::make_unique<GraphicsLayerTextureMapper>(client);
+        return std::make_unique<GraphicsLayerTextureMapper>(layerType, client);
 
-    return factory->createGraphicsLayer(client);
+    return factory->createGraphicsLayer(layerType, client);
 }
 
-GraphicsLayerTextureMapper::GraphicsLayerTextureMapper(GraphicsLayerClient& client)
-    : GraphicsLayer(client)
+GraphicsLayerTextureMapper::GraphicsLayerTextureMapper(Type layerType, GraphicsLayerClient& client)
+    : GraphicsLayer(layerType, client)
     , m_compositedNativeImagePtr(0)
     , m_changeMask(NoChanges)
     , m_needsDisplay(false)
index 783c32f..c9b78c2 100644 (file)
@@ -34,7 +34,7 @@ namespace WebCore {
 
 class GraphicsLayerTextureMapper final : public GraphicsLayer, TextureMapperPlatformLayer::Client {
 public:
-    explicit GraphicsLayerTextureMapper(GraphicsLayerClient&);
+    explicit GraphicsLayerTextureMapper(Type, GraphicsLayerClient&);
     virtual ~GraphicsLayerTextureMapper();
 
     void setScrollClient(TextureMapperLayer::ScrollingClient* client) { m_layer.setScrollClient(client); }
index b387645..1a1c267 100644 (file)
@@ -255,9 +255,9 @@ void CompositingCoordinator::paintContents(const GraphicsLayer* graphicsLayer, G
     m_client->paintLayerContents(graphicsLayer, graphicsContext, enclosingIntRect(clipRect));
 }
 
-std::unique_ptr<GraphicsLayer> CompositingCoordinator::createGraphicsLayer(GraphicsLayerClient& client)
+std::unique_ptr<GraphicsLayer> CompositingCoordinator::createGraphicsLayer(GraphicsLayer::Type layerType, GraphicsLayerClient& client)
 {
-    CoordinatedGraphicsLayer* layer = new CoordinatedGraphicsLayer(client);
+    CoordinatedGraphicsLayer* layer = new CoordinatedGraphicsLayer(layerType, client);
     layer->setCoordinator(this);
     m_registeredLayers.add(layer->id(), layer);
     m_state.layersToCreate.append(layer->id());
index dec6926..fe10a3e 100644 (file)
@@ -114,7 +114,7 @@ private:
     virtual void removeUpdateAtlas(uint32_t atlasID) override;
 
     // GraphicsLayerFactory
-    virtual std::unique_ptr<GraphicsLayer> createGraphicsLayer(GraphicsLayerClient&) override;
+    virtual std::unique_ptr<GraphicsLayer> createGraphicsLayer(GraphicsLayer::Type, GraphicsLayerClient&) override;
 
     void initializeRootCompositingLayerIfNeeded();
     void flushPendingImageBackingChanges();
index e6e213f..720d25e 100644 (file)
@@ -103,8 +103,8 @@ void CoordinatedGraphicsLayer::didChangeGeometry()
     setShouldUpdateVisibleRect();
 }
 
-CoordinatedGraphicsLayer::CoordinatedGraphicsLayer(GraphicsLayerClient& client)
-    : GraphicsLayer(client)
+CoordinatedGraphicsLayer::CoordinatedGraphicsLayer(Type layerType, GraphicsLayerClient& client)
+    : GraphicsLayer(layerType, client)
 #ifndef NDEBUG
     , m_isPurging(false)
 #endif
index bf76a7c..67832e8 100644 (file)
@@ -61,7 +61,7 @@ class CoordinatedGraphicsLayer : public GraphicsLayer
     , public CoordinatedImageBacking::Host
     , public CoordinatedTileClient {
 public:
-    explicit CoordinatedGraphicsLayer(GraphicsLayerClient&);
+    explicit CoordinatedGraphicsLayer(Type, GraphicsLayerClient&);
     virtual ~CoordinatedGraphicsLayer();
 
     // Reimplementations from GraphicsLayer.h.
index abc007e..5994cc3 100644 (file)
@@ -105,8 +105,6 @@ static ScrollingCoordinator* scrollingCoordinatorFromLayer(RenderLayer& layer)
     return page->scrollingCoordinator();
 }
 
-bool RenderLayerBacking::m_creatingPrimaryGraphicsLayer = false;
-
 RenderLayerBacking::RenderLayerBacking(RenderLayer& layer)
     : m_owningLayer(layer)
     , m_viewportConstrainedNodeID(0)
@@ -163,13 +161,13 @@ void RenderLayerBacking::willDestroyLayer(const GraphicsLayer* layer)
         compositor().layerTiledBackingUsageChanged(layer, false);
 }
 
-std::unique_ptr<GraphicsLayer> RenderLayerBacking::createGraphicsLayer(const String& name)
+std::unique_ptr<GraphicsLayer> RenderLayerBacking::createGraphicsLayer(const String& name, GraphicsLayer::Type layerType)
 {
     GraphicsLayerFactory* graphicsLayerFactory = 0;
     if (Page* page = renderer().frame().page())
         graphicsLayerFactory = page->chrome().client().graphicsLayerFactory();
 
-    std::unique_ptr<GraphicsLayer> graphicsLayer = GraphicsLayer::create(graphicsLayerFactory, *this);
+    std::unique_ptr<GraphicsLayer> graphicsLayer = GraphicsLayer::create(graphicsLayerFactory, *this, layerType);
 
 #ifndef NDEBUG
     graphicsLayer->setName(name);
@@ -183,11 +181,6 @@ std::unique_ptr<GraphicsLayer> RenderLayerBacking::createGraphicsLayer(const Str
     return graphicsLayer;
 }
 
-bool RenderLayerBacking::shouldUseTiledBacking(const GraphicsLayer*) const
-{
-    return m_usingTiledCacheLayer && m_creatingPrimaryGraphicsLayer;
-}
-
 void RenderLayerBacking::tiledBackingUsageChanged(const GraphicsLayer* layer, bool usingTiledBacking)
 {
     compositor().layerTiledBackingUsageChanged(layer, usingTiledBacking);
@@ -286,14 +279,7 @@ void RenderLayerBacking::createPrimaryGraphicsLayer()
     layerName = m_owningLayer.name();
 #endif
     
-    // The call to createGraphicsLayer ends calling back into here as
-    // a GraphicsLayerClient to ask if it shouldUseTiledBacking(). We only want
-    // the tile cache on our main layer. This is pretty ugly, but saves us from
-    // exposing the API to all clients.
-
-    m_creatingPrimaryGraphicsLayer = true;
-    m_graphicsLayer = createGraphicsLayer(layerName);
-    m_creatingPrimaryGraphicsLayer = false;
+    m_graphicsLayer = createGraphicsLayer(layerName, m_usingTiledCacheLayer ? GraphicsLayer::Type::PageTiledBacking : GraphicsLayer::Type::Normal);
 
     if (m_usingTiledCacheLayer) {
         m_childContainmentLayer = createGraphicsLayer("TiledBacking Flattening Layer");
@@ -1484,18 +1470,14 @@ bool RenderLayerBacking::updateScrollingLayers(bool needsScrollingLayers)
 
     if (!m_scrollingLayer) {
         // Outer layer which corresponds with the scroll view.
-        m_scrollingLayer = createGraphicsLayer("Scrolling container");
+        m_scrollingLayer = createGraphicsLayer("Scrolling container", GraphicsLayer::Type::Scrolling);
         m_scrollingLayer->setDrawsContent(false);
         m_scrollingLayer->setMasksToBounds(true);
-#if PLATFORM(IOS)
-        m_scrollingLayer->setCustomBehavior(GraphicsLayer::CustomScrollingBehavior);
-#endif
+
         // Inner layer which renders the content that scrolls.
         m_scrollingContentsLayer = createGraphicsLayer("Scrolled Contents");
         m_scrollingContentsLayer->setDrawsContent(true);
-#if PLATFORM(IOS)
-        m_scrollingContentsLayer->setCustomBehavior(GraphicsLayer::CustomScrolledContentsBehavior);
-#endif
+
         GraphicsLayerPaintingPhase paintPhase = GraphicsLayerPaintOverflowContents | GraphicsLayerPaintCompositedScroll;
         if (!m_foregroundLayer)
             paintPhase |= GraphicsLayerPaintForeground;
index 2c2edf5..8d83caf 100644 (file)
@@ -193,7 +193,6 @@ public:
     void updateDebugIndicators(bool showBorder, bool showRepaintCounter);
 
     // GraphicsLayerClient interface
-    virtual bool shouldUseTiledBacking(const GraphicsLayer*) const override;
     virtual void tiledBackingUsageChanged(const GraphicsLayer*, bool /*usingTiledBacking*/) override;
     virtual void notifyAnimationStarted(const GraphicsLayer*, const String& animationKey, double startTime) override;
     virtual void notifyFlushRequired(const GraphicsLayer*) override;
@@ -256,7 +255,7 @@ private:
 
     LayoutRect compositedBoundsIncludingMargin() const;
     
-    std::unique_ptr<GraphicsLayer> createGraphicsLayer(const String&);
+    std::unique_ptr<GraphicsLayer> createGraphicsLayer(const String&, GraphicsLayer::Type = GraphicsLayer::Type::Normal);
 
     RenderLayerModelObject& renderer() const { return m_owningLayer.renderer(); }
     RenderLayerCompositor& compositor() const { return m_owningLayer.compositor(); }
@@ -365,8 +364,6 @@ private:
     bool m_canCompositeBackdropFilters;
 #endif
     bool m_backgroundLayerPaintsFixedRootBackground;
-
-    static bool m_creatingPrimaryGraphicsLayer;
 };
 
 enum CanvasCompositingStrategy {
index 0e28be2..a8162a7 100644 (file)
@@ -1,3 +1,49 @@
+2015-02-04  Simon Fraser  <simon.fraser@apple.com>
+
+        [iOS WK2] Assert in ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren() on tab switching
+        https://bugs.webkit.org/show_bug.cgi?id=141223
+        rdar://problem/18458993
+
+        Reviewed by Tim Horton.
+
+        It's possible to submit a RemoteLayerTree transaction that contains data
+        about a created layer, but doesn't have any properties for that layer. This
+        happens when the newly created layer isn't reached during the traversal that
+        gathers layer properties (i.e. it's not rooted). However, whether we create
+        a scrolling layer or not requires having properties; they are missing, so we
+        create a normal layer, but then the scrolling tree commit asserts that we
+        should have a scrolling layer.
+        
+        Fix by making scrolling layers have a corresponding layer type, which is
+        stored in layer creation properties. This required exposing layer types
+        up through GraphicsLayer, but that allows for some nice cleanup:
+        
+        1. No need to have the hokey shouldUseTiledBacking() GraphicsLayerClient hack
+           for creating the page tiled layer.
+        2. The notion of "custom behaviors" can be removed from GraphicsLayer entirely.
+
+        * Shared/mac/RemoteLayerBackingStore.mm:
+        (WebKit::RemoteLayerBackingStore::drawInContext):
+        * Shared/mac/RemoteLayerTreeTransaction.h:
+        * Shared/mac/RemoteLayerTreeTransaction.mm:
+        (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties):
+        (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode):
+        (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode):
+        (WebKit::dumpChangedLayers):
+        (WebKit::RemoteLayerTreeTransaction::description):
+        * UIProcess/ios/RemoteLayerTreeHostIOS.mm:
+        (WebKit::RemoteLayerTreeHost::createLayer):
+        * UIProcess/mac/RemoteLayerTreeHost.mm:
+        (WebKit::RemoteLayerTreeHost::createLayer):
+        * WebProcess/WebPage/mac/GraphicsLayerCARemote.h:
+        * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp:
+        (WebKit::PlatformCALayerRemote::customBehavior): Deleted.
+        (WebKit::PlatformCALayerRemote::updateCustomBehavior): Deleted.
+        * WebProcess/WebPage/mac/PlatformCALayerRemote.h:
+        * WebProcess/WebPage/mac/RemoteLayerTreeContext.h:
+        * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm:
+        (WebKit::RemoteLayerTreeContext::createGraphicsLayer):
+
 2015-02-04  Gyuyoung Kim  <gyuyoung.kim@samsung.com>
 
         [EFL][WK2] Manage failing API tests
index 0c232c2..af6ec59 100644 (file)
@@ -342,6 +342,7 @@ void RemoteLayerBackingStore::drawInContext(GraphicsContext& context, CGImageRef
     case PlatformCALayer::LayerTypeWebGLLayer:
     case PlatformCALayer::LayerTypeBackdropLayer:
     case PlatformCALayer::LayerTypeShapeLayer:
+    case PlatformCALayer::LayerTypeScrollingLayer:
     case PlatformCALayer::LayerTypeCustom:
         ASSERT_NOT_REACHED();
         break;
index 4b51609..b045963 100644 (file)
@@ -82,8 +82,7 @@ public:
         FiltersChanged                  = 1LLU << 29,
         AnimationsChanged               = 1LLU << 30,
         EdgeAntialiasingMaskChanged     = 1LLU << 31,
-        CustomAppearanceChanged         = 1LLU << 32,
-        CustomBehaviorChanged           = 1LLU << 33
+        CustomAppearanceChanged         = 1LLU << 32
     };
     typedef uint64_t LayerChange;
 
@@ -149,7 +148,6 @@ public:
         WebCore::Color borderColor;
         unsigned edgeAntialiasingMask;
         WebCore::GraphicsLayer::CustomAppearance customAppearance;
-        WebCore::GraphicsLayer::CustomBehavior customBehavior;
         WebCore::PlatformCALayer::FilterType minificationFilter;
         WebCore::PlatformCALayer::FilterType magnificationFilter;
         WebCore::BlendMode blendMode;
index 9d57592..8968e9c 100644 (file)
@@ -93,7 +93,6 @@ RemoteLayerTreeTransaction::LayerProperties::LayerProperties()
     , borderColor(Color::black)
     , edgeAntialiasingMask(kCALayerLeftEdge | kCALayerRightEdge | kCALayerBottomEdge | kCALayerTopEdge)
     , customAppearance(GraphicsLayer::NoCustomAppearance)
-    , customBehavior(GraphicsLayer::NoCustomBehavior)
     , minificationFilter(PlatformCALayer::FilterType::Linear)
     , magnificationFilter(PlatformCALayer::FilterType::Linear)
     , blendMode(BlendModeNormal)
@@ -128,7 +127,6 @@ RemoteLayerTreeTransaction::LayerProperties::LayerProperties(const LayerProperti
     , borderColor(other.borderColor)
     , edgeAntialiasingMask(other.edgeAntialiasingMask)
     , customAppearance(other.customAppearance)
-    , customBehavior(other.customBehavior)
     , minificationFilter(other.minificationFilter)
     , magnificationFilter(other.magnificationFilter)
     , blendMode(other.blendMode)
@@ -256,9 +254,6 @@ void RemoteLayerTreeTransaction::LayerProperties::encode(IPC::ArgumentEncoder& e
 
     if (changedProperties & CustomAppearanceChanged)
         encoder.encodeEnum(customAppearance);
-
-    if (changedProperties & CustomBehaviorChanged)
-        encoder.encodeEnum(customBehavior);
 }
 
 bool RemoteLayerTreeTransaction::LayerProperties::decode(IPC::ArgumentDecoder& decoder, LayerProperties& result)
@@ -454,11 +449,6 @@ bool RemoteLayerTreeTransaction::LayerProperties::decode(IPC::ArgumentDecoder& d
             return false;
     }
 
-    if (result.changedProperties & CustomBehaviorChanged) {
-        if (!decoder.decodeEnum(result.customBehavior))
-            return false;
-    }
-
     return true;
 }
 
@@ -1185,9 +1175,6 @@ static void dumpChangedLayers(RemoteLayerTreeTextStream& ts, const RemoteLayerTr
         if (layerProperties.changedProperties & RemoteLayerTreeTransaction::CustomAppearanceChanged)
             dumpProperty(ts, "customAppearance", layerProperties.customAppearance);
 
-        if (layerProperties.changedProperties & RemoteLayerTreeTransaction::CustomBehaviorChanged)
-            dumpProperty(ts, "customBehavior", layerProperties.customBehavior);
-
         ts << ")";
 
         ts.decreaseIndent();
@@ -1255,6 +1242,9 @@ CString RemoteLayerTreeTransaction::description() const
             case PlatformCALayer::LayerTypeShapeLayer:
                 ts << "shape-layer";
                 break;
+            case PlatformCALayer::LayerTypeScrollingLayer:
+                ts << "scrolling-layer";
+                break;
             case PlatformCALayer::LayerTypeCustom:
                 ts << "custom-layer (context-id " << createdLayer.hostingContextID << ")";
                 break;
index 8e22f7c..27f37cb 100644 (file)
@@ -173,13 +173,7 @@ LayerOrView *RemoteLayerTreeHost::createLayer(const RemoteLayerTreeTransaction::
     case PlatformCALayer::LayerTypeTiledBackingLayer:
     case PlatformCALayer::LayerTypePageTiledBackingLayer:
     case PlatformCALayer::LayerTypeTiledBackingTileLayer:
-        if (layerProperties && layerProperties->customBehavior == GraphicsLayer::CustomScrollingBehavior) {
-            if (!m_isDebugLayerTreeHost)
-                view = adoptNS([[UIScrollView alloc] init]);
-            else // The debug indicator parents views under layers, which can cause crashes with UIScrollView.
-                view = adoptNS([[UIView alloc] init]);
-        } else
-            view = adoptNS([[WKCompositingView alloc] init]);
+        view = adoptNS([[WKCompositingView alloc] init]);
         break;
     case PlatformCALayer::LayerTypeBackdropLayer:
         view = adoptNS([[WKBackdropView alloc] init]);
@@ -198,6 +192,12 @@ LayerOrView *RemoteLayerTreeHost::createLayer(const RemoteLayerTreeTransaction::
     case PlatformCALayer::LayerTypeShapeLayer:
         view = adoptNS([[WKShapeView alloc] init]);
         break;
+    case PlatformCALayer::LayerTypeScrollingLayer:
+        if (!m_isDebugLayerTreeHost)
+            view = adoptNS([[UIScrollView alloc] init]);
+        else // The debug indicator parents views under layers, which can cause crashes with UIScrollView.
+            view = adoptNS([[UIView alloc] init]);
+        break;
     default:
         ASSERT_NOT_REACHED();
     }
index 286a675..16cd27e 100644 (file)
@@ -222,6 +222,7 @@ LayerOrView *RemoteLayerTreeHost::createLayer(const RemoteLayerTreeTransaction::
     case PlatformCALayer::LayerTypeTiledBackingLayer:
     case PlatformCALayer::LayerTypePageTiledBackingLayer:
     case PlatformCALayer::LayerTypeTiledBackingTileLayer:
+    case PlatformCALayer::LayerTypeScrollingLayer:
         layer = adoptNS([[CALayer alloc] init]);
         break;
     case PlatformCALayer::LayerTypeTransformLayer:
index 32e6bd1..6f4cf0f 100644 (file)
@@ -35,8 +35,8 @@ class RemoteLayerTreeContext;
 
 class GraphicsLayerCARemote final : public WebCore::GraphicsLayerCA {
 public:
-    GraphicsLayerCARemote(WebCore::GraphicsLayerClient& client, RemoteLayerTreeContext& context)
-        : GraphicsLayerCA(client)
+    GraphicsLayerCARemote(Type layerType, WebCore::GraphicsLayerClient& client, RemoteLayerTreeContext& context)
+        : GraphicsLayerCA(layerType, client)
         , m_context(context)
     {
     }
index 18b04ab..8b0da3a 100644 (file)
@@ -724,17 +724,6 @@ void PlatformCALayerRemote::updateCustomAppearance(GraphicsLayer::CustomAppearan
     m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::CustomAppearanceChanged);
 }
 
-GraphicsLayer::CustomBehavior PlatformCALayerRemote::customBehavior() const
-{
-    return m_properties.customBehavior;
-}
-
-void PlatformCALayerRemote::updateCustomBehavior(GraphicsLayer::CustomBehavior customBehavior)
-{
-    m_properties.customBehavior = customBehavior;
-    m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::CustomBehaviorChanged);
-}
-
 PassRefPtr<PlatformCALayer> PlatformCALayerRemote::createCompatibleLayer(PlatformCALayer::LayerType layerType, PlatformCALayerClient* client) const
 {
     return PlatformCALayerRemote::create(layerType, client, *m_context);
index d60ac35..4a512c6 100644 (file)
@@ -150,9 +150,6 @@ public:
     virtual WebCore::GraphicsLayer::CustomAppearance customAppearance() const override;
     virtual void updateCustomAppearance(WebCore::GraphicsLayer::CustomAppearance) override;
 
-    virtual WebCore::GraphicsLayer::CustomBehavior customBehavior() const override;
-    virtual void updateCustomBehavior(WebCore::GraphicsLayer::CustomBehavior) override;
-
     virtual WebCore::TiledBacking* tiledBacking() override { return nullptr; }
 
     virtual PassRefPtr<WebCore::PlatformCALayer> clone(WebCore::PlatformCALayerClient* owner) const override;
index 7e9d5ca..95366e6 100644 (file)
@@ -73,7 +73,7 @@ public:
 
 private:
     // WebCore::GraphicsLayerFactory
-    virtual std::unique_ptr<WebCore::GraphicsLayer> createGraphicsLayer(WebCore::GraphicsLayerClient&) override;
+    virtual std::unique_ptr<WebCore::GraphicsLayer> createGraphicsLayer(WebCore::GraphicsLayer::Type, WebCore::GraphicsLayerClient&) override;
 
     WebPage& m_webPage;
 
index 7d24e76..ba436fe 100644 (file)
@@ -98,9 +98,9 @@ void RemoteLayerTreeContext::backingStoreWillBeDisplayed(RemoteLayerBackingStore
     m_backingStoreCollection.backingStoreWillBeDisplayed(backingStore);
 }
 
-std::unique_ptr<GraphicsLayer> RemoteLayerTreeContext::createGraphicsLayer(GraphicsLayerClient& client)
+std::unique_ptr<GraphicsLayer> RemoteLayerTreeContext::createGraphicsLayer(WebCore::GraphicsLayer::Type layerType, GraphicsLayerClient& client)
 {
-    return std::make_unique<GraphicsLayerCARemote>(client, *this);
+    return std::make_unique<GraphicsLayerCARemote>(layerType, client, *this);
 }
 
 void RemoteLayerTreeContext::buildTransaction(RemoteLayerTreeTransaction& transaction, PlatformCALayer& rootLayer)