Diff
Modified: trunk/Source/WebCore/ChangeLog (202857 => 202858)
--- trunk/Source/WebCore/ChangeLog 2016-07-06 13:27:40 UTC (rev 202857)
+++ trunk/Source/WebCore/ChangeLog 2016-07-06 16:57:25 UTC (rev 202858)
@@ -1,3 +1,17 @@
+2016-07-06 Commit Queue <[email protected]>
+
+ 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
+
2016-07-06 Philippe Normand <[email protected]>
[GStreamer] duration query improvements
Modified: trunk/Source/WebCore/platform/ScrollbarTheme.h (202857 => 202858)
--- trunk/Source/WebCore/platform/ScrollbarTheme.h 2016-07-06 13:27:40 UTC (rev 202857)
+++ trunk/Source/WebCore/platform/ScrollbarTheme.h 2016-07-06 16:57:25 UTC (rev 202858)
@@ -91,6 +91,7 @@
virtual void paintOverhangAreas(ScrollView&, GraphicsContext&, const IntRect&, const IntRect&, const IntRect&) { }
#if ENABLE(RUBBER_BANDING)
+ virtual void setUpOverhangAreasLayerContents(GraphicsLayer*, const Color&) { }
virtual void setUpContentShadowLayer(GraphicsLayer*) { }
#endif
Modified: trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp (202857 => 202858)
--- trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp 2016-07-06 13:27:40 UTC (rev 202857)
+++ trunk/Source/WebCore/platform/graphics/GraphicsLayer.cpp 2016-07-06 16:57:25 UTC (rev 202858)
@@ -894,6 +894,7 @@
{
switch (customAppearance) {
case GraphicsLayer::CustomAppearance::NoCustomAppearance: ts << "none"; break;
+ case GraphicsLayer::CustomAppearance::ScrollingOverhang: ts << "scrolling-overhang"; break;
case GraphicsLayer::CustomAppearance::ScrollingShadow: ts << "scrolling-shadow"; break;
case GraphicsLayer::CustomAppearance::LightBackdropAppearance: ts << "light-backdrop"; break;
case GraphicsLayer::CustomAppearance::DarkBackdropAppearance: ts << "dark-backdrop"; break;
Modified: trunk/Source/WebCore/platform/graphics/GraphicsLayer.h (202857 => 202858)
--- trunk/Source/WebCore/platform/graphics/GraphicsLayer.h 2016-07-06 13:27:40 UTC (rev 202857)
+++ trunk/Source/WebCore/platform/graphics/GraphicsLayer.h 2016-07-06 16:57:25 UTC (rev 202858)
@@ -481,7 +481,7 @@
virtual void setDebugBackgroundColor(const Color&) { }
virtual void setDebugBorder(const Color&, float /*borderWidth*/) { }
- enum CustomAppearance { NoCustomAppearance, ScrollingShadow, LightBackdropAppearance, DarkBackdropAppearance };
+ enum CustomAppearance { NoCustomAppearance, ScrollingOverhang, ScrollingShadow, LightBackdropAppearance, DarkBackdropAppearance };
virtual void setCustomAppearance(CustomAppearance customAppearance) { m_customAppearance = customAppearance; }
CustomAppearance customAppearance() const { return m_customAppearance; }
Modified: trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm (202857 => 202858)
--- trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm 2016-07-06 13:27:40 UTC (rev 202857)
+++ trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm 2016-07-06 16:57:25 UTC (rev 202858)
@@ -951,8 +951,12 @@
case GraphicsLayer::NoCustomAppearance:
case GraphicsLayer::LightBackdropAppearance:
case GraphicsLayer::DarkBackdropAppearance:
+ ScrollbarThemeMac::removeOverhangAreaBackground(platformLayer());
ScrollbarThemeMac::removeOverhangAreaShadow(platformLayer());
break;
+ case GraphicsLayer::ScrollingOverhang:
+ ScrollbarThemeMac::setUpOverhangAreaBackground(platformLayer());
+ break;
case GraphicsLayer::ScrollingShadow:
ScrollbarThemeMac::setUpOverhangAreaShadow(platformLayer());
break;
Modified: trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.h (202857 => 202858)
--- trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.h 2016-07-06 13:27:40 UTC (rev 202857)
+++ trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.h 2016-07-06 16:57:25 UTC (rev 202858)
@@ -68,6 +68,9 @@
bool isLayoutDirectionRTL(Scrollbar&);
#if ENABLE(RUBBER_BANDING)
+ WEBCORE_EXPORT static void setUpOverhangAreaBackground(CALayer *, const Color& customBackgroundColor = Color());
+ WEBCORE_EXPORT static void removeOverhangAreaBackground(CALayer *);
+
WEBCORE_EXPORT static void setUpOverhangAreaShadow(CALayer *);
WEBCORE_EXPORT static void removeOverhangAreaShadow(CALayer *);
#endif
@@ -89,6 +92,7 @@
int scrollbarPartToHIPressedState(ScrollbarPart);
#if ENABLE(RUBBER_BANDING)
+ void setUpOverhangAreasLayerContents(GraphicsLayer*, const Color&) override;
void setUpContentShadowLayer(GraphicsLayer*) override;
#endif
};
Modified: trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.mm (202857 => 202858)
--- trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.mm 2016-07-06 13:27:40 UTC (rev 202857)
+++ trunk/Source/WebCore/platform/mac/ScrollbarThemeMac.mm 2016-07-06 16:57:25 UTC (rev 202858)
@@ -47,6 +47,10 @@
using namespace WebCore;
+@interface NSColor (WebNSColorDetails)
++ (NSImage *)_linenPatternImage;
+@end
+
namespace WebCore {
typedef HashMap<Scrollbar*, RetainPtr<NSScrollerImp>> ScrollerImpMap;
@@ -560,6 +564,38 @@
}
#if ENABLE(RUBBER_BANDING)
+static RetainPtr<CGColorRef> linenBackgroundColor()
+{
+ NSImage *image = nil;
+ CGImageRef cgImage = nullptr;
+ BEGIN_BLOCK_OBJC_EXCEPTIONS;
+ image = [NSColor _linenPatternImage];
+ cgImage = [image CGImageForProposedRect:NULL context:NULL hints:nil];
+ END_BLOCK_OBJC_EXCEPTIONS;
+
+ if (!cgImage)
+ return nullptr;
+
+ RetainPtr<CGPatternRef> pattern = adoptCF(wkCGPatternCreateWithImageAndTransform(cgImage, CGAffineTransformIdentity, wkPatternTilingNoDistortion));
+ RetainPtr<CGColorSpaceRef> colorSpace = adoptCF(CGColorSpaceCreatePattern(0));
+
+ const CGFloat alpha = 1.0;
+ return adoptCF(CGColorCreateWithPattern(colorSpace.get(), pattern.get(), &alpha));
+}
+
+void ScrollbarThemeMac::setUpOverhangAreaBackground(CALayer *layer, const Color& customBackgroundColor)
+{
+ static CGColorRef cachedLinenBackgroundColor = linenBackgroundColor().leakRef();
+ // We operate on the CALayer directly here, since GraphicsLayer doesn't have the concept
+ // of pattern images, and we know that WebCore won't touch this layer.
+ layer.backgroundColor = customBackgroundColor.isValid() ? cachedCGColor(customBackgroundColor) : cachedLinenBackgroundColor;
+}
+
+void ScrollbarThemeMac::removeOverhangAreaBackground(CALayer *layer)
+{
+ layer.backgroundColor = nil;
+}
+
void ScrollbarThemeMac::setUpOverhangAreaShadow(CALayer *layer)
{
static const CGFloat shadowOpacity = 0.66;
@@ -583,6 +619,11 @@
layer.shadowOpacity = 0;
}
+void ScrollbarThemeMac::setUpOverhangAreasLayerContents(GraphicsLayer* graphicsLayer, const Color& customBackgroundColor)
+{
+ ScrollbarThemeMac::setUpOverhangAreaBackground(graphicsLayer->platformLayer(), customBackgroundColor);
+}
+
void ScrollbarThemeMac::setUpContentShadowLayer(GraphicsLayer* graphicsLayer)
{
// We operate on the CALayer directly here, since GraphicsLayer doesn't have the concept
Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (202857 => 202858)
--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp 2016-07-06 13:27:40 UTC (rev 202857)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp 2016-07-06 16:57:25 UTC (rev 202858)
@@ -3270,6 +3270,9 @@
return;
m_layerForOverhangAreas->setBackgroundColor(m_rootExtendedBackgroundColor);
+
+ if (!m_rootExtendedBackgroundColor.isValid())
+ m_layerForOverhangAreas->setCustomAppearance(GraphicsLayer::ScrollingOverhang);
#endif
}
@@ -3290,8 +3293,12 @@
m_layerForOverhangAreas->setSize(overhangAreaSize);
m_layerForOverhangAreas->setPosition(FloatPoint(0, topContentInset));
m_layerForOverhangAreas->setAnchorPoint(FloatPoint3D());
- m_layerForOverhangAreas->setBackgroundColor(m_renderView.frameView().documentBackgroundColor());
+ if (m_renderView.frameView().frame().settings().backgroundShouldExtendBeyondPage())
+ m_layerForOverhangAreas->setBackgroundColor(m_renderView.frameView().documentBackgroundColor());
+ else
+ m_layerForOverhangAreas->setCustomAppearance(GraphicsLayer::ScrollingOverhang);
+
// We want the overhang areas layer to be positioned below the frame contents,
// so insert it below the clip layer.
m_overflowControlsHostLayer->addChildBelow(m_layerForOverhangAreas.get(), m_clipLayer.get());
Modified: trunk/Source/WebKit2/ChangeLog (202857 => 202858)
--- trunk/Source/WebKit2/ChangeLog 2016-07-06 13:27:40 UTC (rev 202857)
+++ trunk/Source/WebKit2/ChangeLog 2016-07-06 16:57:25 UTC (rev 202858)
@@ -1,3 +1,17 @@
+2016-07-06 Commit Queue <[email protected]>
+
+ 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
+
2016-07-06 Carlos Garcia Campos <[email protected]>
Duplicated code in DrawingAreaImpl and CoordinatedDrawingArea
Modified: trunk/Source/WebKit2/Shared/mac/RemoteLayerTreePropertyApplier.mm (202857 => 202858)
--- trunk/Source/WebKit2/Shared/mac/RemoteLayerTreePropertyApplier.mm 2016-07-06 13:27:40 UTC (rev 202857)
+++ trunk/Source/WebKit2/Shared/mac/RemoteLayerTreePropertyApplier.mm 2016-07-06 16:57:25 UTC (rev 202858)
@@ -111,8 +111,12 @@
case GraphicsLayer::NoCustomAppearance:
case GraphicsLayer::DarkBackdropAppearance:
case GraphicsLayer::LightBackdropAppearance:
+ ScrollbarThemeMac::removeOverhangAreaBackground(layer);
ScrollbarThemeMac::removeOverhangAreaShadow(layer);
break;
+ case GraphicsLayer::ScrollingOverhang:
+ ScrollbarThemeMac::setUpOverhangAreaBackground(layer);
+ break;
case GraphicsLayer::ScrollingShadow:
ScrollbarThemeMac::setUpOverhangAreaShadow(layer);
break;