Changeset 166308 in webkit
- Timestamp:
- Mar 26, 2014, 12:36:49 PM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r166307 r166308 1 2014-03-26 Simon Fraser <simon.fraser@apple.com> 2 3 Add a custom behavior flag to GraphicsLayer, piped down to PlatformCALayer, for scrolling layers 4 https://bugs.webkit.org/show_bug.cgi?id=130778 5 6 Reviewed by Tim Horton. 7 8 Make it possible to put a "custom behavior" flag on a layer so that, 9 with UI-side compositing, we know to create a specific type of 10 layer or view for that GraphicsLayer. 11 12 * WebCore.exp.in: 13 * platform/graphics/GraphicsLayer.cpp: 14 (WebCore::GraphicsLayer::GraphicsLayer): 15 * platform/graphics/GraphicsLayer.h: 16 (WebCore::GraphicsLayer::setCustomBehavior): 17 (WebCore::GraphicsLayer::customBehavior): 18 * platform/graphics/ca/GraphicsLayerCA.cpp: 19 (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers): 20 (WebCore::GraphicsLayerCA::updateCustomBehavior): 21 (WebCore::GraphicsLayerCA::setCustomBehavior): 22 * platform/graphics/ca/GraphicsLayerCA.h: 23 * platform/graphics/ca/PlatformCALayer.h: 24 * platform/graphics/ca/mac/PlatformCALayerMac.h: 25 * platform/graphics/ca/mac/PlatformCALayerMac.mm: 26 (PlatformCALayerMac::PlatformCALayerMac): 27 * rendering/RenderLayerBacking.cpp: 28 (WebCore::RenderLayerBacking::updateScrollingLayers): 29 1 30 2014-03-26 Brent Fulgham <bfulgham@apple.com> 2 31 -
trunk/Source/WebCore/WebCore.exp.in
r166298 r166308 546 546 __ZN7WebCore15GraphicsLayerCA16setMasksToBoundsEb 547 547 __ZN7WebCore15GraphicsLayerCA17setContentsOpaqueEb 548 __ZN7WebCore15GraphicsLayerCA17setCustomBehaviorENS_13GraphicsLayer14CustomBehaviorE 548 549 __ZN7WebCore15GraphicsLayerCA17suspendAnimationsEd 549 550 __ZN7WebCore15GraphicsLayerCA18setAllowTiledLayerEb -
trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp
r165804 r166308 100 100 , m_repaintCount(0) 101 101 , m_customAppearance(NoCustomAppearance) 102 , m_customBehavior(NoCustomBehavior) 102 103 { 103 104 #ifndef NDEBUG -
trunk/Source/WebCore/platform/graphics/GraphicsLayer.h
r165676 r166308 444 444 CustomAppearance customAppearance() const { return m_customAppearance; } 445 445 446 enum CustomBehavior { NoCustomBehavior, CustomScrollingBehavior }; 447 virtual void setCustomBehavior(CustomBehavior customBehavior) { m_customBehavior = customBehavior; } 448 CustomBehavior customBehavior() const { return m_customBehavior; } 449 446 450 // z-position is the z-equivalent of position(). It's only used for debugging purposes. 447 451 virtual float zPosition() const { return m_zPosition; } … … 612 616 int m_repaintCount; 613 617 CustomAppearance m_customAppearance; 618 CustomBehavior m_customBehavior; 614 619 }; 615 620 -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
r165863 r166308 1410 1410 updateCustomAppearance(); 1411 1411 1412 if (m_uncommittedChanges & CustomBehaviorChanged) 1413 updateCustomBehavior(); 1414 1412 1415 if (m_uncommittedChanges & ChildrenChanged) { 1413 1416 updateSublayerList(); … … 2953 2956 } 2954 2957 2958 void GraphicsLayerCA::updateCustomBehavior() 2959 { 2960 m_layer->updateCustomBehavior(m_customBehavior); 2961 } 2962 2955 2963 void GraphicsLayerCA::setShowDebugBorder(bool showBorder) 2956 2964 { … … 3052 3060 GraphicsLayer::setCustomAppearance(customAppearance); 3053 3061 noteLayerPropertyChanged(CustomAppearanceChanged); 3062 } 3063 3064 void GraphicsLayerCA::setCustomBehavior(CustomBehavior customBehavior) 3065 { 3066 if (customBehavior == m_customBehavior) 3067 return; 3068 3069 GraphicsLayer::setCustomBehavior(customBehavior); 3070 noteLayerPropertyChanged(CustomBehaviorChanged); 3054 3071 } 3055 3072 -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
r165676 r166308 139 139 140 140 virtual void setCustomAppearance(CustomAppearance); 141 virtual void setCustomBehavior(CustomBehavior); 141 142 142 143 virtual void layerDidDisplay(PlatformLayer*); … … 390 391 void updateContentsScale(float pageScaleFactor); 391 392 void updateCustomAppearance(); 392 393 void updateCustomBehavior(); 394 393 395 enum StructuralLayerPurpose { 394 396 NoStructuralLayer = 0, … … 448 450 DebugIndicatorsChanged = 1 << 30, 449 451 CustomAppearanceChanged = 1 << 31, 450 BlendModeChanged = 1 << 32 451 }; 452 typedef unsigned LayerChangeFlags; 452 CustomBehaviorChanged = 1 << 32, 453 BlendModeChanged = 1 << 33 454 }; 455 typedef uint64_t LayerChangeFlags; 453 456 enum ScheduleFlushOrNot { ScheduleFlush, DontScheduleFlush }; 454 457 void noteLayerPropertyChanged(LayerChangeFlags, ScheduleFlushOrNot = ScheduleFlush); -
trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h
r165676 r166308 198 198 virtual void updateCustomAppearance(GraphicsLayer::CustomAppearance) = 0; 199 199 200 virtual GraphicsLayer::CustomBehavior customBehavior() const = 0; 201 virtual void updateCustomBehavior(GraphicsLayer::CustomBehavior) = 0; 202 200 203 virtual TiledBacking* tiledBacking() = 0; 201 204 -
trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.h
r165676 r166308 137 137 virtual void updateCustomAppearance(GraphicsLayer::CustomAppearance) override; 138 138 139 virtual GraphicsLayer::CustomBehavior customBehavior() const override { return m_customBehavior; } 140 virtual void updateCustomBehavior(GraphicsLayer::CustomBehavior) override { } 141 139 142 virtual TiledBacking* tiledBacking() override; 140 143 … … 158 161 OwnPtr<PlatformCALayerList> m_customSublayers; 159 162 GraphicsLayer::CustomAppearance m_customAppearance; 163 GraphicsLayer::CustomBehavior m_customBehavior; 160 164 }; 161 165 -
trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm
r165676 r166308 166 166 : PlatformCALayer(layerType, owner) 167 167 , m_customAppearance(GraphicsLayer::NoCustomAppearance) 168 , m_customBehavior(GraphicsLayer::NoCustomBehavior) 168 169 { 169 170 Class layerClass = Nil; … … 206 207 : PlatformCALayer([layer isKindOfClass:getAVPlayerLayerClass()] ? LayerTypeAVPlayerLayer : LayerTypeCustom, owner) 207 208 , m_customAppearance(GraphicsLayer::NoCustomAppearance) 209 , m_customBehavior(GraphicsLayer::NoCustomBehavior) 208 210 { 209 211 m_layer = layer; -
trunk/Source/WebCore/rendering/RenderLayerBacking.cpp
r166304 r166308 1432 1432 m_scrollingLayer->setDrawsContent(false); 1433 1433 m_scrollingLayer->setMasksToBounds(true); 1434 1434 #if PLATFORM(IOS) 1435 m_scrollingLayer->setCustomBehavior(GraphicsLayer::CustomScrollingBehavior); 1436 #endif 1435 1437 // Inner layer which renders the content that scrolls. 1436 1438 m_scrollingContentsLayer = createGraphicsLayer("Scrolled Contents"); -
trunk/Source/WebKit2/ChangeLog
r166301 r166308 1 2014-03-26 Simon Fraser <simon.fraser@apple.com> 2 3 Add a custom behavior flag to GraphicsLayer, piped down to PlatformCALayer, for scrolling layers 4 https://bugs.webkit.org/show_bug.cgi?id=130778 5 6 Reviewed by Tim Horton. 7 8 Make it possible to put a "custom behavior" flag on a layer so that, 9 with UI-side compositing, we know to create a specific type of 10 layer or view for that GraphicsLayer. 11 12 * Shared/mac/RemoteLayerTreeTransaction.h: 13 * Shared/mac/RemoteLayerTreeTransaction.mm: 14 (WebKit::RemoteLayerTreeTransaction::LayerProperties::LayerProperties): 15 (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode): 16 (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode): 17 (WebKit::dumpChangedLayers): 18 * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp: 19 (PlatformCALayerRemote::customBehavior): 20 (PlatformCALayerRemote::updateCustomBehavior): 21 * WebProcess/WebPage/mac/PlatformCALayerRemote.h: 22 1 23 2014-03-26 Zoltan Horvath <zoltan@webkit.org> 2 24 -
trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h
r165652 r166308 76 76 FiltersChanged = 1 << 25, 77 77 EdgeAntialiasingMaskChanged = 1 << 26, 78 CustomAppearanceChanged = 1 << 27 78 CustomAppearanceChanged = 1 << 27, 79 CustomBehaviorChanged = 1 << 28 79 80 }; 80 81 typedef unsigned LayerChange; … … 128 129 unsigned edgeAntialiasingMask; 129 130 WebCore::GraphicsLayer::CustomAppearance customAppearance; 131 WebCore::GraphicsLayer::CustomBehavior customBehavior; 130 132 WebCore::PlatformCALayer::FilterType minificationFilter; 131 133 WebCore::PlatformCALayer::FilterType magnificationFilter; -
trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm
r165863 r166308 88 88 , edgeAntialiasingMask(kCALayerLeftEdge | kCALayerRightEdge | kCALayerBottomEdge | kCALayerTopEdge) 89 89 , customAppearance(GraphicsLayer::NoCustomAppearance) 90 , customBehavior(GraphicsLayer::NoCustomBehavior) 90 91 , minificationFilter(PlatformCALayer::FilterType::Linear) 91 92 , magnificationFilter(PlatformCALayer::FilterType::Linear) … … 117 118 , edgeAntialiasingMask(other.edgeAntialiasingMask) 118 119 , customAppearance(other.customAppearance) 120 , customBehavior(other.customBehavior) 119 121 , minificationFilter(other.minificationFilter) 120 122 , magnificationFilter(other.magnificationFilter) … … 225 227 if (changedProperties & CustomAppearanceChanged) 226 228 encoder.encodeEnum(customAppearance); 229 230 if (changedProperties & CustomBehaviorChanged) 231 encoder.encodeEnum(customBehavior); 227 232 } 228 233 … … 385 390 if (result.changedProperties & CustomAppearanceChanged) { 386 391 if (!decoder.decodeEnum(result.customAppearance)) 392 return false; 393 } 394 395 if (result.changedProperties & CustomBehaviorChanged) { 396 if (!decoder.decodeEnum(result.customBehavior)) 387 397 return false; 388 398 } … … 805 815 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::CustomAppearanceChanged) 806 816 dumpProperty<GraphicsLayer::CustomAppearance>(ts, "customAppearance", layerProperties.customAppearance); 817 818 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::CustomBehaviorChanged) 819 dumpProperty<GraphicsLayer::CustomBehavior>(ts, "customBehavior", layerProperties.customBehavior); 807 820 808 821 ts << ")"; -
trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp
r165863 r166308 564 564 } 565 565 566 GraphicsLayer::CustomBehavior PlatformCALayerRemote::customBehavior() const 567 { 568 return m_properties.customBehavior; 569 } 570 571 void PlatformCALayerRemote::updateCustomBehavior(GraphicsLayer::CustomBehavior customBehavior) 572 { 573 m_properties.customBehavior = customBehavior; 574 m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::CustomBehaviorChanged); 575 } 576 566 577 PassRefPtr<PlatformCALayer> PlatformCALayerRemote::createCompatibleLayer(PlatformCALayer::LayerType layerType, PlatformCALayerClient* client) const 567 578 { -
trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h
r165676 r166308 139 139 virtual void updateCustomAppearance(WebCore::GraphicsLayer::CustomAppearance) override; 140 140 141 virtual WebCore::GraphicsLayer::CustomBehavior customBehavior() const override; 142 virtual void updateCustomBehavior(WebCore::GraphicsLayer::CustomBehavior) override; 143 141 144 virtual WebCore::TiledBacking* tiledBacking() override { return nullptr; } 142 145
Note:
See TracChangeset
for help on using the changeset viewer.