Changeset 202725 in webkit
- Timestamp:
- Jun 30, 2016 11:58:29 PM (8 years ago)
- Location:
- trunk/Source
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r202719 r202725 1 2016-07-01 Andreas Kling <akling@apple.com> 2 3 [Mac] Get rid of the old timey rubber-banding linen pattern. 4 <https://webkit.org/b/159329> 5 6 Reviewed by Benjamin Poulain. 7 8 Remove the "ScrollingOverhang" custom GraphicsLayer appearance since that was only used to 9 install the old timey linen pattern behind the web content. 10 11 We now always just set the overhang area's background color to the document background color. 12 13 This fixes an issue where we could end up loading the linen pattern and keeping it in memory 14 despite never actually showing it on screen. 15 16 * platform/ScrollbarTheme.h: 17 (WebCore::ScrollbarTheme::setUpOverhangAreasLayerContents): Deleted. 18 * platform/graphics/GraphicsLayer.cpp: 19 * platform/graphics/GraphicsLayer.h: 20 * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm: 21 (PlatformCALayerCocoa::updateCustomAppearance): 22 * platform/mac/ScrollbarThemeMac.h: 23 * platform/mac/ScrollbarThemeMac.mm: 24 (WebCore::linenBackgroundColor): Deleted. 25 (WebCore::ScrollbarThemeMac::setUpOverhangAreaBackground): Deleted. 26 (WebCore::ScrollbarThemeMac::removeOverhangAreaBackground): Deleted. 27 (WebCore::ScrollbarThemeMac::setUpOverhangAreasLayerContents): Deleted. 28 * rendering/RenderLayerCompositor.cpp: 29 (WebCore::RenderLayerCompositor::updateOverflowControlsLayers): 30 (WebCore::RenderLayerCompositor::setRootExtendedBackgroundColor): 31 1 32 2016-06-30 Jiewen Tan <jiewen_tan@apple.com> 2 33 -
trunk/Source/WebCore/platform/ScrollbarTheme.h
r196632 r202725 92 92 93 93 #if ENABLE(RUBBER_BANDING) 94 virtual void setUpOverhangAreasLayerContents(GraphicsLayer*, const Color&) { }95 94 virtual void setUpContentShadowLayer(GraphicsLayer*) { } 96 95 #endif -
trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp
r201901 r202725 895 895 switch (customAppearance) { 896 896 case GraphicsLayer::CustomAppearance::NoCustomAppearance: ts << "none"; break; 897 case GraphicsLayer::CustomAppearance::ScrollingOverhang: ts << "scrolling-overhang"; break;898 897 case GraphicsLayer::CustomAppearance::ScrollingShadow: ts << "scrolling-shadow"; break; 899 898 case GraphicsLayer::CustomAppearance::LightBackdropAppearance: ts << "light-backdrop"; break; -
trunk/Source/WebCore/platform/graphics/GraphicsLayer.h
r201901 r202725 482 482 virtual void setDebugBorder(const Color&, float /*borderWidth*/) { } 483 483 484 enum CustomAppearance { NoCustomAppearance, Scrolling Overhang, ScrollingShadow, LightBackdropAppearance, DarkBackdropAppearance };484 enum CustomAppearance { NoCustomAppearance, ScrollingShadow, LightBackdropAppearance, DarkBackdropAppearance }; 485 485 virtual void setCustomAppearance(CustomAppearance customAppearance) { m_customAppearance = customAppearance; } 486 486 CustomAppearance customAppearance() const { return m_customAppearance; } -
trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm
r201901 r202725 952 952 case GraphicsLayer::LightBackdropAppearance: 953 953 case GraphicsLayer::DarkBackdropAppearance: 954 ScrollbarThemeMac::removeOverhangAreaBackground(platformLayer());955 954 ScrollbarThemeMac::removeOverhangAreaShadow(platformLayer()); 956 break;957 case GraphicsLayer::ScrollingOverhang:958 ScrollbarThemeMac::setUpOverhangAreaBackground(platformLayer());959 955 break; 960 956 case GraphicsLayer::ScrollingShadow: -
trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.h
r198859 r202725 69 69 70 70 #if ENABLE(RUBBER_BANDING) 71 WEBCORE_EXPORT static void setUpOverhangAreaBackground(CALayer *, const Color& customBackgroundColor = Color());72 WEBCORE_EXPORT static void removeOverhangAreaBackground(CALayer *);73 74 71 WEBCORE_EXPORT static void setUpOverhangAreaShadow(CALayer *); 75 72 WEBCORE_EXPORT static void removeOverhangAreaShadow(CALayer *); … … 93 90 94 91 #if ENABLE(RUBBER_BANDING) 95 void setUpOverhangAreasLayerContents(GraphicsLayer*, const Color&) override;96 92 void setUpContentShadowLayer(GraphicsLayer*) override; 97 93 #endif -
trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.mm
r201038 r202725 48 48 using namespace WebCore; 49 49 50 @interface NSColor (WebNSColorDetails)51 + (NSImage *)_linenPatternImage;52 @end53 54 50 namespace WebCore { 55 51 … … 565 561 566 562 #if ENABLE(RUBBER_BANDING) 567 static RetainPtr<CGColorRef> linenBackgroundColor()568 {569 NSImage *image = nil;570 CGImageRef cgImage = nullptr;571 BEGIN_BLOCK_OBJC_EXCEPTIONS;572 image = [NSColor _linenPatternImage];573 cgImage = [image CGImageForProposedRect:NULL context:NULL hints:nil];574 END_BLOCK_OBJC_EXCEPTIONS;575 576 if (!cgImage)577 return nullptr;578 579 RetainPtr<CGPatternRef> pattern = adoptCF(wkCGPatternCreateWithImageAndTransform(cgImage, CGAffineTransformIdentity, wkPatternTilingNoDistortion));580 RetainPtr<CGColorSpaceRef> colorSpace = adoptCF(CGColorSpaceCreatePattern(0));581 582 const CGFloat alpha = 1.0;583 return adoptCF(CGColorCreateWithPattern(colorSpace.get(), pattern.get(), &alpha));584 }585 586 void ScrollbarThemeMac::setUpOverhangAreaBackground(CALayer *layer, const Color& customBackgroundColor)587 {588 static CGColorRef cachedLinenBackgroundColor = linenBackgroundColor().leakRef();589 // We operate on the CALayer directly here, since GraphicsLayer doesn't have the concept590 // of pattern images, and we know that WebCore won't touch this layer.591 layer.backgroundColor = customBackgroundColor.isValid() ? cachedCGColor(customBackgroundColor) : cachedLinenBackgroundColor;592 }593 594 void ScrollbarThemeMac::removeOverhangAreaBackground(CALayer *layer)595 {596 layer.backgroundColor = nil;597 }598 599 563 void ScrollbarThemeMac::setUpOverhangAreaShadow(CALayer *layer) 600 564 { … … 620 584 } 621 585 622 void ScrollbarThemeMac::setUpOverhangAreasLayerContents(GraphicsLayer* graphicsLayer, const Color& customBackgroundColor)623 {624 ScrollbarThemeMac::setUpOverhangAreaBackground(graphicsLayer->platformLayer(), customBackgroundColor);625 }626 627 586 void ScrollbarThemeMac::setUpContentShadowLayer(GraphicsLayer* graphicsLayer) 628 587 { -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r200116 r202725 3271 3271 3272 3272 m_layerForOverhangAreas->setBackgroundColor(m_rootExtendedBackgroundColor); 3273 3274 if (!m_rootExtendedBackgroundColor.isValid())3275 m_layerForOverhangAreas->setCustomAppearance(GraphicsLayer::ScrollingOverhang);3276 3273 #endif 3277 3274 } … … 3294 3291 m_layerForOverhangAreas->setPosition(FloatPoint(0, topContentInset)); 3295 3292 m_layerForOverhangAreas->setAnchorPoint(FloatPoint3D()); 3296 3297 if (m_renderView.frameView().frame().settings().backgroundShouldExtendBeyondPage()) 3298 m_layerForOverhangAreas->setBackgroundColor(m_renderView.frameView().documentBackgroundColor()); 3299 else 3300 m_layerForOverhangAreas->setCustomAppearance(GraphicsLayer::ScrollingOverhang); 3293 m_layerForOverhangAreas->setBackgroundColor(m_renderView.frameView().documentBackgroundColor()); 3301 3294 3302 3295 // We want the overhang areas layer to be positioned below the frame contents, -
trunk/Source/WebKit2/ChangeLog
r202724 r202725 1 2016-07-01 Andreas Kling <akling@apple.com> 2 3 [Mac] Get rid of the old timey rubber-banding linen pattern. 4 <https://webkit.org/b/159329> 5 6 Reviewed by Benjamin Poulain. 7 8 * Shared/mac/RemoteLayerTreePropertyApplier.mm: 9 (WebKit::updateCustomAppearance): 10 1 11 2016-06-30 Tina Liu <iting_liu@apple.com> 2 12 -
trunk/Source/WebKit2/Shared/mac/RemoteLayerTreePropertyApplier.mm
r201901 r202725 112 112 case GraphicsLayer::DarkBackdropAppearance: 113 113 case GraphicsLayer::LightBackdropAppearance: 114 ScrollbarThemeMac::removeOverhangAreaBackground(layer);115 114 ScrollbarThemeMac::removeOverhangAreaShadow(layer); 116 break;117 case GraphicsLayer::ScrollingOverhang:118 ScrollbarThemeMac::setUpOverhangAreaBackground(layer);119 115 break; 120 116 case GraphicsLayer::ScrollingShadow:
Note: See TracChangeset
for help on using the changeset viewer.