Changeset 243126 in webkit
- Timestamp:
- Mar 18, 2019 7:05:23 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r243125 r243126 1 2019-03-18 Simon Fraser <simon.fraser@apple.com> 2 3 Scrolling state nodes should hold references to GraphicsLayers 4 https://bugs.webkit.org/show_bug.cgi?id=195844 5 <rdar://problem/48949634> 6 7 Reviewed by Tim Horton. 8 9 GraphicsLayers are refcounted, and the scrolling tree keeps GraphicsLayer pointers, 10 so for safely the scrolling tree should store RefPtr<GraphicsLayer> instead. 11 12 I removed the union (since it would be weird with a RefPtr and raw pointer). This code 13 should probably use WTF::Variant<> in future. 14 15 * page/scrolling/ScrollingStateNode.h: 16 (WebCore::LayerRepresentation::LayerRepresentation): 17 (WebCore::LayerRepresentation::operator GraphicsLayer* const): 18 1 19 2019-03-18 Commit Queue <commit-queue@webkit.org> 2 20 -
trunk/Source/WebCore/page/scrolling/ScrollingStateNode.h
r242913 r243126 59 59 }; 60 60 61 LayerRepresentation() 62 : m_graphicsLayer(nullptr) 63 , m_layerID(0) 64 , m_representation(EmptyRepresentation) 65 { } 61 LayerRepresentation() = default; 66 62 67 63 LayerRepresentation(GraphicsLayer* graphicsLayer) … … 73 69 LayerRepresentation(PlatformLayer* platformLayer) 74 70 : m_typelessPlatformLayer(makePlatformLayerTypeless(platformLayer)) 75 , m_layerID(0)76 71 , m_representation(PlatformLayerRepresentation) 77 72 { … … 80 75 81 76 LayerRepresentation(GraphicsLayer::PlatformLayerID layerID) 82 : m_graphicsLayer(nullptr) 83 , m_layerID(layerID) 77 : m_layerID(layerID) 84 78 , m_representation(PlatformLayerIDRepresentation) 85 79 { … … 104 98 { 105 99 ASSERT(m_representation == GraphicsLayerRepresentation); 106 return m_graphicsLayer ;100 return m_graphicsLayer.get(); 107 101 } 108 102 … … 180 174 WEBCORE_EXPORT static void* makePlatformLayerTypeless(PlatformLayer*); 181 175 182 union { 183 GraphicsLayer* m_graphicsLayer; 184 void* m_typelessPlatformLayer; 185 }; 186 187 GraphicsLayer::PlatformLayerID m_layerID; 188 Type m_representation; 176 RefPtr<GraphicsLayer> m_graphicsLayer; 177 void* m_typelessPlatformLayer { nullptr }; 178 GraphicsLayer::PlatformLayerID m_layerID { 0 }; 179 Type m_representation { EmptyRepresentation }; 189 180 }; 190 181
Note: See TracChangeset
for help on using the changeset viewer.