Diff
Modified: trunk/Source/WebCore/ChangeLog (190997 => 190998)
--- trunk/Source/WebCore/ChangeLog 2015-10-13 18:35:31 UTC (rev 190997)
+++ trunk/Source/WebCore/ChangeLog 2015-10-13 18:46:53 UTC (rev 190998)
@@ -1,3 +1,65 @@
+2015-10-13 Said Abou-Hallawa <[email protected]>
+
+ Add debug settings for using giant tiles (4096x4096)
+ https://bugs.webkit.org/show_bug.cgi?id=149977
+ <rdar://problem/23017093>
+
+ Reviewed by Tim Horton.
+
+ Instead of creating the GraphicsLayer with a fixed size 512x512, we need
+ to read the useGiantTiles setting. If its value is true, we set the layer
+ tileSize to 4096x4096.
+
+ * page/Settings.in:
+ Define the name of the setting and its default value.
+
+ * platform/graphics/GraphicsLayerClient.h:
+ (WebCore::GraphicsLayerClient::tileSize):
+ Define tileSize() in the base class GraphicsLayerClient. This is going to
+ be overridden RenderLayerBacking.
+
+ * platform/graphics/TiledBacking.h:
+ (WebCore::defaultTileSize):
+ Define the default tileSize which will depend on the useGiantTiles
+ setting.
+
+ * platform/graphics/ca/GraphicsLayerCA.cpp:
+ (WebCore::GraphicsLayerCA::platformCALayerTileSize):
+ Implement the virtual function GraphicsLayerCA::platformCALayerTileSize().
+ It passes the call to client GraphicsLayerClient which can be RenderLayerBacking
+ in our case.
+
+ * platform/graphics/ca/GraphicsLayerCA.h:
+ Override base class function PlatformCALayerClient::PlatformCALayerClient().
+
+ * platform/graphics/ca/PlatformCALayerClient.h:
+ (WebCore::PlatformCALayerClient::platformCALayerTileSize):
+ Define platformCALayerTileSize() in the base class PlatformCALayerClient.
+ This is going to be overridden GraphicsLayerCA.
+
+ * platform/graphics/ca/TileController.cpp:
+ (WebCore::TileController::TileController):
+ No need for the member m_tileSize.
+
+ (WebCore::TileController::computeTileCoverageRect):
+ Use the function tileSize() instead of using the static values.
+
+ (WebCore::TileController::tileSize):
+ The tileSize will be retrieved from the owning graphics layer.
+
+ * platform/graphics/ca/TileController.h:
+ No need for the member m_tileSize. The tileSize will be retrieved from the owning graphics layer.
+
+ * rendering/RenderLayerBacking.cpp:
+ (WebCore::RenderLayerBacking::setTiledBackingHasMargins):
+ Use the function tileSize() instead of using the static values.
+
+ (WebCore::RenderLayerBacking::tileSize):
+ Override base class function GraphicsLayerClient::tileSize().
+
+ * rendering/RenderLayerBacking.h:
+ Define the concrete method RenderLayerBacking::tilSize().
+
2015-10-13 Antti Koivisto <[email protected]>
Try to fix ENABLE(DETAILS_ELEMENT) with SHADOW_DOM disabled.
Modified: trunk/Source/WebCore/page/Settings.in (190997 => 190998)
--- trunk/Source/WebCore/page/Settings.in 2015-10-13 18:35:31 UTC (rev 190997)
+++ trunk/Source/WebCore/page/Settings.in 2015-10-13 18:46:53 UTC (rev 190998)
@@ -201,6 +201,8 @@
subpixelCSSOMElementMetricsEnabled initial=false
+useGiantTiles initial=false
+
mediaSourceEnabled initial=true, conditional=MEDIA_SOURCE
# FIXME: Rename to allowMultiElementImplicitFormSubmission once we upstream the iOS changes to WebView.mm.
Modified: trunk/Source/WebCore/platform/graphics/GraphicsLayerClient.h (190997 => 190998)
--- trunk/Source/WebCore/platform/graphics/GraphicsLayerClient.h 2015-10-13 18:35:31 UTC (rev 190997)
+++ trunk/Source/WebCore/platform/graphics/GraphicsLayerClient.h 2015-10-13 18:46:53 UTC (rev 190998)
@@ -26,6 +26,8 @@
#ifndef GraphicsLayerClient_h
#define GraphicsLayerClient_h
+#include "IntSize.h"
+#include "TiledBacking.h"
#include <wtf/Forward.h>
namespace WebCore {
@@ -118,6 +120,8 @@
virtual bool shouldAggressivelyRetainTiles(const GraphicsLayer*) const { return false; }
virtual bool shouldTemporarilyRetainTileCohorts(const GraphicsLayer*) const { return true; }
+ virtual IntSize tileSize() const { return defaultTileSize(); }
+
virtual bool needsPixelAligment() const { return false; }
virtual bool needsIOSDumpRenderTreeMainFrameRenderViewLayerIsAlwaysOpaqueHack(const GraphicsLayer&) const { return false; }
Modified: trunk/Source/WebCore/platform/graphics/TiledBacking.h (190997 => 190998)
--- trunk/Source/WebCore/platform/graphics/TiledBacking.h 2015-10-13 18:35:31 UTC (rev 190997)
+++ trunk/Source/WebCore/platform/graphics/TiledBacking.h 2015-10-13 18:46:53 UTC (rev 190998)
@@ -28,9 +28,27 @@
namespace WebCore {
-static const int defaultTileWidth = 512;
-static const int defaultTileHeight = 512;
+enum TileSizeMode {
+ StandardTileSizeMode,
+ GiantTileSizeMode
+};
+inline static IntSize defaultTileSize(TileSizeMode tileSizeMode = StandardTileSizeMode)
+{
+ static const int kTiledLayerTileSize = 512;
+
+ // This is an experimental value for debugging and evaluating the overhead which may be
+ // incurred due to a large tile size.
+ static const int kGiantTiledLayerTileSize = 4096;
+
+ if (tileSizeMode == GiantTileSizeMode)
+ return IntSize(kGiantTiledLayerTileSize, kGiantTiledLayerTileSize);
+
+ return IntSize(kTiledLayerTileSize, kTiledLayerTileSize);
+}
+
+class FloatPoint;
+class FloatRect;
class IntRect;
class PlatformCALayer;
Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (190997 => 190998)
--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp 2015-10-13 18:35:31 UTC (rev 190997)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp 2015-10-13 18:46:53 UTC (rev 190998)
@@ -1449,6 +1449,11 @@
return client().shouldTemporarilyRetainTileCohorts(this);
}
+IntSize GraphicsLayerCA::platformCALayerTileSize() const
+{
+ return client().tileSize();
+}
+
static PlatformCALayer::LayerType layerTypeForCustomBackdropAppearance(GraphicsLayer::CustomAppearance appearance)
{
return appearance == GraphicsLayer::LightBackdropAppearance ? PlatformCALayer::LayerTypeLightSystemBackdropLayer : PlatformCALayer::LayerTypeDarkSystemBackdropLayer;
Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h (190997 => 190998)
--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h 2015-10-13 18:35:31 UTC (rev 190997)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h 2015-10-13 18:46:53 UTC (rev 190998)
@@ -47,10 +47,6 @@
class GraphicsLayerCA : public GraphicsLayer, public PlatformCALayerClient {
public:
- // The width and height of a single tile in a tiled layer. Should be large enough to
- // avoid lots of small tiles (and therefore lots of drawing callbacks), but small enough
- // to keep the overall tile cost low.
- static const int kTiledLayerTileSize = 512;
WEBCORE_EXPORT explicit GraphicsLayerCA(Type, GraphicsLayerClient&);
WEBCORE_EXPORT virtual ~GraphicsLayerCA();
@@ -199,6 +195,7 @@
WEBCORE_EXPORT virtual float platformCALayerContentsScaleMultiplierForNewTiles(PlatformCALayer*) const override;
WEBCORE_EXPORT virtual bool platformCALayerShouldAggressivelyRetainTiles(PlatformCALayer*) const override;
WEBCORE_EXPORT virtual bool platformCALayerShouldTemporarilyRetainTileCohorts(PlatformCALayer*) const override;
+ WEBCORE_EXPORT virtual IntSize platformCALayerTileSize() const override;
virtual bool isCommittingChanges() const override { return m_isCommittingChanges; }
Modified: trunk/Source/WebCore/platform/graphics/ca/PlatformCALayerClient.h (190997 => 190998)
--- trunk/Source/WebCore/platform/graphics/ca/PlatformCALayerClient.h 2015-10-13 18:35:31 UTC (rev 190997)
+++ trunk/Source/WebCore/platform/graphics/ca/PlatformCALayerClient.h 2015-10-13 18:46:53 UTC (rev 190998)
@@ -60,6 +60,8 @@
virtual bool platformCALayerShouldAggressivelyRetainTiles(PlatformCALayer*) const { return false; }
virtual bool platformCALayerShouldTemporarilyRetainTileCohorts(PlatformCALayer*) const { return true; }
+ virtual IntSize platformCALayerTileSize() const { return defaultTileSize(); }
+
virtual bool isCommittingChanges() const { return false; }
protected:
Modified: trunk/Source/WebCore/platform/graphics/ca/TileController.cpp (190997 => 190998)
--- trunk/Source/WebCore/platform/graphics/ca/TileController.cpp 2015-10-13 18:35:31 UTC (rev 190997)
+++ trunk/Source/WebCore/platform/graphics/ca/TileController.cpp 2015-10-13 18:46:53 UTC (rev 190998)
@@ -54,7 +54,6 @@
TileController::TileController(PlatformCALayer* rootPlatformLayer)
: m_tileCacheLayer(rootPlatformLayer)
, m_tileGrid(std::make_unique<TileGrid>(*this))
- , m_tileSize(defaultTileWidth, defaultTileHeight)
, m_tileRevalidationTimer(*this, &TileController::tileRevalidationTimerFired)
, m_zoomedOutContentsScale(0)
, m_deviceScaleFactor(owningGraphicsLayer()->platformCALayerDeviceScaleFactor())
@@ -328,8 +327,8 @@
if (m_tileCoverage == CoverageForVisibleArea || MemoryPressureHandler::singleton().isUnderMemoryPressure())
return visibleRect;
- double horizontalMargin = defaultTileWidth / contentsScale;
- double verticalMargin = defaultTileHeight / contentsScale;
+ double horizontalMargin = tileSize().width() / contentsScale;
+ double verticalMargin = tileSize().height() / contentsScale;
double currentTime = monotonicallyIncreasingTime();
double timeDelta = currentTime - m_velocity.lastUpdateTime;
@@ -428,6 +427,11 @@
return owningGraphicsLayer()->platformCALayerShouldTemporarilyRetainTileCohorts(m_tileCacheLayer);
}
+IntSize TileController::tileSize() const
+{
+ return owningGraphicsLayer()->platformCALayerTileSize();
+}
+
void TileController::clearZoomedOutTileGrid()
{
m_zoomedOutTileGrid = nullptr;
Modified: trunk/Source/WebCore/platform/graphics/ca/TileController.h (190997 => 190998)
--- trunk/Source/WebCore/platform/graphics/ca/TileController.h 2015-10-13 18:35:31 UTC (rev 190997)
+++ trunk/Source/WebCore/platform/graphics/ca/TileController.h 2015-10-13 18:46:53 UTC (rev 190998)
@@ -95,7 +95,7 @@
float tileDebugBorderWidth() const { return m_tileDebugBorderWidth; }
ScrollingModeIndication indicatorMode() const { return m_indicatorMode; }
- virtual IntSize tileSize() const override { return m_tileSize; }
+ virtual IntSize tileSize() const override;
virtual IntRect bounds() const override;
virtual IntRect boundsWithoutMargin() const override;
virtual bool hasMargins() const override;
@@ -175,7 +175,6 @@
std::unique_ptr<TileGrid> m_tileGrid;
std::unique_ptr<TileGrid> m_zoomedOutTileGrid;
- IntSize m_tileSize;
FloatRect m_visibleRect; // Only used for scroll performance logging.
FloatRect m_coverageRect;
IntRect m_boundsAtLastRevalidate;
Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (190997 => 190998)
--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp 2015-10-13 18:35:31 UTC (rev 190997)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp 2015-10-13 18:46:53 UTC (rev 190998)
@@ -223,8 +223,8 @@
if (!m_usingTiledCacheLayer)
return;
- int marginLeftAndRightSize = hasExtendedBackgroundOnLeftAndRight ? defaultTileWidth : 0;
- int marginTopAndBottomSize = hasExtendedBackgroundOnTopAndBottom ? defaultTileHeight : 0;
+ int marginLeftAndRightSize = hasExtendedBackgroundOnLeftAndRight ? tileSize().width() : 0;
+ int marginTopAndBottomSize = hasExtendedBackgroundOnTopAndBottom ? tileSize().height() : 0;
tiledBacking()->setTileMargins(marginTopAndBottomSize, marginTopAndBottomSize, marginLeftAndRightSize, marginLeftAndRightSize);
}
@@ -2461,6 +2461,12 @@
return true;
}
+IntSize RenderLayerBacking::tileSize() const
+{
+ TileSizeMode tileSizeMode = renderer().frame().page()->settings().useGiantTiles() ? GiantTileSizeMode : StandardTileSizeMode;
+ return defaultTileSize(tileSizeMode);
+}
+
#ifndef NDEBUG
void RenderLayerBacking::verifyNotPainting()
{
Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.h (190997 => 190998)
--- trunk/Source/WebCore/rendering/RenderLayerBacking.h 2015-10-13 18:35:31 UTC (rev 190997)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.h 2015-10-13 18:46:53 UTC (rev 190998)
@@ -213,6 +213,7 @@
virtual bool shouldAggressivelyRetainTiles(const GraphicsLayer*) const override;
virtual bool shouldTemporarilyRetainTileCohorts(const GraphicsLayer*) const override;
+ virtual IntSize tileSize() const override;
virtual bool needsPixelAligment() const override { return !m_isMainFrameRenderViewLayer; }
#if PLATFORM(IOS)
Modified: trunk/Source/WebKit2/ChangeLog (190997 => 190998)
--- trunk/Source/WebKit2/ChangeLog 2015-10-13 18:35:31 UTC (rev 190997)
+++ trunk/Source/WebKit2/ChangeLog 2015-10-13 18:46:53 UTC (rev 190998)
@@ -1,3 +1,19 @@
+2015-10-13 Said Abou-Hallawa <[email protected]>
+
+ Add debug settings for using giant tiles (4096x4096)
+ https://bugs.webkit.org/show_bug.cgi?id=149977
+ <rdar://problem/23017093>
+
+ Reviewed by Tim Horton.
+
+ * Shared/WebPreferencesDefinitions.h:
+ * UIProcess/API/C/WKPreferences.cpp:
+ (WKPreferencesSetUseGiantTiles):
+ (WKPreferencesGetUseGiantTiles):
+ * UIProcess/API/C/WKPreferencesRefPrivate.h:
+ * WebProcess/WebPage/WebPage.cpp:
+ (WebKit::WebPage::updatePreferences):
+
2015-10-13 Brent Fulgham <[email protected]>
[iOS] Avoid crash due to invalid screen bounds
Modified: trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h (190997 => 190998)
--- trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h 2015-10-13 18:35:31 UTC (rev 190997)
+++ trunk/Source/WebKit2/Shared/WebPreferencesDefinitions.h 2015-10-13 18:46:53 UTC (rev 190998)
@@ -188,6 +188,7 @@
macro(ThreadedScrollingEnabled, threadedScrollingEnabled, Bool, bool, true) \
macro(SimpleLineLayoutEnabled, simpleLineLayoutEnabled, Bool, bool, true) \
macro(SubpixelCSSOMElementMetricsEnabled, subpixelCSSOMElementMetricsEnabled, Bool, bool, false) \
+ macro(UseGiantTiles, useGiantTiles, Bool, bool, false) \
macro(MediaStreamEnabled, mediaStreamEnabled, Bool, bool, false) \
macro(UseLegacyTextAlignPositionedElementBehavior, useLegacyTextAlignPositionedElementBehavior, Bool, bool, false) \
macro(SpatialNavigationEnabled, spatialNavigationEnabled, Bool, bool, false) \
Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp (190997 => 190998)
--- trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp 2015-10-13 18:35:31 UTC (rev 190997)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPreferences.cpp 2015-10-13 18:46:53 UTC (rev 190998)
@@ -1217,6 +1217,16 @@
return toImpl(preferencesRef)->subpixelCSSOMElementMetricsEnabled();
}
+void WKPreferencesSetUseGiantTiles(WKPreferencesRef preferencesRef, bool flag)
+{
+ toImpl(preferencesRef)->setUseGiantTiles(flag);
+}
+
+bool WKPreferencesGetUseGiantTiles(WKPreferencesRef preferencesRef)
+{
+ return toImpl(preferencesRef)->useGiantTiles();
+}
+
void WKPreferencesSetMediaStreamEnabled(WKPreferencesRef preferencesRef, bool enabled)
{
toImpl(preferencesRef)->setMediaStreamEnabled(enabled);
Modified: trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h (190997 => 190998)
--- trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h 2015-10-13 18:35:31 UTC (rev 190997)
+++ trunk/Source/WebKit2/UIProcess/API/C/WKPreferencesRefPrivate.h 2015-10-13 18:46:53 UTC (rev 190998)
@@ -313,6 +313,10 @@
WK_EXPORT void WKPreferencesSetSubpixelCSSOMElementMetricsEnabled(WKPreferencesRef, bool);
WK_EXPORT bool WKPreferencesGetSubpixelCSSOMElementMetricsEnabled(WKPreferencesRef);
+// Defaults to false.
+WK_EXPORT void WKPreferencesSetUseGiantTiles(WKPreferencesRef, bool);
+WK_EXPORT bool WKPreferencesGetUseGiantTiles(WKPreferencesRef);
+
WK_EXPORT void WKPreferencesResetTestRunnerOverrides(WKPreferencesRef preferencesRef);
// Defaults to false.
Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (190997 => 190998)
--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2015-10-13 18:35:31 UTC (rev 190997)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp 2015-10-13 18:46:53 UTC (rev 190998)
@@ -2738,6 +2738,7 @@
settings.setShowRepaintCounter(store.getBoolValueForKey(WebPreferencesKey::compositingRepaintCountersVisibleKey()));
settings.setShowTiledScrollingIndicator(store.getBoolValueForKey(WebPreferencesKey::tiledScrollingIndicatorVisibleKey()));
settings.setVisibleDebugOverlayRegions(store.getUInt32ValueForKey(WebPreferencesKey::visibleDebugOverlayRegionsKey()));
+ settings.setUseGiantTiles(store.getBoolValueForKey(WebPreferencesKey::useGiantTilesKey()));
settings.setAggressiveTileRetentionEnabled(store.getBoolValueForKey(WebPreferencesKey::aggressiveTileRetentionEnabledKey()));
settings.setTemporaryTileCohortRetentionEnabled(store.getBoolValueForKey(WebPreferencesKey::temporaryTileCohortRetentionEnabledKey()));