Changeset 202858 in webkit


Ignore:
Timestamp:
Jul 6, 2016 9:57:25 AM (8 years ago)
Author:
commit-queue@webkit.org
Message:

Unreviewed, rolling out r202725.
https://bugs.webkit.org/show_bug.cgi?id=159473

didn't reduce coreui memory usage (Requested by kling on
#webkit).

Reverted changeset:

"[Mac] Get rid of the old timey rubber-banding linen pattern."
https://bugs.webkit.org/show_bug.cgi?id=159329
http://trac.webkit.org/changeset/202725

Location:
trunk/Source
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r202857 r202858  
     12016-07-06  Commit Queue  <commit-queue@webkit.org>
     2
     3        Unreviewed, rolling out r202725.
     4        https://bugs.webkit.org/show_bug.cgi?id=159473
     5
     6        didn't reduce coreui memory usage (Requested by kling on
     7        #webkit).
     8
     9        Reverted changeset:
     10
     11        "[Mac] Get rid of the old timey rubber-banding linen pattern."
     12        https://bugs.webkit.org/show_bug.cgi?id=159329
     13        http://trac.webkit.org/changeset/202725
     14
    1152016-07-06  Philippe Normand  <pnormand@igalia.com>
    216
  • trunk/Source/WebCore/platform/ScrollbarTheme.h

    r202725 r202858  
    9292
    9393#if ENABLE(RUBBER_BANDING)
     94    virtual void setUpOverhangAreasLayerContents(GraphicsLayer*, const Color&) { }
    9495    virtual void setUpContentShadowLayer(GraphicsLayer*) { }
    9596#endif
  • trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp

    r202725 r202858  
    895895    switch (customAppearance) {
    896896    case GraphicsLayer::CustomAppearance::NoCustomAppearance: ts << "none"; break;
     897    case GraphicsLayer::CustomAppearance::ScrollingOverhang: ts << "scrolling-overhang"; break;
    897898    case GraphicsLayer::CustomAppearance::ScrollingShadow: ts << "scrolling-shadow"; break;
    898899    case GraphicsLayer::CustomAppearance::LightBackdropAppearance: ts << "light-backdrop"; break;
  • trunk/Source/WebCore/platform/graphics/GraphicsLayer.h

    r202725 r202858  
    482482    virtual void setDebugBorder(const Color&, float /*borderWidth*/) { }
    483483
    484     enum CustomAppearance { NoCustomAppearance, ScrollingShadow, LightBackdropAppearance, DarkBackdropAppearance };
     484    enum CustomAppearance { NoCustomAppearance, ScrollingOverhang, ScrollingShadow, LightBackdropAppearance, DarkBackdropAppearance };
    485485    virtual void setCustomAppearance(CustomAppearance customAppearance) { m_customAppearance = customAppearance; }
    486486    CustomAppearance customAppearance() const { return m_customAppearance; }
  • trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm

    r202725 r202858  
    952952    case GraphicsLayer::LightBackdropAppearance:
    953953    case GraphicsLayer::DarkBackdropAppearance:
     954        ScrollbarThemeMac::removeOverhangAreaBackground(platformLayer());
    954955        ScrollbarThemeMac::removeOverhangAreaShadow(platformLayer());
     956        break;
     957    case GraphicsLayer::ScrollingOverhang:
     958        ScrollbarThemeMac::setUpOverhangAreaBackground(platformLayer());
    955959        break;
    956960    case GraphicsLayer::ScrollingShadow:
  • trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.h

    r202725 r202858  
    6969
    7070#if ENABLE(RUBBER_BANDING)
     71    WEBCORE_EXPORT static void setUpOverhangAreaBackground(CALayer *, const Color& customBackgroundColor = Color());
     72    WEBCORE_EXPORT static void removeOverhangAreaBackground(CALayer *);
     73
    7174    WEBCORE_EXPORT static void setUpOverhangAreaShadow(CALayer *);
    7275    WEBCORE_EXPORT static void removeOverhangAreaShadow(CALayer *);
     
    9093
    9194#if ENABLE(RUBBER_BANDING)
     95    void setUpOverhangAreasLayerContents(GraphicsLayer*, const Color&) override;
    9296    void setUpContentShadowLayer(GraphicsLayer*) override;
    9397#endif
  • trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.mm

    r202725 r202858  
    4848using namespace WebCore;
    4949
     50@interface NSColor (WebNSColorDetails)
     51+ (NSImage *)_linenPatternImage;
     52@end
     53
    5054namespace WebCore {
    5155
     
    561565
    562566#if ENABLE(RUBBER_BANDING)
     567static 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
     586void 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 concept
     590    // of pattern images, and we know that WebCore won't touch this layer.
     591    layer.backgroundColor = customBackgroundColor.isValid() ? cachedCGColor(customBackgroundColor) : cachedLinenBackgroundColor;
     592}
     593
     594void ScrollbarThemeMac::removeOverhangAreaBackground(CALayer *layer)
     595{
     596    layer.backgroundColor = nil;
     597}
     598
    563599void ScrollbarThemeMac::setUpOverhangAreaShadow(CALayer *layer)
    564600{
     
    584620}
    585621
     622void ScrollbarThemeMac::setUpOverhangAreasLayerContents(GraphicsLayer* graphicsLayer, const Color& customBackgroundColor)
     623{
     624    ScrollbarThemeMac::setUpOverhangAreaBackground(graphicsLayer->platformLayer(), customBackgroundColor);
     625}
     626
    586627void ScrollbarThemeMac::setUpContentShadowLayer(GraphicsLayer* graphicsLayer)
    587628{
  • trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp

    r202725 r202858  
    32713271
    32723272    m_layerForOverhangAreas->setBackgroundColor(m_rootExtendedBackgroundColor);
     3273
     3274    if (!m_rootExtendedBackgroundColor.isValid())
     3275        m_layerForOverhangAreas->setCustomAppearance(GraphicsLayer::ScrollingOverhang);
    32733276#endif
    32743277}
     
    32913294            m_layerForOverhangAreas->setPosition(FloatPoint(0, topContentInset));
    32923295            m_layerForOverhangAreas->setAnchorPoint(FloatPoint3D());
    3293             m_layerForOverhangAreas->setBackgroundColor(m_renderView.frameView().documentBackgroundColor());
     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);
    32943301
    32953302            // We want the overhang areas layer to be positioned below the frame contents,
  • trunk/Source/WebKit2/ChangeLog

    r202855 r202858  
     12016-07-06  Commit Queue  <commit-queue@webkit.org>
     2
     3        Unreviewed, rolling out r202725.
     4        https://bugs.webkit.org/show_bug.cgi?id=159473
     5
     6        didn't reduce coreui memory usage (Requested by kling on
     7        #webkit).
     8
     9        Reverted changeset:
     10
     11        "[Mac] Get rid of the old timey rubber-banding linen pattern."
     12        https://bugs.webkit.org/show_bug.cgi?id=159329
     13        http://trac.webkit.org/changeset/202725
     14
    1152016-07-06  Carlos Garcia Campos  <cgarcia@igalia.com>
    216
  • trunk/Source/WebKit2/Shared/mac/RemoteLayerTreePropertyApplier.mm

    r202725 r202858  
    112112    case GraphicsLayer::DarkBackdropAppearance:
    113113    case GraphicsLayer::LightBackdropAppearance:
     114        ScrollbarThemeMac::removeOverhangAreaBackground(layer);
    114115        ScrollbarThemeMac::removeOverhangAreaShadow(layer);
     116        break;
     117    case GraphicsLayer::ScrollingOverhang:
     118        ScrollbarThemeMac::setUpOverhangAreaBackground(layer);
    115119        break;
    116120    case GraphicsLayer::ScrollingShadow:
Note: See TracChangeset for help on using the changeset viewer.