Changeset 157528 in webkit
- Timestamp:
- Oct 16, 2013, 2:20:14 PM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r157524 r157528 1 2013-10-16 Tim Horton <timothy_horton@apple.com> 2 3 PlatformCALayer constructor should take layer type as an argument 4 https://bugs.webkit.org/show_bug.cgi?id=122915 5 6 Reviewed by Simon Fraser. 7 8 No new tests, just a minor refactoring. 9 10 * platform/graphics/ca/PlatformCALayer.h: 11 (WebCore::PlatformCALayer::PlatformCALayer): 12 Add a LayerType argument. 13 14 * platform/graphics/ca/mac/PlatformCALayerMac.mm: 15 (PlatformCALayerMac::PlatformCALayerMac): 16 * platform/graphics/ca/win/PlatformCALayerWin.cpp: 17 (PlatformCALayerWin::PlatformCALayerWin): 18 Use the new LayerType argument, and early-return in the case where we 19 are wrapping a custom PlatformLayer. 20 Drive-by un-indent the switch in the Mac version. 21 1 22 2013-10-15 Brady Eidson <beidson@apple.com> 2 23 -
trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h
r157478 r157528 201 201 202 202 protected: 203 PlatformCALayer(PlatformCALayerClient* owner) 204 : m_owner(owner) 203 PlatformCALayer(LayerType layerType, PlatformCALayerClient* owner) 204 : m_layerType(layerType) 205 , m_owner(owner) 205 206 { 206 207 -
trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm
r157419 r157528 173 173 174 174 PlatformCALayerMac::PlatformCALayerMac(LayerType layerType, PlatformLayer* layer, PlatformCALayerClient* owner) 175 : PlatformCALayer( owner)175 : PlatformCALayer(layer ? LayerTypeCustom : layerType, owner) 176 176 { 177 177 BEGIN_BLOCK_OBJC_EXCEPTIONS … … 179 179 if ([layer isKindOfClass:getAVPlayerLayerClass()]) 180 180 m_layerType = LayerTypeAVPlayerLayer; 181 else182 m_layerType = LayerTypeCustom;183 181 m_layer = layer; 184 } else { 185 m_layerType = layerType; 186 187 Class layerClass = Nil; 188 switch (layerType) { 189 case LayerTypeLayer: 190 case LayerTypeRootLayer: 191 layerClass = [CALayer class]; 192 break; 193 case LayerTypeWebLayer: 194 layerClass = [WebLayer class]; 195 break; 196 case LayerTypeTransformLayer: 197 layerClass = [CATransformLayer class]; 198 break; 199 case LayerTypeWebTiledLayer: 200 layerClass = [WebTiledLayer class]; 201 break; 202 case LayerTypeTiledBackingLayer: 203 case LayerTypePageTiledBackingLayer: 204 layerClass = [WebTiledBackingLayer class]; 205 break; 206 case LayerTypeAVPlayerLayer: 207 layerClass = getAVPlayerLayerClass(); 208 break; 209 case LayerTypeCustom: 210 break; 211 } 212 213 if (layerClass) 214 m_layer = adoptNS([[layerClass alloc] init]); 215 } 182 return; 183 } 184 185 Class layerClass = Nil; 186 switch (layerType) { 187 case LayerTypeLayer: 188 case LayerTypeRootLayer: 189 layerClass = [CALayer class]; 190 break; 191 case LayerTypeWebLayer: 192 layerClass = [WebLayer class]; 193 break; 194 case LayerTypeTransformLayer: 195 layerClass = [CATransformLayer class]; 196 break; 197 case LayerTypeWebTiledLayer: 198 layerClass = [WebTiledLayer class]; 199 break; 200 case LayerTypeTiledBackingLayer: 201 case LayerTypePageTiledBackingLayer: 202 layerClass = [WebTiledBackingLayer class]; 203 break; 204 case LayerTypeAVPlayerLayer: 205 layerClass = getAVPlayerLayerClass(); 206 break; 207 case LayerTypeCustom: 208 break; 209 } 210 211 if (layerClass) 212 m_layer = adoptNS([[layerClass alloc] init]); 216 213 217 214 // Save a pointer to 'this' in the CALayer -
trunk/Source/WebCore/platform/graphics/ca/win/PlatformCALayerWin.cpp
r157419 r157528 109 109 110 110 PlatformCALayerWin::PlatformCALayerWin(LayerType layerType, PlatformLayer* layer, PlatformCALayerClient* owner) 111 : PlatformCALayer( owner)111 : PlatformCALayer(layer ? LayerTypeCustom : layerType, owner) 112 112 { 113 113 if (layer) { 114 m_layerType = LayerTypeCustom;115 114 m_layer = layer; 116 } else {117 m_layerType = layerType;118 ASSERT((layerType != LayerTypeTiledBackingLayer) && (layerType != LayerTypePageTiledBackingLayer)); 119 m_layer = adoptCF(CACFLayerCreate(toCACFLayerType(layerType)));120 121 // Create the PlatformCALayerWinInternal object and point to it in the userdata. 122 PlatformCALayerWinInternal* intern = new PlatformCALayerWinInternal(this);123 CACFLayerSetUserData(m_layer.get(), intern);124 125 // Set the display callback 126 CACFLayerSetDisplayCallback(m_layer.get(), displayCallback);127 CACFLayerSetLayoutCallback(m_layer.get(), layoutSublayersProc);128 }115 return; 116 } 117 118 ASSERT((layerType != LayerTypeTiledBackingLayer) && (layerType != LayerTypePageTiledBackingLayer)); 119 m_layer = adoptCF(CACFLayerCreate(toCACFLayerType(layerType))); 120 121 // Create the PlatformCALayerWinInternal object and point to it in the userdata. 122 PlatformCALayerWinInternal* intern = new PlatformCALayerWinInternal(this); 123 CACFLayerSetUserData(m_layer.get(), intern); 124 125 // Set the display callback 126 CACFLayerSetDisplayCallback(m_layer.get(), displayCallback); 127 CACFLayerSetLayoutCallback(m_layer.get(), layoutSublayersProc); 129 128 } 130 129 -
trunk/Source/WebKit2/ChangeLog
r157527 r157528 1 2013-10-16 Tim Horton <timothy_horton@apple.com> 2 3 PlatformCALayer constructor should take layer type as an argument 4 https://bugs.webkit.org/show_bug.cgi?id=122915 5 6 Reviewed by Simon Fraser. 7 8 * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp: 9 (PlatformCALayerRemote::PlatformCALayerRemote): 10 Use the new LayerType argument. 11 1 12 2013-10-16 Tim Horton <timothy_horton@apple.com> 2 13 -
trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp
r157523 r157528 55 55 56 56 PlatformCALayerRemote::PlatformCALayerRemote(LayerType layerType, PlatformCALayerClient* owner, RemoteLayerTreeContext* context) 57 : PlatformCALayer( owner)57 : PlatformCALayer(layerType, owner) 58 58 , m_layerID(generateLayerID()) 59 59 , m_context(context) 60 60 { 61 m_layerType = layerType;62 63 61 m_context->layerWasCreated(this, layerType); 64 62 }
Note:
See TracChangeset
for help on using the changeset viewer.