Changeset 179604 in webkit
- Timestamp:
- Feb 4, 2015 9:13:59 AM (9 years ago)
- Location:
- trunk/Source
- Files:
-
- 32 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r179602 r179604 1 2015-02-04 Simon Fraser <simon.fraser@apple.com> 2 3 [iOS WK2] Assert in ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren() on tab switching 4 https://bugs.webkit.org/show_bug.cgi?id=141223 5 rdar://problem/18458993 6 7 Reviewed by Tim Horton. 8 9 It's possible to submit a RemoteLayerTree transaction that contains data 10 about a created layer, but doesn't have any properties for that layer. This 11 happens when the newly created layer isn't reached during the traversal that 12 gathers layer properties (i.e. it's not rooted). However, whether we create 13 a scrolling layer or not requires having properties; they are missing, so we 14 create a normal layer, but then the scrolling tree commit asserts that we 15 should have a scrolling layer. 16 17 Fix by making scrolling layers have a corresponding layer type, which is 18 stored in layer creation properties. This required exposing layer types 19 up through GraphicsLayer, but that allows for some nice cleanup: 20 21 1. No need to have the hokey shouldUseTiledBacking() GraphicsLayerClient hack 22 for creating the page tiled layer. 23 2. The notion of "custom behaviors" can be removed from GraphicsLayer entirely. 24 25 Not testable because it requires tab switching. 26 27 * WebCore.exp.in: 28 * platform/graphics/GraphicsLayer.cpp: 29 (WebCore::GraphicsLayer::GraphicsLayer): 30 * platform/graphics/GraphicsLayer.h: 31 (WebCore::GraphicsLayer::initialize): 32 (WebCore::GraphicsLayer::setCustomBehavior): Deleted. 33 (WebCore::GraphicsLayer::customBehavior): Deleted. 34 * platform/graphics/GraphicsLayerClient.h: 35 (WebCore::GraphicsLayerClient::shouldUseTiledBacking): Deleted. 36 * platform/graphics/GraphicsLayerFactory.h: 37 * platform/graphics/ca/GraphicsLayerCA.cpp: 38 (WebCore::GraphicsLayer::create): 39 (WebCore::GraphicsLayerCA::GraphicsLayerCA): 40 (WebCore::GraphicsLayerCA::initialize): 41 (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers): 42 (WebCore::GraphicsLayerCA::ensureStructuralLayer): 43 (WebCore::GraphicsLayerCA::swapFromOrToTiledLayer): 44 (WebCore::GraphicsLayerCA::updateCustomBehavior): Deleted. 45 (WebCore::GraphicsLayerCA::setCustomBehavior): Deleted. 46 * platform/graphics/ca/GraphicsLayerCA.h: 47 (WebCore::GraphicsLayerCA::moveAnimations): 48 (WebCore::GraphicsLayerCA::copyAnimations): 49 * platform/graphics/ca/PlatformCALayer.h: 50 * platform/graphics/ca/mac/PlatformCALayerMac.h: 51 * platform/graphics/ca/mac/PlatformCALayerMac.mm: 52 (PlatformCALayerMac::PlatformCALayerMac): 53 (PlatformCALayerMac::commonInit): 54 (PlatformCALayerMac::updateCustomBehavior): Deleted. 55 * rendering/RenderLayerBacking.cpp: 56 (WebCore::RenderLayerBacking::createGraphicsLayer): 57 (WebCore::RenderLayerBacking::createPrimaryGraphicsLayer): 58 (WebCore::RenderLayerBacking::updateScrollingLayers): 59 (WebCore::RenderLayerBacking::shouldUseTiledBacking): Deleted. 60 * rendering/RenderLayerBacking.h: 61 1 62 2015-02-04 Dean Jackson <dino@apple.com> 2 63 -
trunk/Source/WebCore/WebCore.exp.in
r179489 r179604 312 312 __ZN7WebCore13GraphicsLayer20setReplicatedByLayerEPS0_ 313 313 __ZN7WebCore13GraphicsLayer54noteDeviceOrPageScaleFactorChangedIncludingDescendantsEv 314 __ZN7WebCore13GraphicsLayer6createEPNS_20GraphicsLayerFactoryERNS_19GraphicsLayerClientE 314 __ZN7WebCore13GraphicsLayer6createEPNS_20GraphicsLayerFactoryERNS_19GraphicsLayerClientENS0_4TypeE 315 315 __ZN7WebCore13GraphicsLayer7setSizeERKNS_9FloatSizeE 316 316 __ZN7WebCore13GraphicsLayer8addChildEPS0_ 317 __ZN7WebCore13GraphicsLayerC2ERNS_19GraphicsLayerClientE318 317 __ZN7WebCore13GraphicsLayerD2Ev 319 318 __ZN7WebCore13HTTPHeaderMap3setERKN3WTF6StringES4_ … … 563 562 __ZN7WebCore15GraphicsContextC1EP9CGContext 564 563 __ZN7WebCore15GraphicsContextD1Ev 565 __ZN7WebCore15GraphicsLayerCA10initializeE v564 __ZN7WebCore15GraphicsLayerCA10initializeENS_13GraphicsLayer4TypeE 566 565 __ZN7WebCore15GraphicsLayerCA10setFiltersERKNS_16FilterOperationsE 567 566 __ZN7WebCore15GraphicsLayerCA10setOpacityEf … … 591 590 __ZN7WebCore15GraphicsLayerCA16setMasksToBoundsEb 592 591 __ZN7WebCore15GraphicsLayerCA17setContentsOpaqueEb 593 __ZN7WebCore15GraphicsLayerCA17setCustomBehaviorENS_13GraphicsLayer14CustomBehaviorE594 592 __ZN7WebCore15GraphicsLayerCA17suspendAnimationsEd 595 593 __ZN7WebCore15GraphicsLayerCA18setBackdropFiltersERKNS_16FilterOperationsE … … 623 621 __ZN7WebCore15GraphicsLayerCA7setSizeERKNS_9FloatSizeE 624 622 __ZN7WebCore15GraphicsLayerCA8addChildEPNS_13GraphicsLayerE 625 __ZN7WebCore15GraphicsLayerCAC2E RNS_19GraphicsLayerClientE623 __ZN7WebCore15GraphicsLayerCAC2ENS_13GraphicsLayer4TypeERNS_19GraphicsLayerClientE 626 624 __ZN7WebCore15GraphicsLayerCAD2Ev 627 625 __ZN7WebCore15HitTestLocation12rectForPointERKNS_11LayoutPointEjjjj -
trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp
r179599 r179604 72 72 } 73 73 74 GraphicsLayer::GraphicsLayer( GraphicsLayerClient& client)74 GraphicsLayer::GraphicsLayer(Type, GraphicsLayerClient& client) 75 75 : m_client(client) 76 76 , m_anchorPoint(0.5f, 0.5f, 0) … … 100 100 , m_repaintCount(0) 101 101 , m_customAppearance(NoCustomAppearance) 102 , m_customBehavior(NoCustomBehavior)103 102 { 104 103 #ifndef NDEBUG -
trunk/Source/WebCore/platform/graphics/GraphicsLayer.h
r179369 r179604 195 195 WTF_MAKE_NONCOPYABLE(GraphicsLayer); WTF_MAKE_FAST_ALLOCATED; 196 196 public: 197 WEBCORE_EXPORT static std::unique_ptr<GraphicsLayer> create(GraphicsLayerFactory*, GraphicsLayerClient&); 197 198 enum class Type { 199 Normal, 200 PageTiledBacking, 201 Scrolling 202 }; 203 204 WEBCORE_EXPORT static std::unique_ptr<GraphicsLayer> create(GraphicsLayerFactory*, GraphicsLayerClient&, Type = Type::Normal); 198 205 199 206 WEBCORE_EXPORT virtual ~GraphicsLayer(); 200 207 201 virtual void initialize( ) { }208 virtual void initialize(Type) { } 202 209 203 210 typedef uint64_t PlatformLayerID; … … 430 437 CustomAppearance customAppearance() const { return m_customAppearance; } 431 438 432 enum CustomBehavior { NoCustomBehavior, CustomScrollingBehavior, CustomScrolledContentsBehavior };433 virtual void setCustomBehavior(CustomBehavior customBehavior) { m_customBehavior = customBehavior; }434 CustomBehavior customBehavior() const { return m_customBehavior; }435 436 439 // z-position is the z-equivalent of position(). It's only used for debugging purposes. 437 440 virtual float zPosition() const { return m_zPosition; } … … 508 511 509 512 protected: 513 WEBCORE_EXPORT explicit GraphicsLayer(Type, GraphicsLayerClient&); 514 510 515 // Should be called from derived class destructors. Should call willBeDestroyed() on super. 511 516 WEBCORE_EXPORT virtual void willBeDestroyed(); … … 534 539 GraphicsLayer* replicatedLayer() const { return m_replicatedLayer; } 535 540 virtual void setReplicatedLayer(GraphicsLayer* layer) { m_replicatedLayer = layer; } 536 537 WEBCORE_EXPORT explicit GraphicsLayer(GraphicsLayerClient&);538 541 539 542 void dumpProperties(TextStream&, int indent, LayerTreeAsTextBehavior) const; … … 602 605 int m_repaintCount; 603 606 CustomAppearance m_customAppearance; 604 CustomBehavior m_customBehavior;605 607 }; 606 608 -
trunk/Source/WebCore/platform/graphics/GraphicsLayerClient.h
r178868 r179604 74 74 virtual ~GraphicsLayerClient() {} 75 75 76 virtual bool shouldUseTiledBacking(const GraphicsLayer*) const { return false; }77 76 virtual void tiledBackingUsageChanged(const GraphicsLayer*, bool /*usingTiledBacking*/) { } 78 77 -
trunk/Source/WebCore/platform/graphics/GraphicsLayerFactory.h
r168423 r179604 27 27 #define GraphicsLayerFactory_h 28 28 29 #include "GraphicsLayer.h" 29 30 #include <wtf/Forward.h> 30 31 31 32 namespace WebCore { 32 33 class GraphicsLayer;34 class GraphicsLayerClient;35 33 36 34 class GraphicsLayerFactory { … … 38 36 virtual ~GraphicsLayerFactory() { } 39 37 40 virtual std::unique_ptr<GraphicsLayer> createGraphicsLayer(GraphicsLayer Client&) = 0;38 virtual std::unique_ptr<GraphicsLayer> createGraphicsLayer(GraphicsLayer::Type, GraphicsLayerClient&) = 0; 41 39 }; 42 40 -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
r179369 r179604 277 277 } 278 278 279 std::unique_ptr<GraphicsLayer> GraphicsLayer::create(GraphicsLayerFactory* factory, GraphicsLayerClient& client )279 std::unique_ptr<GraphicsLayer> GraphicsLayer::create(GraphicsLayerFactory* factory, GraphicsLayerClient& client, Type layerType) 280 280 { 281 281 std::unique_ptr<GraphicsLayer> graphicsLayer; 282 282 if (!factory) 283 graphicsLayer = std::make_unique<GraphicsLayerCA>( client);283 graphicsLayer = std::make_unique<GraphicsLayerCA>(layerType, client); 284 284 else 285 graphicsLayer = factory->createGraphicsLayer( client);286 287 graphicsLayer->initialize( );285 graphicsLayer = factory->createGraphicsLayer(layerType, client); 286 287 graphicsLayer->initialize(layerType); 288 288 289 289 return graphicsLayer; … … 326 326 } 327 327 328 GraphicsLayerCA::GraphicsLayerCA( GraphicsLayerClient& client)329 : GraphicsLayer( client)328 GraphicsLayerCA::GraphicsLayerCA(Type layerType, GraphicsLayerClient& client) 329 : GraphicsLayer(layerType, client) 330 330 , m_contentsLayerPurpose(NoContentsLayer) 331 331 , m_isPageTiledBackingLayer(false) … … 336 336 } 337 337 338 void GraphicsLayerCA::initialize() 339 { 340 PlatformCALayer::LayerType layerType = PlatformCALayer::LayerTypeWebLayer; 341 if (client().shouldUseTiledBacking(this)) { 342 layerType = PlatformCALayer::LayerTypePageTiledBackingLayer; 338 void GraphicsLayerCA::initialize(Type layerType) 339 { 340 if (layerType == Type::PageTiledBacking) 343 341 m_isPageTiledBackingLayer = true; 344 } 345 346 m_layer = createPlatformCALayer(layerType, this); 342 343 PlatformCALayer::LayerType platformLayerType; 344 switch (layerType) { 345 case Type::Normal: 346 platformLayerType = PlatformCALayer::LayerType::LayerTypeWebLayer; 347 break; 348 case Type::PageTiledBacking: 349 platformLayerType = PlatformCALayer::LayerType::LayerTypePageTiledBackingLayer; 350 break; 351 case Type::Scrolling: 352 platformLayerType = PlatformCALayer::LayerType::LayerTypeScrollingLayer; 353 break; 354 } 355 m_layer = createPlatformCALayer(platformLayerType, this); 347 356 noteLayerPropertyChanged(ContentsScaleChanged); 348 357 } … … 1405 1414 updateCustomAppearance(); 1406 1415 1407 if (m_uncommittedChanges & CustomBehaviorChanged)1408 updateCustomBehavior();1409 1410 1416 if (m_uncommittedChanges & ChildrenChanged) { 1411 1417 updateSublayerList(); … … 1752 1758 m_structuralLayer->superlayer()->replaceSublayer(*m_structuralLayer, *m_layer); 1753 1759 1754 move OrCopyAnimations(Move,m_structuralLayer.get(), m_layer.get());1760 moveAnimations(m_structuralLayer.get(), m_layer.get()); 1755 1761 1756 1762 // Release the structural layer. … … 1809 1815 } 1810 1816 1811 move OrCopyAnimations(Move,m_layer.get(), m_structuralLayer.get());1817 moveAnimations(m_layer.get(), m_structuralLayer.get()); 1812 1818 } 1813 1819 … … 3002 3008 } 3003 3009 3004 void GraphicsLayerCA::updateCustomBehavior()3005 {3006 m_layer->updateCustomBehavior(m_customBehavior);3007 }3008 3009 3010 void GraphicsLayerCA::setShowDebugBorder(bool showBorder) 3010 3011 { … … 3109 3110 GraphicsLayer::setCustomAppearance(customAppearance); 3110 3111 noteLayerPropertyChanged(CustomAppearanceChanged); 3111 }3112 3113 void GraphicsLayerCA::setCustomBehavior(CustomBehavior customBehavior)3114 {3115 if (customBehavior == m_customBehavior)3116 return;3117 3118 GraphicsLayer::setCustomBehavior(customBehavior);3119 noteLayerPropertyChanged(CustomBehaviorChanged);3120 3112 } 3121 3113 … … 3189 3181 #endif 3190 3182 3191 // move over animations 3192 moveOrCopyAnimations(Move, oldLayer.get(), m_layer.get()); 3183 moveAnimations(oldLayer.get(), m_layer.get()); 3193 3184 3194 3185 // need to tell new layer to draw itself … … 3427 3418 if (cloneLevel == IntermediateCloneLevel) { 3428 3419 newLayer->setOpacity(layer->opacity()); 3429 moveOrCopyAnimations(Copy,layer, newLayer.get());3420 copyAnimations(layer, newLayer.get()); 3430 3421 } 3431 3422 -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
r179389 r179604 57 57 static const int kTiledLayerTileSize = 512; 58 58 59 WEBCORE_EXPORT explicit GraphicsLayerCA( GraphicsLayerClient&);59 WEBCORE_EXPORT explicit GraphicsLayerCA(Type, GraphicsLayerClient&); 60 60 WEBCORE_EXPORT virtual ~GraphicsLayerCA(); 61 61 62 WEBCORE_EXPORT virtual void initialize( ) override;62 WEBCORE_EXPORT virtual void initialize(Type) override; 63 63 64 64 WEBCORE_EXPORT virtual void setName(const String&) override; … … 144 144 145 145 WEBCORE_EXPORT virtual void setCustomAppearance(CustomAppearance) override; 146 WEBCORE_EXPORT virtual void setCustomBehavior(CustomBehavior) override;147 146 148 147 WEBCORE_EXPORT virtual void deviceOrPageScaleFactorChanged() override; … … 385 384 void updateContentsScale(float pageScaleFactor); 386 385 void updateCustomAppearance(); 387 void updateCustomBehavior();388 386 389 387 enum StructuralLayerPurpose { … … 402 400 enum MoveOrCopy { Move, Copy }; 403 401 static void moveOrCopyLayerAnimation(MoveOrCopy, const String& animationIdentifier, PlatformCALayer *fromLayer, PlatformCALayer *toLayer); 404 void moveOrCopyAnimations(MoveOrCopy, PlatformCALayer * fromLayer, PlatformCALayer * toLayer); 405 402 void moveOrCopyAnimations(MoveOrCopy, PlatformCALayer* fromLayer, PlatformCALayer* toLayer); 403 404 void moveAnimations(PlatformCALayer* fromLayer, PlatformCALayer* toLayer) 405 { 406 moveOrCopyAnimations(Move, fromLayer, toLayer); 407 } 408 void copyAnimations(PlatformCALayer* fromLayer, PlatformCALayer* toLayer) 409 { 410 moveOrCopyAnimations(Copy, fromLayer, toLayer); 411 } 412 406 413 bool appendToUncommittedAnimations(const KeyframeValueList&, const TransformOperations*, const Animation*, const String& animationName, const FloatSize& boxSize, int animationIndex, double timeOffset, bool isMatrixAnimation); 407 414 bool appendToUncommittedAnimations(const KeyframeValueList&, const FilterOperation*, const Animation*, const String& animationName, int animationIndex, double timeOffset); … … 441 448 DebugIndicatorsChanged = 1LLU << 31, 442 449 CustomAppearanceChanged = 1LLU << 32, 443 CustomBehaviorChanged = 1LLU << 33, 444 BlendModeChanged = 1LLU << 34, 450 BlendModeChanged = 1LLU << 33, 445 451 }; 446 452 typedef uint64_t LayerChangeFlags; -
trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h
r175794 r179604 81 81 LayerTypeBackdropLayer, 82 82 LayerTypeShapeLayer, 83 LayerTypeScrollingLayer, 83 84 LayerTypeCustom 84 85 }; … … 214 215 virtual void updateCustomAppearance(GraphicsLayer::CustomAppearance) = 0; 215 216 216 virtual GraphicsLayer::CustomBehavior customBehavior() const = 0;217 virtual void updateCustomBehavior(GraphicsLayer::CustomBehavior) = 0;218 219 217 virtual TiledBacking* tiledBacking() = 0; 220 218 -
trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.h
r175794 r179604 146 146 virtual void updateCustomAppearance(GraphicsLayer::CustomAppearance) override; 147 147 148 virtual GraphicsLayer::CustomBehavior customBehavior() const override { return m_customBehavior; }149 virtual void updateCustomBehavior(GraphicsLayer::CustomBehavior) override;150 151 148 virtual TiledBacking* tiledBacking() override; 152 149 … … 170 167 std::unique_ptr<PlatformCALayerList> m_customSublayers; 171 168 GraphicsLayer::CustomAppearance m_customAppearance; 172 GraphicsLayer::CustomBehavior m_customBehavior;173 169 std::unique_ptr<FloatRoundedRect> m_shapeRoundedRect; 174 170 }; -
trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm
r179450 r179604 206 206 : PlatformCALayer(layerType, owner) 207 207 , m_customAppearance(GraphicsLayer::NoCustomAppearance) 208 , m_customBehavior(GraphicsLayer::NoCustomBehavior)209 208 { 210 209 Class layerClass = Nil; … … 214 213 layerClass = [CALayer class]; 215 214 break; 215 case LayerTypeScrollingLayer: 216 // Scrolling layers only have special behavior with PlatformCALayerRemote. 217 // fallthrough 216 218 case LayerTypeWebLayer: 217 219 layerClass = [WebLayer class]; … … 263 265 : PlatformCALayer(layerTypeForPlatformLayer(layer), owner) 264 266 , m_customAppearance(GraphicsLayer::NoCustomAppearance) 265 , m_customBehavior(GraphicsLayer::NoCustomBehavior)266 267 { 267 268 m_layer = layer; … … 276 277 277 278 // Clear all the implicit animations on the CALayer 278 if (m_layerType == LayerTypeAVPlayerLayer || m_layerType == LayerTypeWebGLLayer || m_layerType == LayerType Custom)279 if (m_layerType == LayerTypeAVPlayerLayer || m_layerType == LayerTypeWebGLLayer || m_layerType == LayerTypeScrollingLayer || m_layerType == LayerTypeCustom) 279 280 [m_layer web_disableAllActions]; 280 281 else … … 878 879 } 879 880 880 void PlatformCALayerMac::updateCustomBehavior(GraphicsLayer::CustomBehavior customBehavior)881 {882 m_customBehavior = customBehavior;883 884 // Custom layers can get wrapped in UIViews (which clobbers the layer delegate),885 // so fall back to the slower way of disabling implicit animations.886 if (m_customBehavior != GraphicsLayer::NoCustomBehavior) {887 if ([[m_layer delegate] isKindOfClass:[WebActionDisablingCALayerDelegate class]])888 [m_layer setDelegate:nil];889 [m_layer web_disableAllActions];890 }891 }892 893 881 TiledBacking* PlatformCALayerMac::tiledBacking() 894 882 { -
trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp
r178520 r179604 129 129 : PlatformCALayer(layer ? LayerTypeCustom : layerType, owner) 130 130 , m_customAppearance(GraphicsLayer::NoCustomAppearance) 131 , m_customBehavior(GraphicsLayer::NoCustomBehavior)132 131 { 133 132 if (layer) { -
trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.h
r175794 r179604 134 134 virtual void updateCustomAppearance(GraphicsLayer::CustomAppearance customAppearance) override { m_customAppearance = customAppearance; } 135 135 136 virtual GraphicsLayer::CustomBehavior customBehavior() const override { return m_customBehavior; }137 virtual void updateCustomBehavior(GraphicsLayer::CustomBehavior customBehavior) override { m_customBehavior = customBehavior; }138 139 136 virtual TiledBacking* tiledBacking() override; 140 137 … … 157 154 std::unique_ptr<PlatformCALayerList> m_customSublayers; 158 155 GraphicsLayer::CustomAppearance m_customAppearance; 159 GraphicsLayer::CustomBehavior m_customBehavior;160 156 }; 161 157 -
trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.cpp
r178182 r179604 31 31 namespace WebCore { 32 32 33 std::unique_ptr<GraphicsLayer> GraphicsLayer::create(GraphicsLayerFactory* factory, GraphicsLayerClient& client )33 std::unique_ptr<GraphicsLayer> GraphicsLayer::create(GraphicsLayerFactory* factory, GraphicsLayerClient& client, Type layerType) 34 34 { 35 35 if (!factory) 36 return std::make_unique<GraphicsLayerTextureMapper>( client);37 38 return factory->createGraphicsLayer( client);39 } 40 41 GraphicsLayerTextureMapper::GraphicsLayerTextureMapper( GraphicsLayerClient& client)42 : GraphicsLayer( client)36 return std::make_unique<GraphicsLayerTextureMapper>(layerType, client); 37 38 return factory->createGraphicsLayer(layerType, client); 39 } 40 41 GraphicsLayerTextureMapper::GraphicsLayerTextureMapper(Type layerType, GraphicsLayerClient& client) 42 : GraphicsLayer(layerType, client) 43 43 , m_compositedNativeImagePtr(0) 44 44 , m_changeMask(NoChanges) -
trunk/Source/WebCore/platform/graphics/texmap/GraphicsLayerTextureMapper.h
r178182 r179604 35 35 class GraphicsLayerTextureMapper final : public GraphicsLayer, TextureMapperPlatformLayer::Client { 36 36 public: 37 explicit GraphicsLayerTextureMapper( GraphicsLayerClient&);37 explicit GraphicsLayerTextureMapper(Type, GraphicsLayerClient&); 38 38 virtual ~GraphicsLayerTextureMapper(); 39 39 -
trunk/Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.cpp
r178119 r179604 256 256 } 257 257 258 std::unique_ptr<GraphicsLayer> CompositingCoordinator::createGraphicsLayer(GraphicsLayer Client& client)259 { 260 CoordinatedGraphicsLayer* layer = new CoordinatedGraphicsLayer( client);258 std::unique_ptr<GraphicsLayer> CompositingCoordinator::createGraphicsLayer(GraphicsLayer::Type layerType, GraphicsLayerClient& client) 259 { 260 CoordinatedGraphicsLayer* layer = new CoordinatedGraphicsLayer(layerType, client); 261 261 layer->setCoordinator(this); 262 262 m_registeredLayers.add(layer->id(), layer); -
trunk/Source/WebCore/platform/graphics/texmap/coordinated/CompositingCoordinator.h
r176495 r179604 115 115 116 116 // GraphicsLayerFactory 117 virtual std::unique_ptr<GraphicsLayer> createGraphicsLayer(GraphicsLayer Client&) override;117 virtual std::unique_ptr<GraphicsLayer> createGraphicsLayer(GraphicsLayer::Type, GraphicsLayerClient&) override; 118 118 119 119 void initializeRootCompositingLayerIfNeeded(); -
trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.cpp
r178182 r179604 104 104 } 105 105 106 CoordinatedGraphicsLayer::CoordinatedGraphicsLayer( GraphicsLayerClient& client)107 : GraphicsLayer( client)106 CoordinatedGraphicsLayer::CoordinatedGraphicsLayer(Type layerType, GraphicsLayerClient& client) 107 : GraphicsLayer(layerType, client) 108 108 #ifndef NDEBUG 109 109 , m_isPurging(false) -
trunk/Source/WebCore/platform/graphics/texmap/coordinated/CoordinatedGraphicsLayer.h
r178182 r179604 62 62 , public CoordinatedTileClient { 63 63 public: 64 explicit CoordinatedGraphicsLayer( GraphicsLayerClient&);64 explicit CoordinatedGraphicsLayer(Type, GraphicsLayerClient&); 65 65 virtual ~CoordinatedGraphicsLayer(); 66 66 -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r179495 r179604 106 106 } 107 107 108 bool RenderLayerBacking::m_creatingPrimaryGraphicsLayer = false;109 110 108 RenderLayerBacking::RenderLayerBacking(RenderLayer& layer) 111 109 : m_owningLayer(layer) … … 164 162 } 165 163 166 std::unique_ptr<GraphicsLayer> RenderLayerBacking::createGraphicsLayer(const String& name )164 std::unique_ptr<GraphicsLayer> RenderLayerBacking::createGraphicsLayer(const String& name, GraphicsLayer::Type layerType) 167 165 { 168 166 GraphicsLayerFactory* graphicsLayerFactory = 0; … … 170 168 graphicsLayerFactory = page->chrome().client().graphicsLayerFactory(); 171 169 172 std::unique_ptr<GraphicsLayer> graphicsLayer = GraphicsLayer::create(graphicsLayerFactory, *this );170 std::unique_ptr<GraphicsLayer> graphicsLayer = GraphicsLayer::create(graphicsLayerFactory, *this, layerType); 173 171 174 172 #ifndef NDEBUG … … 182 180 183 181 return graphicsLayer; 184 }185 186 bool RenderLayerBacking::shouldUseTiledBacking(const GraphicsLayer*) const187 {188 return m_usingTiledCacheLayer && m_creatingPrimaryGraphicsLayer;189 182 } 190 183 … … 287 280 #endif 288 281 289 // The call to createGraphicsLayer ends calling back into here as 290 // a GraphicsLayerClient to ask if it shouldUseTiledBacking(). We only want 291 // the tile cache on our main layer. This is pretty ugly, but saves us from 292 // exposing the API to all clients. 293 294 m_creatingPrimaryGraphicsLayer = true; 295 m_graphicsLayer = createGraphicsLayer(layerName); 296 m_creatingPrimaryGraphicsLayer = false; 282 m_graphicsLayer = createGraphicsLayer(layerName, m_usingTiledCacheLayer ? GraphicsLayer::Type::PageTiledBacking : GraphicsLayer::Type::Normal); 297 283 298 284 if (m_usingTiledCacheLayer) { … … 1485 1471 if (!m_scrollingLayer) { 1486 1472 // Outer layer which corresponds with the scroll view. 1487 m_scrollingLayer = createGraphicsLayer("Scrolling container" );1473 m_scrollingLayer = createGraphicsLayer("Scrolling container", GraphicsLayer::Type::Scrolling); 1488 1474 m_scrollingLayer->setDrawsContent(false); 1489 1475 m_scrollingLayer->setMasksToBounds(true); 1490 #if PLATFORM(IOS) 1491 m_scrollingLayer->setCustomBehavior(GraphicsLayer::CustomScrollingBehavior); 1492 #endif 1476 1493 1477 // Inner layer which renders the content that scrolls. 1494 1478 m_scrollingContentsLayer = createGraphicsLayer("Scrolled Contents"); 1495 1479 m_scrollingContentsLayer->setDrawsContent(true); 1496 #if PLATFORM(IOS) 1497 m_scrollingContentsLayer->setCustomBehavior(GraphicsLayer::CustomScrolledContentsBehavior); 1498 #endif 1480 1499 1481 GraphicsLayerPaintingPhase paintPhase = GraphicsLayerPaintOverflowContents | GraphicsLayerPaintCompositedScroll; 1500 1482 if (!m_foregroundLayer) -
trunk/Source/WebCore/rendering/RenderLayerBacking.h
r179244 r179604 194 194 195 195 // GraphicsLayerClient interface 196 virtual bool shouldUseTiledBacking(const GraphicsLayer*) const override;197 196 virtual void tiledBackingUsageChanged(const GraphicsLayer*, bool /*usingTiledBacking*/) override; 198 197 virtual void notifyAnimationStarted(const GraphicsLayer*, const String& animationKey, double startTime) override; … … 257 256 LayoutRect compositedBoundsIncludingMargin() const; 258 257 259 std::unique_ptr<GraphicsLayer> createGraphicsLayer(const String& );258 std::unique_ptr<GraphicsLayer> createGraphicsLayer(const String&, GraphicsLayer::Type = GraphicsLayer::Type::Normal); 260 259 261 260 RenderLayerModelObject& renderer() const { return m_owningLayer.renderer(); } … … 366 365 #endif 367 366 bool m_backgroundLayerPaintsFixedRootBackground; 368 369 static bool m_creatingPrimaryGraphicsLayer;370 367 }; 371 368 -
trunk/Source/WebKit2/ChangeLog
r179603 r179604 1 2015-02-04 Simon Fraser <simon.fraser@apple.com> 2 3 [iOS WK2] Assert in ScrollingTreeOverflowScrollingNodeIOS::updateAfterChildren() on tab switching 4 https://bugs.webkit.org/show_bug.cgi?id=141223 5 rdar://problem/18458993 6 7 Reviewed by Tim Horton. 8 9 It's possible to submit a RemoteLayerTree transaction that contains data 10 about a created layer, but doesn't have any properties for that layer. This 11 happens when the newly created layer isn't reached during the traversal that 12 gathers layer properties (i.e. it's not rooted). However, whether we create 13 a scrolling layer or not requires having properties; they are missing, so we 14 create a normal layer, but then the scrolling tree commit asserts that we 15 should have a scrolling layer. 16 17 Fix by making scrolling layers have a corresponding layer type, which is 18 stored in layer creation properties. This required exposing layer types 19 up through GraphicsLayer, but that allows for some nice cleanup: 20 21 1. No need to have the hokey shouldUseTiledBacking() GraphicsLayerClient hack 22 for creating the page tiled layer. 23 2. The notion of "custom behaviors" can be removed from GraphicsLayer entirely. 24 25 * Shared/mac/RemoteLayerBackingStore.mm: 26 (WebKit::RemoteLayerBackingStore::drawInContext): 27 * Shared/mac/RemoteLayerTreeTransaction.h: 28 * Shared/mac/RemoteLayerTreeTransaction.mm: 29 (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties): 30 (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode): 31 (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode): 32 (WebKit::dumpChangedLayers): 33 (WebKit::RemoteLayerTreeTransaction::description): 34 * UIProcess/ios/RemoteLayerTreeHostIOS.mm: 35 (WebKit::RemoteLayerTreeHost::createLayer): 36 * UIProcess/mac/RemoteLayerTreeHost.mm: 37 (WebKit::RemoteLayerTreeHost::createLayer): 38 * WebProcess/WebPage/mac/GraphicsLayerCARemote.h: 39 * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp: 40 (WebKit::PlatformCALayerRemote::customBehavior): Deleted. 41 (WebKit::PlatformCALayerRemote::updateCustomBehavior): Deleted. 42 * WebProcess/WebPage/mac/PlatformCALayerRemote.h: 43 * WebProcess/WebPage/mac/RemoteLayerTreeContext.h: 44 * WebProcess/WebPage/mac/RemoteLayerTreeContext.mm: 45 (WebKit::RemoteLayerTreeContext::createGraphicsLayer): 46 1 47 2015-02-04 Gyuyoung Kim <gyuyoung.kim@samsung.com> 2 48 -
trunk/Source/WebKit2/Shared/mac/RemoteLayerBackingStore.mm
r177543 r179604 343 343 case PlatformCALayer::LayerTypeBackdropLayer: 344 344 case PlatformCALayer::LayerTypeShapeLayer: 345 case PlatformCALayer::LayerTypeScrollingLayer: 345 346 case PlatformCALayer::LayerTypeCustom: 346 347 ASSERT_NOT_REACHED(); -
trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h
r176334 r179604 83 83 AnimationsChanged = 1LLU << 30, 84 84 EdgeAntialiasingMaskChanged = 1LLU << 31, 85 CustomAppearanceChanged = 1LLU << 32, 86 CustomBehaviorChanged = 1LLU << 33 85 CustomAppearanceChanged = 1LLU << 32 87 86 }; 88 87 typedef uint64_t LayerChange; … … 150 149 unsigned edgeAntialiasingMask; 151 150 WebCore::GraphicsLayer::CustomAppearance customAppearance; 152 WebCore::GraphicsLayer::CustomBehavior customBehavior;153 151 WebCore::PlatformCALayer::FilterType minificationFilter; 154 152 WebCore::PlatformCALayer::FilterType magnificationFilter; -
trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm
r178710 r179604 94 94 , edgeAntialiasingMask(kCALayerLeftEdge | kCALayerRightEdge | kCALayerBottomEdge | kCALayerTopEdge) 95 95 , customAppearance(GraphicsLayer::NoCustomAppearance) 96 , customBehavior(GraphicsLayer::NoCustomBehavior)97 96 , minificationFilter(PlatformCALayer::FilterType::Linear) 98 97 , magnificationFilter(PlatformCALayer::FilterType::Linear) … … 129 128 , edgeAntialiasingMask(other.edgeAntialiasingMask) 130 129 , customAppearance(other.customAppearance) 131 , customBehavior(other.customBehavior)132 130 , minificationFilter(other.minificationFilter) 133 131 , magnificationFilter(other.magnificationFilter) … … 257 255 if (changedProperties & CustomAppearanceChanged) 258 256 encoder.encodeEnum(customAppearance); 259 260 if (changedProperties & CustomBehaviorChanged)261 encoder.encodeEnum(customBehavior);262 257 } 263 258 … … 452 447 if (result.changedProperties & CustomAppearanceChanged) { 453 448 if (!decoder.decodeEnum(result.customAppearance)) 454 return false;455 }456 457 if (result.changedProperties & CustomBehaviorChanged) {458 if (!decoder.decodeEnum(result.customBehavior))459 449 return false; 460 450 } … … 1185 1175 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::CustomAppearanceChanged) 1186 1176 dumpProperty(ts, "customAppearance", layerProperties.customAppearance); 1187 1188 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::CustomBehaviorChanged)1189 dumpProperty(ts, "customBehavior", layerProperties.customBehavior);1190 1177 1191 1178 ts << ")"; … … 1256 1243 ts << "shape-layer"; 1257 1244 break; 1245 case PlatformCALayer::LayerTypeScrollingLayer: 1246 ts << "scrolling-layer"; 1247 break; 1258 1248 case PlatformCALayer::LayerTypeCustom: 1259 1249 ts << "custom-layer (context-id " << createdLayer.hostingContextID << ")"; -
trunk/Source/WebKit2/UIProcess/ios/RemoteLayerTreeHostIOS.mm
r175811 r179604 174 174 case PlatformCALayer::LayerTypePageTiledBackingLayer: 175 175 case PlatformCALayer::LayerTypeTiledBackingTileLayer: 176 if (layerProperties && layerProperties->customBehavior == GraphicsLayer::CustomScrollingBehavior) { 177 if (!m_isDebugLayerTreeHost) 178 view = adoptNS([[UIScrollView alloc] init]); 179 else // The debug indicator parents views under layers, which can cause crashes with UIScrollView. 180 view = adoptNS([[UIView alloc] init]); 181 } else 182 view = adoptNS([[WKCompositingView alloc] init]); 176 view = adoptNS([[WKCompositingView alloc] init]); 183 177 break; 184 178 case PlatformCALayer::LayerTypeBackdropLayer: … … 199 193 view = adoptNS([[WKShapeView alloc] init]); 200 194 break; 195 case PlatformCALayer::LayerTypeScrollingLayer: 196 if (!m_isDebugLayerTreeHost) 197 view = adoptNS([[UIScrollView alloc] init]); 198 else // The debug indicator parents views under layers, which can cause crashes with UIScrollView. 199 view = adoptNS([[UIView alloc] init]); 200 break; 201 201 default: 202 202 ASSERT_NOT_REACHED(); -
trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.mm
r175794 r179604 223 223 case PlatformCALayer::LayerTypePageTiledBackingLayer: 224 224 case PlatformCALayer::LayerTypeTiledBackingTileLayer: 225 case PlatformCALayer::LayerTypeScrollingLayer: 225 226 layer = adoptNS([[CALayer alloc] init]); 226 227 break; -
trunk/Source/WebKit2/WebProcess/WebPage/mac/GraphicsLayerCARemote.h
r174602 r179604 36 36 class GraphicsLayerCARemote final : public WebCore::GraphicsLayerCA { 37 37 public: 38 GraphicsLayerCARemote( WebCore::GraphicsLayerClient& client, RemoteLayerTreeContext& context)39 : GraphicsLayerCA( client)38 GraphicsLayerCARemote(Type layerType, WebCore::GraphicsLayerClient& client, RemoteLayerTreeContext& context) 39 : GraphicsLayerCA(layerType, client) 40 40 , m_context(context) 41 41 { -
trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp
r175794 r179604 725 725 } 726 726 727 GraphicsLayer::CustomBehavior PlatformCALayerRemote::customBehavior() const728 {729 return m_properties.customBehavior;730 }731 732 void PlatformCALayerRemote::updateCustomBehavior(GraphicsLayer::CustomBehavior customBehavior)733 {734 m_properties.customBehavior = customBehavior;735 m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::CustomBehaviorChanged);736 }737 738 727 PassRefPtr<PlatformCALayer> PlatformCALayerRemote::createCompatibleLayer(PlatformCALayer::LayerType layerType, PlatformCALayerClient* client) const 739 728 { -
trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h
r175794 r179604 151 151 virtual void updateCustomAppearance(WebCore::GraphicsLayer::CustomAppearance) override; 152 152 153 virtual WebCore::GraphicsLayer::CustomBehavior customBehavior() const override;154 virtual void updateCustomBehavior(WebCore::GraphicsLayer::CustomBehavior) override;155 156 153 virtual WebCore::TiledBacking* tiledBacking() override { return nullptr; } 157 154 -
trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeContext.h
r173702 r179604 74 74 private: 75 75 // WebCore::GraphicsLayerFactory 76 virtual std::unique_ptr<WebCore::GraphicsLayer> createGraphicsLayer(WebCore::GraphicsLayer Client&) override;76 virtual std::unique_ptr<WebCore::GraphicsLayer> createGraphicsLayer(WebCore::GraphicsLayer::Type, WebCore::GraphicsLayerClient&) override; 77 77 78 78 WebPage& m_webPage; -
trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeContext.mm
r174657 r179604 99 99 } 100 100 101 std::unique_ptr<GraphicsLayer> RemoteLayerTreeContext::createGraphicsLayer( GraphicsLayerClient& client)101 std::unique_ptr<GraphicsLayer> RemoteLayerTreeContext::createGraphicsLayer(WebCore::GraphicsLayer::Type layerType, GraphicsLayerClient& client) 102 102 { 103 return std::make_unique<GraphicsLayerCARemote>( client, *this);103 return std::make_unique<GraphicsLayerCARemote>(layerType, client, *this); 104 104 } 105 105
Note: See TracChangeset
for help on using the changeset viewer.