Changeset 160672 in webkit
- Timestamp:
- Dec 16, 2013, 4:13:38 PM (11 years ago)
- Location:
- trunk/Source
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r160671 r160672 1 2013-12-16 Simon Fraser <simon.fraser@apple.com> 2 3 Apply overhang shadow and linen to UI-side layers 4 https://bugs.webkit.org/show_bug.cgi?id=125807 5 6 Reviewed by Tim Horton. 7 8 With UI-side compositing, we need to apply the overhang shadow and linen 9 background to layers in the UI process. Achieve this by setting a "custom 10 appearance" flag on layers that need a shadow or linen background, and 11 migrating this flag to the UI process. Static functions on ScrollbarThemeMac 12 are exposed to do the actual setting. 13 14 * WebCore.exp.in: Export ScrollbarThemeMac and GraphicsLayerCA functions. 15 * WebCore.xcodeproj/project.pbxproj: ScrollbarThemeMac.h and ScrollbarThemeComposite.h 16 need to be Private. 17 * platform/graphics/GraphicsLayer.cpp: Initialize m_customAppearance. 18 (WebCore::GraphicsLayer::GraphicsLayer): 19 * platform/graphics/GraphicsLayer.h: Getter/setter for CustomAppearance. 20 (WebCore::GraphicsLayer::setCustomAppearance): 21 (WebCore::GraphicsLayer::customAppearance): 22 * platform/graphics/ca/GraphicsLayerCA.cpp: Update CustomAppearanceChanged as 23 we do other properties. 24 (WebCore::GraphicsLayerCA::commitLayerChangesBeforeSublayers): 25 (WebCore::GraphicsLayerCA::updateCustomAppearance): 26 (WebCore::GraphicsLayerCA::setCustomAppearance): 27 * platform/graphics/ca/GraphicsLayerCA.h: 28 * platform/graphics/ca/PlatformCALayer.h: 29 * platform/graphics/ca/mac/PlatformCALayerMac.h: 30 * platform/graphics/ca/mac/PlatformCALayerMac.mm: When we have a custom 31 appearance, use ScrollbarThemeMac functions to update the layer. Ensure 32 that if the bounds change, we update the shadow (whose path depends on the bounds). 33 (PlatformCALayerMac::PlatformCALayerMac): 34 (PlatformCALayerMac::clone): 35 (PlatformCALayerMac::setBounds): 36 (PlatformCALayerMac::requiresCustomAppearanceUpdateOnBoundsChange): 37 (PlatformCALayerMac::updateCustomAppearance): 38 * platform/mac/ScrollbarThemeMac.h: Export some static functions. 39 * platform/mac/ScrollbarThemeMac.mm: Change code to use static functions. 40 (WebCore::ScrollbarThemeMac::setUpOverhangAreaBackground): 41 (WebCore::ScrollbarThemeMac::removeOverhangAreaBackground): 42 (WebCore::ScrollbarThemeMac::setUpOverhangAreaShadow): 43 (WebCore::ScrollbarThemeMac::removeOverhangAreaShadow): 44 (WebCore::ScrollbarThemeMac::setUpOverhangAreasLayerContents): 45 (WebCore::ScrollbarThemeMac::setUpContentShadowLayer): 46 * rendering/RenderLayerCompositor.cpp: 47 (WebCore::RenderLayerCompositor::updateRootLayerPosition): No need to call 48 setUpContentShadowLayer() now when size changes; PlatformCALayer takes 49 care of that. 50 (WebCore::RenderLayerCompositor::updateOverflowControlsLayers): Now set 51 custom appearance via GraphicsLayer. 52 1 53 2013-12-16 Brent Fulgham <bfulgham@apple.com> 2 54 -
trunk/Source/WebCore/WebCore.exp.in
r160520 r160672 404 404 __ZN7WebCore14ScrollableAreaD2Ev 405 405 __ZN7WebCore14ScrollbarTheme5themeEv 406 __ZN7WebCore17ScrollbarThemeMac28removeOverhangAreaBackgroundEP7CALayer 407 __ZN7WebCore17ScrollbarThemeMac24removeOverhangAreaShadowEP7CALayer 408 __ZN7WebCore17ScrollbarThemeMac27setUpOverhangAreaBackgroundEP7CALayerRKNS_5ColorE 409 __ZN7WebCore17ScrollbarThemeMac23setUpOverhangAreaShadowEP7CALayer 406 410 __ZN7WebCore14SecurityOrigin16createFromStringERKN3WTF6StringE 407 411 __ZN7WebCore14SecurityOrigin28createFromDatabaseIdentifierERKN3WTF6StringE … … 567 571 __ZN7WebCore15GraphicsLayerCAC2EPNS_19GraphicsLayerClientE 568 572 __ZN7WebCore15GraphicsLayerCAD2Ev 573 __ZN7WebCore15GraphicsLayerCA19setCustomAppearanceENS_13GraphicsLayer16CustomAppearanceE 569 574 __ZN7WebCore15HitTestLocation12rectForPointERKNS_11LayoutPointEjjjj 570 575 __ZN7WebCore15JSDOMWindowBase8commonVMEv -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r160606 r160672 4755 4755 BC128B01137C8D4600CAC845 /* RenderGrid.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC128B00137C8D4600CAC845 /* RenderGrid.cpp */; }; 4756 4756 BC14028A0E83680800319717 /* ScrollbarThemeComposite.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC1402880E83680800319717 /* ScrollbarThemeComposite.cpp */; }; 4757 BC14028B0E83680800319717 /* ScrollbarThemeComposite.h in Headers */ = {isa = PBXBuildFile; fileRef = BC1402890E83680800319717 /* ScrollbarThemeComposite.h */; };4757 BC14028B0E83680800319717 /* ScrollbarThemeComposite.h in Headers */ = {isa = PBXBuildFile; fileRef = BC1402890E83680800319717 /* ScrollbarThemeComposite.h */; settings = {ATTRIBUTES = (Private, ); }; }; 4758 4758 BC17F9660B64EBB8004A65CB /* JSHTMLSelectElementCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC17F9650B64EBB8004A65CB /* JSHTMLSelectElementCustom.cpp */; }; 4759 4759 BC1A37AD097C715F0019F3D8 /* DOM.h in Headers */ = {isa = PBXBuildFile; fileRef = BC1A3797097C715F0019F3D8 /* DOM.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 4977 4977 BC8AE34E12EA096A00EB3AE6 /* ScrollableArea.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC8AE34C12EA096A00EB3AE6 /* ScrollableArea.cpp */; }; 4978 4978 BC8AE34F12EA096A00EB3AE6 /* ScrollableArea.h in Headers */ = {isa = PBXBuildFile; fileRef = BC8AE34D12EA096A00EB3AE6 /* ScrollableArea.h */; settings = {ATTRIBUTES = (Private, ); }; }; 4979 BC8B853E0E7C7F1100AB6984 /* ScrollbarThemeMac.h in Headers */ = {isa = PBXBuildFile; fileRef = BC8B853C0E7C7F1100AB6984 /* ScrollbarThemeMac.h */; };4979 BC8B853E0E7C7F1100AB6984 /* ScrollbarThemeMac.h in Headers */ = {isa = PBXBuildFile; fileRef = BC8B853C0E7C7F1100AB6984 /* ScrollbarThemeMac.h */; settings = {ATTRIBUTES = (Private, ); }; }; 4980 4980 BC8B854B0E7C7F5600AB6984 /* ScrollbarTheme.h in Headers */ = {isa = PBXBuildFile; fileRef = BC8B854A0E7C7F5600AB6984 /* ScrollbarTheme.h */; settings = {ATTRIBUTES = (Private, ); }; }; 4981 4981 BC8BF151105813BF00A40A07 /* UserStyleSheet.h in Headers */ = {isa = PBXBuildFile; fileRef = BC8BF150105813BF00A40A07 /* UserStyleSheet.h */; settings = {ATTRIBUTES = (Private, ); }; }; -
trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp
r158183 r160672 98 98 , m_replicatedLayer(0) 99 99 , m_repaintCount(0) 100 , m_customAppearance(NoCustomAppearance) 100 101 { 101 102 #ifndef NDEBUG -
trunk/Source/WebCore/platform/graphics/GraphicsLayer.h
r158183 r160672 422 422 virtual void setDebugBorder(const Color&, float /*borderWidth*/) { } 423 423 424 enum CustomAppearance { NoCustomAppearance, ScrollingOverhang, ScrollingShadow }; 425 virtual void setCustomAppearance(CustomAppearance customAppearance) { m_customAppearance = customAppearance; } 426 CustomAppearance customAppearance() const { return m_customAppearance; } 427 424 428 // z-position is the z-equivalent of position(). It's only used for debugging purposes. 425 429 virtual float zPosition() const { return m_zPosition; } … … 578 582 579 583 int m_repaintCount; 584 CustomAppearance m_customAppearance; 580 585 }; 581 586 -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp
r159463 r160672 1366 1366 updateDebugBorder(); 1367 1367 1368 if (m_uncommittedChanges & CustomAppearanceChanged) 1369 updateCustomAppearance(); 1370 1368 1371 if (m_uncommittedChanges & ChildrenChanged) { 1369 1372 updateSublayerList(); … … 2844 2847 } 2845 2848 2849 void GraphicsLayerCA::updateCustomAppearance() 2850 { 2851 m_layer->updateCustomAppearance(m_customAppearance); 2852 } 2853 2846 2854 void GraphicsLayerCA::setShowDebugBorder(bool showBorder) 2847 2855 { … … 2934 2942 m_layer->setBorderWidth(0); 2935 2943 } 2944 } 2945 2946 void GraphicsLayerCA::setCustomAppearance(CustomAppearance customAppearance) 2947 { 2948 if (customAppearance == m_customAppearance) 2949 return; 2950 2951 GraphicsLayer::setCustomAppearance(customAppearance); 2952 noteLayerPropertyChanged(CustomAppearanceChanged); 2936 2953 } 2937 2954 -
trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h
r159463 r160672 131 131 virtual void setDebugBorder(const Color&, float borderWidth); 132 132 133 virtual void setCustomAppearance(CustomAppearance); 134 133 135 virtual void layerDidDisplay(PlatformLayer*); 134 136 … … 367 369 void updateTiles(); 368 370 void updateContentsScale(float pageScaleFactor); 371 void updateCustomAppearance(); 369 372 370 373 enum StructuralLayerPurpose { … … 423 426 TilingAreaChanged = 1 << 28, 424 427 TilesAdded = 1 < 29, 425 DebugIndicatorsChanged = 1 << 30 428 DebugIndicatorsChanged = 1 << 30, 429 CustomAppearanceChanged = 1 << 31 426 430 }; 427 431 typedef unsigned LayerChangeFlags; -
trunk/Source/WebCore/platform/graphics/ca/PlatformCALayer.h
r158982 r160672 187 187 188 188 virtual void setEdgeAntialiasingMask(unsigned) = 0; 189 190 virtual GraphicsLayer::CustomAppearance customAppearance() const = 0; 191 virtual void updateCustomAppearance(GraphicsLayer::CustomAppearance) = 0; 189 192 190 193 virtual TiledBacking* tiledBacking() = 0; -
trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.h
r158982 r160672 136 136 virtual void setEdgeAntialiasingMask(unsigned) OVERRIDE; 137 137 138 virtual GraphicsLayer::CustomAppearance customAppearance() const OVERRIDE { return m_customAppearance; } 139 virtual void updateCustomAppearance(GraphicsLayer::CustomAppearance) OVERRIDE; 140 138 141 virtual TiledBacking* tiledBacking() OVERRIDE; 139 142 … … 147 150 PlatformCALayerMac(LayerType, PlatformLayer*, PlatformCALayerClient* owner); 148 151 152 bool requiresCustomAppearanceUpdateOnBoundsChange() const; 153 149 154 RetainPtr<NSObject> m_delegate; 150 155 OwnPtr<PlatformCALayerList> m_customSublayers; 156 GraphicsLayer::CustomAppearance m_customAppearance; 151 157 }; 152 158 -
trunk/Source/WebCore/platform/graphics/ca/mac/PlatformCALayerMac.mm
r158982 r160672 36 36 #import "LengthFunctions.h" 37 37 #import "PlatformCAFilters.h" 38 #import "ScrollbarThemeMac.h" 38 39 #import "SoftLinking.h" 39 40 #import "TiledBacking.h" … … 179 180 PlatformCALayerMac::PlatformCALayerMac(LayerType layerType, PlatformLayer* layer, PlatformCALayerClient* owner) 180 181 : PlatformCALayer(layer ? LayerTypeCustom : layerType, owner) 182 , m_customAppearance(GraphicsLayer::NoCustomAppearance) 181 183 { 182 184 BEGIN_BLOCK_OBJC_EXCEPTIONS … … 273 275 newLayer->copyFiltersFrom(this); 274 276 #endif 277 newLayer->updateCustomAppearance(customAppearance()); 275 278 276 279 if (type == LayerTypeAVPlayerLayer) { … … 451 454 BEGIN_BLOCK_OBJC_EXCEPTIONS 452 455 [m_layer.get() setBounds:value]; 456 457 if (requiresCustomAppearanceUpdateOnBoundsChange()) 458 updateCustomAppearance(m_customAppearance); 459 453 460 END_BLOCK_OBJC_EXCEPTIONS 454 461 } … … 723 730 } 724 731 732 bool PlatformCALayerMac::requiresCustomAppearanceUpdateOnBoundsChange() const 733 { 734 return m_customAppearance == GraphicsLayer::ScrollingShadow; 735 } 736 737 void PlatformCALayerMac::updateCustomAppearance(GraphicsLayer::CustomAppearance appearance) 738 { 739 m_customAppearance = appearance; 740 741 switch (appearance) { 742 case GraphicsLayer::NoCustomAppearance: 743 ScrollbarThemeMac::removeOverhangAreaBackground(platformLayer()); 744 ScrollbarThemeMac::removeOverhangAreaShadow(platformLayer()); 745 break; 746 case GraphicsLayer::ScrollingOverhang: 747 ScrollbarThemeMac::setUpOverhangAreaBackground(platformLayer()); 748 break; 749 case GraphicsLayer::ScrollingShadow: 750 ScrollbarThemeMac::setUpOverhangAreaShadow(platformLayer()); 751 break; 752 } 753 } 754 725 755 TiledBacking* PlatformCALayerMac::tiledBacking() 726 756 { -
trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.h
r157253 r160672 65 65 static void setIsCurrentlyDrawingIntoLayer(bool); 66 66 67 #if USE(ACCELERATED_COMPOSITING) && ENABLE(RUBBER_BANDING) 68 static void setUpOverhangAreaBackground(CALayer *, const Color& customBackgroundColor = Color()); 69 static void removeOverhangAreaBackground(CALayer *); 70 71 static void setUpOverhangAreaShadow(CALayer *); 72 static void removeOverhangAreaShadow(CALayer *); 73 #endif 74 67 75 protected: 68 76 virtual bool hasButtons(ScrollbarThemeClient*); -
trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.mm
r160335 r160672 531 531 } 532 532 533 void ScrollbarThemeMac::setUpOverhangArea sLayerContents(GraphicsLayer* graphicsLayer, const Color& backgroundColor)533 void ScrollbarThemeMac::setUpOverhangAreaBackground(CALayer *layer, const Color& customBackgroundColor) 534 534 { 535 535 static CGColorRef cachedLinenBackgroundColor = linenBackgroundColor().leakRef(); 536 536 // We operate on the CALayer directly here, since GraphicsLayer doesn't have the concept 537 537 // of pattern images, and we know that WebCore won't touch this layer. 538 graphicsLayer->platformLayer().backgroundColor = backgroundColor.isValid() ? cachedCGColor(backgroundColor, ColorSpaceDeviceRGB) : cachedLinenBackgroundColor; 538 layer.backgroundColor = customBackgroundColor.isValid() ? cachedCGColor(customBackgroundColor, ColorSpaceDeviceRGB) : cachedLinenBackgroundColor; 539 } 540 541 void ScrollbarThemeMac::removeOverhangAreaBackground(CALayer *layer) 542 { 543 layer.backgroundColor = nil; 544 } 545 546 void ScrollbarThemeMac::setUpOverhangAreaShadow(CALayer *layer) 547 { 548 static const CGFloat shadowOpacity = 0.66; 549 static const CGFloat shadowRadius = 3; 550 551 // We only need to set these shadow properties once. 552 if (!layer.shadowOpacity) { 553 layer.shadowColor = CGColorGetConstantColor(kCGColorBlack); 554 layer.shadowOffset = CGSizeZero; 555 layer.shadowOpacity = shadowOpacity; 556 layer.shadowRadius = shadowRadius; 557 } 558 559 RetainPtr<CGPathRef> shadowPath = adoptCF(CGPathCreateWithRect(layer.bounds, NULL)); 560 layer.shadowPath = shadowPath.get(); 561 } 562 563 void ScrollbarThemeMac::removeOverhangAreaShadow(CALayer *layer) 564 { 565 layer.shadowPath = nil; 566 layer.shadowOpacity = 0; 567 } 568 569 void ScrollbarThemeMac::setUpOverhangAreasLayerContents(GraphicsLayer* graphicsLayer, const Color& customBackgroundColor) 570 { 571 ScrollbarThemeMac::setUpOverhangAreaBackground(graphicsLayer->platformLayer(), customBackgroundColor); 539 572 } 540 573 … … 543 576 // We operate on the CALayer directly here, since GraphicsLayer doesn't have the concept 544 577 // of shadows, and we know that WebCore won't touch this layer. 545 CALayer *contentShadowLayer = graphicsLayer->platformLayer(); 546 547 static const CGFloat shadowOpacity = 0.66; 548 static const CGFloat shadowRadius = 3; 549 550 // We only need to set these shadow properties once. 551 if (!contentShadowLayer.shadowOpacity) { 552 contentShadowLayer.shadowColor = CGColorGetConstantColor(kCGColorBlack); 553 contentShadowLayer.shadowOffset = CGSizeZero; 554 contentShadowLayer.shadowOpacity = shadowOpacity; 555 contentShadowLayer.shadowRadius = shadowRadius; 556 } 557 558 RetainPtr<CGPathRef> shadowPath = adoptCF(CGPathCreateWithRect(CGRectMake(0, 0, graphicsLayer->size().width(), graphicsLayer->size().height()), NULL)); 559 contentShadowLayer.shadowPath = shadowPath.get(); 578 setUpOverhangAreaShadow(graphicsLayer->platformLayer()); 560 579 } 561 580 -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r160236 r160672 56 56 #include "RenderVideo.h" 57 57 #include "RenderView.h" 58 #include "ScrollbarTheme.h"59 58 #include "ScrollingConstraints.h" 60 59 #include "ScrollingCoordinator.h" … … 1843 1842 if (m_contentShadowLayer) { 1844 1843 m_contentShadowLayer->setPosition(m_rootContentLayer->position()); 1845 1846 FloatSize rootContentLayerSize = m_rootContentLayer->size(); 1847 if (m_contentShadowLayer->size() != rootContentLayerSize) { 1848 m_contentShadowLayer->setSize(rootContentLayerSize); 1849 ScrollbarTheme::theme()->setUpContentShadowLayer(m_contentShadowLayer.get()); 1850 } 1844 m_contentShadowLayer->setSize(m_rootContentLayer->size()); 1851 1845 } 1852 1846 … … 2934 2928 m_layerForOverhangAreas->setDrawsContent(false); 2935 2929 m_layerForOverhangAreas->setSize(m_renderView.frameView().frameRect().size()); 2936 2937 ScrollbarTheme::theme()->setUpOverhangAreasLayerContents(m_layerForOverhangAreas.get(), this->page()->chrome().client().underlayColor()); 2930 m_layerForOverhangAreas->setCustomAppearance(GraphicsLayer::ScrollingOverhang); 2938 2931 2939 2932 // We want the overhang areas layer to be positioned below the frame contents, … … 2954 2947 m_contentShadowLayer->setSize(m_rootContentLayer->size()); 2955 2948 m_contentShadowLayer->setPosition(m_rootContentLayer->position()); 2956 ScrollbarTheme::theme()->setUpContentShadowLayer(m_contentShadowLayer.get());2949 m_contentShadowLayer->setCustomAppearance(GraphicsLayer::ScrollingShadow); 2957 2950 2958 2951 m_scrollLayer->addChildBelow(m_contentShadowLayer.get(), m_rootContentLayer.get()); -
trunk/Source/WebKit2/ChangeLog
r160667 r160672 1 2013-12-16 Simon Fraser <simon.fraser@apple.com> 2 3 Apply overhang shadow and linen to UI-side layers 4 https://bugs.webkit.org/show_bug.cgi?id=125807 5 6 Reviewed by Tim Horton. 7 8 With UI-side compositing, we need to apply the overhang shadow and linen 9 background to layers in the UI process. Achieve this by setting a "custom 10 appearance" flag on layers that need a shadow or linen background, and 11 migrating this flag to the UI process. Static functions on ScrollbarThemeMac 12 are exposed to do the actual setting. 13 14 * Shared/mac/RemoteLayerTreePropertyApplier.mm: 15 (WebKit::updateCustomAppearance): Use ScrollbarThemeMac to update the 16 appearance. 17 (WebKit::RemoteLayerTreePropertyApplier::applyPropertiesToLayer): 18 * Shared/mac/RemoteLayerTreeTransaction.h: 19 * Shared/mac/RemoteLayerTreeTransaction.mm: 20 (WebKit::RemoteLayerTreeTransaction::LayerProperties::encode): 21 (WebKit::RemoteLayerTreeTransaction::LayerProperties::decode): 22 (WebKit::dumpChangedLayers): 23 * WebProcess/WebPage/mac/PlatformCALayerRemote.cpp: 24 (PlatformCALayerRemote::setBounds): If the bounds change, also set the 25 CustomAppearanceChanged bit so that the UI side updates the shadow bounds 26 (done here because the UI side is not stateful). 27 (PlatformCALayerRemote::requiresCustomAppearanceUpdateOnBoundsChange): 28 (PlatformCALayerRemote::customAppearance): 29 (PlatformCALayerRemote::updateCustomAppearance): 30 * WebProcess/WebPage/mac/PlatformCALayerRemote.h: 31 1 32 2013-12-16 Brady Eidson <beidson@apple.com> 2 33 -
trunk/Source/WebKit2/Shared/mac/RemoteLayerTreePropertyApplier.mm
r159985 r160672 30 30 #import <QuartzCore/CALayer.h> 31 31 #import <WebCore/PlatformCAFilters.h> 32 #import <WebCore/ScrollbarThemeMac.h> 32 33 33 34 using namespace WebCore; … … 59 60 } 60 61 62 static void updateCustomAppearance(CALayer *layer, GraphicsLayer::CustomAppearance customAppearance) 63 { 64 switch (customAppearance) { 65 case GraphicsLayer::NoCustomAppearance: 66 ScrollbarThemeMac::removeOverhangAreaBackground(layer); 67 ScrollbarThemeMac::removeOverhangAreaShadow(layer); 68 break; 69 case GraphicsLayer::ScrollingOverhang: 70 ScrollbarThemeMac::setUpOverhangAreaBackground(layer); 71 break; 72 case GraphicsLayer::ScrollingShadow: 73 ScrollbarThemeMac::setUpOverhangAreaShadow(layer); 74 break; 75 } 76 } 77 61 78 void RemoteLayerTreePropertyApplier::applyPropertiesToLayer(CALayer *layer, RemoteLayerTreeTransaction::LayerProperties properties, RelatedLayerMap relatedLayers) 62 79 { … … 162 179 if (properties.changedProperties & RemoteLayerTreeTransaction::EdgeAntialiasingMaskChanged) 163 180 layer.edgeAntialiasingMask = properties.edgeAntialiasingMask; 181 182 if (properties.changedProperties & RemoteLayerTreeTransaction::CustomAppearanceChanged) 183 updateCustomAppearance(layer, properties.customAppearance); 164 184 } 165 185 -
trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h
r159967 r160672 77 77 BackingStoreChanged = 1 << 24, 78 78 FiltersChanged = 1 << 25, 79 EdgeAntialiasingMaskChanged = 1 << 26 79 EdgeAntialiasingMaskChanged = 1 << 26, 80 CustomAppearanceChanged = 1 << 27 80 81 }; 81 82 … … 133 134 WebCore::FilterOperations filters; 134 135 unsigned edgeAntialiasingMask; 136 WebCore::GraphicsLayer::CustomAppearance customAppearance; 135 137 }; 136 138 -
trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm
r159967 r160672 156 156 if (changedProperties & EdgeAntialiasingMaskChanged) 157 157 encoder << edgeAntialiasingMask; 158 159 if (changedProperties & CustomAppearanceChanged) 160 encoder.encodeEnum(customAppearance); 158 161 } 159 162 … … 295 298 if (result.changedProperties & EdgeAntialiasingMaskChanged) { 296 299 if (!decoder.decode(result.edgeAntialiasingMask)) 300 return false; 301 } 302 303 if (result.changedProperties & CustomAppearanceChanged) { 304 if (!decoder.decodeEnum(result.customAppearance)) 297 305 return false; 298 306 } … … 640 648 dumpProperty<unsigned>(ts, "edgeAntialiasingMask", layerProperties.edgeAntialiasingMask); 641 649 650 if (layerProperties.changedProperties & RemoteLayerTreeTransaction::CustomAppearanceChanged) 651 dumpProperty<GraphicsLayer::CustomAppearance>(ts, "customAppearance", layerProperties.customAppearance); 652 642 653 ts << ")"; 643 654 -
trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.cpp
r159967 r160672 305 305 m_properties.size = value.size(); 306 306 m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::SizeChanged); 307 308 if (requiresCustomAppearanceUpdateOnBoundsChange()) 309 m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::CustomAppearanceChanged); 307 310 308 311 ensureBackingStore(); … … 514 517 } 515 518 519 bool PlatformCALayerRemote::requiresCustomAppearanceUpdateOnBoundsChange() const 520 { 521 return m_properties.customAppearance == GraphicsLayer::ScrollingShadow; 522 } 523 524 GraphicsLayer::CustomAppearance PlatformCALayerRemote::customAppearance() const 525 { 526 return m_properties.customAppearance; 527 } 528 529 void PlatformCALayerRemote::updateCustomAppearance(GraphicsLayer::CustomAppearance customAppearance) 530 { 531 m_properties.customAppearance = customAppearance; 532 m_properties.notePropertiesChanged(RemoteLayerTreeTransaction::CustomAppearanceChanged); 533 } 534 516 535 PassRefPtr<PlatformCALayer> PlatformCALayerRemote::createCompatibleLayer(PlatformCALayer::LayerType layerType, PlatformCALayerClient* client) const 517 536 { -
trunk/Source/WebKit2/WebProcess/WebPage/mac/PlatformCALayerRemote.h
r159967 r160672 141 141 virtual void setEdgeAntialiasingMask(unsigned) OVERRIDE; 142 142 143 virtual WebCore::GraphicsLayer::CustomAppearance customAppearance() const OVERRIDE; 144 virtual void updateCustomAppearance(WebCore::GraphicsLayer::CustomAppearance) OVERRIDE; 145 143 146 virtual WebCore::TiledBacking* tiledBacking() OVERRIDE { return nullptr; } 144 147 … … 158 161 void removeSublayer(PlatformCALayerRemote*); 159 162 163 bool requiresCustomAppearanceUpdateOnBoundsChange() const; 164 160 165 RemoteLayerTreeTransaction::LayerID m_layerID; 161 166 RemoteLayerTreeTransaction::LayerProperties m_properties;
Note:
See TracChangeset
for help on using the changeset viewer.