WebKit Bugzilla
Attachment 370641 Details for
Bug 198254
: Clean up TiledBacking coverage and scrollability
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-198254-20190525203056.patch (text/plain), 28.26 KB, created by
Simon Fraser (smfr)
on 2019-05-25 20:31:01 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Simon Fraser (smfr)
Created:
2019-05-25 20:31:01 PDT
Size:
28.26 KB
patch
obsolete
>Subversion Revision: 245777 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 2e4050f12c74535c53373175ecfb84a01845ece8..cbf8504a3e2524989a016943830348120ab0816c 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,34 @@ >+2019-05-25 Simon Fraser <simon.fraser@apple.com> >+ >+ Clean up TiledBacking coverage and scrollability >+ https://bugs.webkit.org/show_bug.cgi?id=198254 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ No new tests (OOPS!). >+ >+ * page/FrameView.cpp: >+ (WebCore::FrameView::updateTiledBackingAdaptiveSizing): >+ (WebCore::FrameView::adjustTiledBackingCoverage): >+ (WebCore::FrameView::setViewExposedRect): >+ (WebCore::FrameView::computeScrollability const): Deleted. >+ * page/FrameView.h: >+ * platform/graphics/TiledBacking.h: >+ * platform/graphics/ca/TileController.cpp: >+ (WebCore::TileController::TileController): >+ (WebCore::TileController::setScrollability): >+ (WebCore::TileController::setTileSizing): >+ (WebCore::nameForTileCoverage): >+ (WebCore::TileController::adjustTileCoverageRect const): >+ (WebCore::TileController::computeTileSize): >+ (WebCore::operator<<): >+ * platform/graphics/ca/TileController.h: >+ * rendering/RenderLayerBacking.cpp: >+ (WebCore::RenderLayerBacking::adjustTiledBackingCoverage): >+ (WebCore::computePageTiledBackingCoverage): Deleted. >+ * rendering/RenderLayerCompositor.cpp: >+ (WebCore::RenderLayerCompositor::frameViewDidLayout): >+ > 2019-05-25 Zalan Bujtas <zalan@apple.com> > > [LFC][IFC] Introduce DisplayRun to display tree >diff --git a/Source/WebCore/page/FrameView.cpp b/Source/WebCore/page/FrameView.cpp >index fcdef0cce2ffef75abdfd39f976f3f64a3f2942e..0798782a0f1cb285e5a1a112206cb1432901e77e 100644 >--- a/Source/WebCore/page/FrameView.cpp >+++ b/Source/WebCore/page/FrameView.cpp >@@ -2720,51 +2720,58 @@ void FrameView::addedOrRemovedScrollbar() > updateTiledBackingAdaptiveSizing(); > } > >-TiledBacking::Scrollability FrameView::computeScrollability() const >+void FrameView::updateTiledBackingAdaptiveSizing() > { >- auto* page = frame().page(); >- >- // Use smaller square tiles if the Window is not active to facilitate app napping. >- if (!page || !page->isWindowActive()) >- return TiledBacking::HorizontallyScrollable | TiledBacking::VerticallyScrollable; >+ auto* tiledBacking = this->tiledBacking(); >+ if (!tiledBacking) >+ return; > >- bool horizontallyScrollable; >- bool verticallyScrollable; >- bool clippedByAncestorView = static_cast<bool>(m_viewExposedRect); >+ auto* page = frame().page(); >+ if (!page) >+ return; > >-#if PLATFORM(IOS_FAMILY) >- if (page) >- clippedByAncestorView |= page->enclosedInScrollableAncestorView(); >-#endif >+ OptionSet<TiledBacking::ScrollableOnAxis> scrollability; > > if (delegatesScrolling()) { > IntSize documentSize = contentsSize(); > IntSize visibleSize = this->visibleSize(); > >- horizontallyScrollable = clippedByAncestorView || documentSize.width() > visibleSize.width(); >- verticallyScrollable = clippedByAncestorView || documentSize.height() > visibleSize.height(); >+ if (documentSize.width() > visibleSize.width()) >+ scrollability.add(TiledBacking::ScrollableOnAxis::Horizontal); >+ >+ if (documentSize.height() > visibleSize.height()) >+ scrollability.add(TiledBacking::ScrollableOnAxis::Vertical); > } else { >- horizontallyScrollable = clippedByAncestorView || horizontalScrollbar(); >- verticallyScrollable = clippedByAncestorView || verticalScrollbar(); >- } >+ if (horizontalScrollbar()) >+ scrollability.add(TiledBacking::ScrollableOnAxis::Horizontal); > >- TiledBacking::Scrollability scrollability = TiledBacking::NotScrollable; >- if (horizontallyScrollable) >- scrollability = TiledBacking::HorizontallyScrollable; >+ if (verticalScrollbar()) >+ scrollability.add(TiledBacking::ScrollableOnAxis::Vertical); >+ } > >- if (verticallyScrollable) >- scrollability |= TiledBacking::VerticallyScrollable; >+ auto tileSizing = TiledBacking::TileSizing::Automatic; >+ auto tileCoverage = TiledBacking::TileCoverage::Scrolling; > >- return scrollability; >-} >+ if (!page->isWindowActive()) { >+ // Use smaller square tiles if the window is not active to facilitate app napping. >+ tileSizing = TiledBacking::TileSizing::SmallTiles; >+ tileCoverage = TiledBacking::TileCoverage::VisibleArea; >+ } else { >+ bool clippedByAncestorView = static_cast<bool>(m_viewExposedRect); >+#if PLATFORM(IOS_FAMILY) >+ clippedByAncestorView |= page->enclosedInScrollableAncestorView(); >+#endif >+ if (clippedByAncestorView) >+ tileCoverage = TiledBacking::TileCoverage::Extended; >+ else if (!page->isVisible() || inLiveResize() || !speculativeTilingEnabled()) >+ tileCoverage = TiledBacking::TileCoverage::VisibleArea; >+ } > >-void FrameView::updateTiledBackingAdaptiveSizing() >-{ >- auto* tiledBacking = this->tiledBacking(); >- if (!tiledBacking) >- return; >+ tiledBacking->setScrollability(scrollability); >+ tiledBacking->setTileSizing(tileSizing); >+ tiledBacking->setTileCoverage(tileCoverage); > >- tiledBacking->setScrollability(computeScrollability()); >+ LOG_WITH_STREAM(Tiling, stream << "FrameView " << this << " updateTiledBackingAdaptiveSizing - tile sizing " << tileSizing << " coverage " << tileCoverage << " speculativeTilingEnabled " << speculativeTilingEnabled()); > } > > #if PLATFORM(IOS_FAMILY) >@@ -2847,9 +2854,8 @@ void FrameView::adjustTiledBackingCoverage() > if (!m_speculativeTilingEnabled) > enableSpeculativeTilingIfNeeded(); > >- RenderView* renderView = this->renderView(); >- if (renderView && renderView->layer() && renderView->layer()->backing()) >- renderView->layer()->backing()->adjustTiledBackingCoverage(); >+ updateTiledBackingAdaptiveSizing(); >+ > #if PLATFORM(IOS_FAMILY) > if (LegacyTileCache* tileCache = legacyTileCache()) > tileCache->setSpeculativeTileCreationEnabled(m_speculativeTilingEnabled); >@@ -5252,7 +5258,6 @@ void FrameView::setViewExposedRect(Optional<FloatRect> viewExposedRect) > > LOG_WITH_STREAM(Scrolling, stream << "FrameView " << this << " setViewExposedRect " << (viewExposedRect ? viewExposedRect.value() : FloatRect())); > >- bool hasRectChanged = !m_viewExposedRect == !viewExposedRect; > m_viewExposedRect = viewExposedRect; > > // FIXME: We should support clipping to the exposed rect for subframes as well. >@@ -5260,8 +5265,6 @@ void FrameView::setViewExposedRect(Optional<FloatRect> viewExposedRect) > return; > > if (TiledBacking* tiledBacking = this->tiledBacking()) { >- if (hasRectChanged) >- updateTiledBackingAdaptiveSizing(); > adjustTiledBackingCoverage(); > tiledBacking->setTiledScrollingIndicatorPosition(m_viewExposedRect ? m_viewExposedRect.value().location() : FloatPoint()); > } >diff --git a/Source/WebCore/page/FrameView.h b/Source/WebCore/page/FrameView.h >index d36e565645c3794e6a8513178d6edbff0cfdb9e8..7e6d7bb842de18120b098f02e8c081e0ad036b95 100644 >--- a/Source/WebCore/page/FrameView.h >+++ b/Source/WebCore/page/FrameView.h >@@ -593,7 +593,6 @@ public: > WEBCORE_EXPORT void availableContentSizeChanged(AvailableSizeChangeReason) final; > > void updateTiledBackingAdaptiveSizing(); >- TiledBacking::Scrollability computeScrollability() const; > > #if PLATFORM(IOS_FAMILY) > WEBCORE_EXPORT void didUpdateViewportOverrideRects(); >@@ -715,7 +714,7 @@ private: > void updateScriptedAnimationsAndTimersThrottlingState(const IntRect& visibleRect); > > void updateLayerFlushThrottling(); >- WEBCORE_EXPORT void adjustTiledBackingCoverage(); >+ void adjustTiledBackingCoverage(); > > void repaintContentRectangle(const IntRect&) final; > void addedOrRemovedScrollbar() final; >diff --git a/Source/WebCore/platform/graphics/TiledBacking.h b/Source/WebCore/platform/graphics/TiledBacking.h >index 444387c737b519e3c5099d6fa9e9d7b36ea355cc..0f96f7b946112cb34a7576dfb8b7bbb0299ebd5e 100644 >--- a/Source/WebCore/platform/graphics/TiledBacking.h >+++ b/Source/WebCore/platform/graphics/TiledBacking.h >@@ -27,6 +27,11 @@ > > #include <wtf/MonotonicTime.h> > #include <wtf/Optional.h> >+#include <wtf/OptionSet.h> >+ >+namespace WTF { >+class TextStream; >+} > > namespace WebCore { > >@@ -90,30 +95,34 @@ public: > > virtual void setTileSizeUpdateDelayDisabledForTesting(bool) = 0; > >- enum { >- NotScrollable = 0, >- HorizontallyScrollable = 1 << 0, >- VerticallyScrollable = 1 << 1 >+ enum class ScrollableOnAxis { >+ Horizontal = 1 << 0, >+ Vertical = 1 << 1 > }; >- typedef unsigned Scrollability; >- virtual void setScrollability(Scrollability) = 0; >- >- virtual void prepopulateRect(const FloatRect&) = 0; >- >- virtual void setIsInWindow(bool) = 0; >- virtual bool isInWindow() const = 0; >+ virtual void setScrollability(OptionSet<ScrollableOnAxis>) = 0; > >- enum { >- CoverageForVisibleArea = 0, >- CoverageForVerticalScrolling = 1 << 0, >- CoverageForHorizontalScrolling = 1 << 1, >- CoverageForScrolling = CoverageForVerticalScrolling | CoverageForHorizontalScrolling >+ enum class TileCoverage : uint8_t { >+ VisibleArea, >+ Scrolling, // Based on scrollability. >+ Extended, // When our web view is embedded in some ancestor scroll view. > }; >- typedef unsigned TileCoverage; > > virtual void setTileCoverage(TileCoverage) = 0; > virtual TileCoverage tileCoverage() const = 0; > >+ enum class TileSizing : uint8_t { >+ Automatic, // Based on scrollability >+ SmallTiles >+ }; >+ >+ virtual void setTileSizing(TileSizing) = 0; >+ virtual TileSizing tileSizing() const = 0; >+ >+ virtual void prepopulateRect(const FloatRect&) = 0; >+ >+ virtual void setIsInWindow(bool) = 0; >+ virtual bool isInWindow() const = 0; >+ > virtual void adjustTileCoverageRect(FloatRect& coverageRect, const FloatSize& newSize, const FloatRect& previousVisibleRect, const FloatRect& currentVisibleRect, float contentsScale) const = 0; > > virtual void willStartLiveResize() = 0; >@@ -157,4 +166,7 @@ public: > #endif > }; > >+TextStream& operator<<(TextStream&, TiledBacking::TileSizing); >+TextStream& operator<<(TextStream&, TiledBacking::TileCoverage); >+ > } // namespace WebCore >diff --git a/Source/WebCore/platform/graphics/ca/TileController.cpp b/Source/WebCore/platform/graphics/ca/TileController.cpp >index 432f0b8c84640fa6c548eef18b74518564a7d872..53e1718035f141f63c3c5e3a8d3197afe96a6c05 100644 >--- a/Source/WebCore/platform/graphics/ca/TileController.cpp >+++ b/Source/WebCore/platform/graphics/ca/TileController.cpp >@@ -67,7 +67,6 @@ TileController::TileController(PlatformCALayer* rootPlatformLayer) > , m_tileGrid(std::make_unique<TileGrid>(*this)) > , m_tileRevalidationTimer(*this, &TileController::tileRevalidationTimerFired) > , m_tileSizeChangeTimer(*this, &TileController::tileSizeChangeTimerFired, tileSizeUpdateDelay) >- , m_marginEdges(false, false, false, false) > { > } > >@@ -245,7 +244,7 @@ void TileController::setVelocity(const VelocityData& velocity) > setNeedsRevalidateTiles(); > } > >-void TileController::setScrollability(Scrollability scrollability) >+void TileController::setScrollability(OptionSet<ScrollableOnAxis> scrollability) > { > if (scrollability == m_scrollability) > return; >@@ -299,6 +298,15 @@ void TileController::setTileCoverage(TileCoverage coverage) > setNeedsRevalidateTiles(); > } > >+void TileController::setTileSizing(TileSizing tileSizing) >+{ >+ if (tileSizing == m_tileSizing) >+ return; >+ >+ m_tileSizing = tileSizing; >+ notePendingTileSizeChange(); >+} >+ > void TileController::revalidateTiles() > { > ASSERT(owningGraphicsLayer()->isCommittingChanges()); >@@ -385,6 +393,19 @@ static FloatRect expandRectWithinRect(const FloatRect& rect, const FloatSize& ne > } > #endif > >+#if !LOG_DISABLED >+static const char* nameForTileCoverage(TiledBacking::TileCoverage coverage) >+{ >+ switch (coverage) { >+ case TiledBacking::TileCoverage::VisibleArea: return "visible area"; >+ case TiledBacking::TileCoverage::Scrolling: return "scrolling"; >+ case TiledBacking::TileCoverage::Extended: return "extended"; >+ } >+ >+ return ""; >+} >+#endif >+ > void TileController::adjustTileCoverageRect(FloatRect& coverageRect, const FloatSize& newSize, const FloatRect& previousVisibleRect, const FloatRect& visibleRect, float contentsScale) const > { > // If the page is not in a window (for example if it's in a background tab), we limit the tile coverage rect to the visible rect. >@@ -397,7 +418,7 @@ void TileController::adjustTileCoverageRect(FloatRect& coverageRect, const Float > // FIXME: unify the iOS and Mac code. > UNUSED_PARAM(previousVisibleRect); > >- if (m_tileCoverage == CoverageForVisibleArea || MemoryPressureHandler::singleton().isUnderMemoryPressure()) { >+ if (m_tileCoverage == TileCoverage::VisibleArea || MemoryPressureHandler::singleton().isUnderMemoryPressure()) { > coverageRect = visibleRect; > return; > } >@@ -448,8 +469,8 @@ void TileController::adjustTileCoverageRect(FloatRect& coverageRect, const Float > if (futureRect.y() < 0) > futureRect.setY(0); > >+ LOG_WITH_STREAM(Tiling, stream << "TileController::computeTileCoverageRect newSize=" << newSize << " coverage " << nameForTileCoverage(m_tileCoverage) << " future rect " << futureRect); > coverageRect.unite(futureRect); >- return; > #else > UNUSED_PARAM(contentsScale); > >@@ -464,10 +485,20 @@ void TileController::adjustTileCoverageRect(FloatRect& coverageRect, const Float > float widthScale = 1; > float heightScale = 1; > >- if (m_tileCoverage & CoverageForHorizontalScrolling && !largeVisibleRectChange) >+ auto expandWidth = [&] { >+ return m_tileCoverage == TileCoverage::Extended >+ || (m_tileCoverage == TileCoverage::Scrolling && m_scrollability.contains(ScrollableOnAxis::Horizontal)); >+ }; >+ >+ auto expandHeight = [&] { >+ return m_tileCoverage == TileCoverage::Extended >+ || (m_tileCoverage == TileCoverage::Scrolling && m_scrollability.contains(ScrollableOnAxis::Vertical)); >+ }; >+ >+ if (!largeVisibleRectChange && expandWidth()) > widthScale = 2; > >- if (m_tileCoverage & CoverageForVerticalScrolling && !largeVisibleRectChange) >+ if (!largeVisibleRectChange && expandHeight()) > heightScale = 3; > > coverageSize.scale(widthScale, heightScale); >@@ -475,7 +506,7 @@ void TileController::adjustTileCoverageRect(FloatRect& coverageRect, const Float > FloatRect coverageBounds = boundsForSize(newSize); > > FloatRect coverage = expandRectWithinRect(visibleRect, coverageSize, coverageBounds); >- LOG_WITH_STREAM(Tiling, stream << "TileController::computeTileCoverageRect newSize=" << newSize << " mode " << m_tileCoverage << " expanded to " << coverageSize << " bounds with margin " << coverageBounds << " coverage " << coverage); >+ LOG_WITH_STREAM(Tiling, stream << "TileController::computeTileCoverageRect newSize=" << newSize << " coverage " << nameForTileCoverage(m_tileCoverage) << " expanded to " << coverageSize << " bounds with margin " << coverageBounds << " coverage " << coverage); > coverageRect.unite(coverage); > #endif > } >@@ -550,13 +581,15 @@ IntSize TileController::computeTileSize() > > IntSize tileSize(kDefaultTileSize, kDefaultTileSize); > >- if (m_scrollability == NotScrollable) { >- IntSize scaledSize = expandedIntSize(boundsWithoutMargin().size() * tileGrid().scale()); >- tileSize = scaledSize.constrainedBetween(IntSize(kDefaultTileSize, kDefaultTileSize), maxTileSize); >- } else if (m_scrollability == VerticallyScrollable) >- tileSize.setWidth(std::min(std::max<int>(ceilf(boundsWithoutMargin().width() * tileGrid().scale()), kDefaultTileSize), maxTileSize.width())); >+ if (m_tileSizing == TileSizing::Automatic) { >+ if (m_scrollability.isEmpty()) { >+ IntSize scaledSize = expandedIntSize(boundsWithoutMargin().size() * tileGrid().scale()); >+ tileSize = scaledSize.constrainedBetween(IntSize(kDefaultTileSize, kDefaultTileSize), maxTileSize); >+ } else if (!m_scrollability.contains(ScrollableOnAxis::Horizontal)) >+ tileSize.setWidth(std::min(std::max<int>(ceilf(boundsWithoutMargin().width() * tileGrid().scale()), kDefaultTileSize), maxTileSize.width())); >+ } > >- LOG_WITH_STREAM(Scrolling, stream << "TileController::tileSize newSize=" << tileSize); >+ LOG_WITH_STREAM(Tiling, stream << "TileController::tileSize newSize=" << tileSize); > > m_tileSizeLocked = true; > return tileSize; >@@ -788,6 +821,25 @@ void TileController::logFilledVisibleFreshTile(unsigned blankPixelCount) > owningGraphicsLayer()->platformCALayerLogFilledVisibleFreshTile(blankPixelCount); > } > >+TextStream& operator<<(TextStream& ts, TiledBacking::TileSizing tileSizing) >+{ >+ switch (tileSizing) { >+ case TiledBacking::TileSizing::Automatic: ts << "automatic"; break; >+ case TiledBacking::TileSizing::SmallTiles: ts << "small tiles"; break; >+ } >+ return ts; >+} >+ >+TextStream& operator<<(TextStream& ts, TiledBacking::TileCoverage tileCoverage) >+{ >+ switch (tileCoverage) { >+ case TiledBacking::TileCoverage::VisibleArea: ts << "visible area"; break; >+ case TiledBacking::TileCoverage::Scrolling: ts << "scrolling"; break; >+ case TiledBacking::TileCoverage::Extended: ts << "extended"; break; >+ } >+ return ts; >+} >+ > } // namespace WebCore > > #endif >diff --git a/Source/WebCore/platform/graphics/ca/TileController.h b/Source/WebCore/platform/graphics/ca/TileController.h >index 5797e8644080af1f064d06d3c8ae68718920d173..4d8bc73aefb1709b01c0d97b6744cfe5be6f87bb 100644 >--- a/Source/WebCore/platform/graphics/ca/TileController.h >+++ b/Source/WebCore/platform/graphics/ca/TileController.h >@@ -86,8 +86,8 @@ public: > WEBCORE_EXPORT void setTileDebugBorderWidth(float); > WEBCORE_EXPORT void setTileDebugBorderColor(Color); > >- FloatRect visibleRect() const override { return m_visibleRect; } >- FloatRect coverageRect() const override { return m_coverageRect; } >+ FloatRect visibleRect() const final { return m_visibleRect; } >+ FloatRect coverageRect() const final { return m_coverageRect; } > Optional<FloatRect> layoutViewportRect() const { return m_layoutViewportRect; } > > void setTileSizeUpdateDelayDisabledForTesting(bool) final; >@@ -106,22 +106,23 @@ public: > float tileDebugBorderWidth() const { return m_tileDebugBorderWidth; } > ScrollingModeIndication indicatorMode() const { return m_indicatorMode; } > >- void willStartLiveResize() override; >- void didEndLiveResize() override; >- >- IntSize tileSize() const override; >- IntRect bounds() const override; >- IntRect boundsWithoutMargin() const override; >- bool hasMargins() const override; >- bool hasHorizontalMargins() const override; >- bool hasVerticalMargins() const override; >- int topMarginHeight() const override; >- int bottomMarginHeight() const override; >- int leftMarginWidth() const override; >- int rightMarginWidth() const override; >- TileCoverage tileCoverage() const override { return m_tileCoverage; } >- void adjustTileCoverageRect(FloatRect& coverageRect, const FloatSize& newSize, const FloatRect& previousVisibleRect, const FloatRect& currentVisibleRect, float contentsScale) const override; >- bool scrollingPerformanceLoggingEnabled() const override { return m_scrollingPerformanceLoggingEnabled; } >+ void willStartLiveResize() final; >+ void didEndLiveResize() final; >+ >+ IntSize tileSize() const final; >+ IntRect bounds() const final; >+ IntRect boundsWithoutMargin() const final; >+ bool hasMargins() const final; >+ bool hasHorizontalMargins() const final; >+ bool hasVerticalMargins() const final; >+ int topMarginHeight() const final; >+ int bottomMarginHeight() const final; >+ int leftMarginWidth() const final; >+ int rightMarginWidth() const final; >+ TileCoverage tileCoverage() const final { return m_tileCoverage; } >+ TileSizing tileSizing() const final { return m_tileSizing; } >+ void adjustTileCoverageRect(FloatRect& coverageRect, const FloatSize& newSize, const FloatRect& previousVisibleRect, const FloatRect& currentVisibleRect, float contentsScale) const final; >+ bool scrollingPerformanceLoggingEnabled() const final { return m_scrollingPerformanceLoggingEnabled; } > > IntSize computeTileSize(); > >@@ -150,32 +151,35 @@ private: > float topContentInset() const { return m_topContentInset; } > > // TiledBacking member functions. >- void setVisibleRect(const FloatRect&) override; >- void setLayoutViewportRect(Optional<FloatRect>) override; >- void setCoverageRect(const FloatRect&) override; >- bool tilesWouldChangeForCoverageRect(const FloatRect&) const override; >- void setTiledScrollingIndicatorPosition(const FloatPoint&) override; >- void setTopContentInset(float) override; >- void setVelocity(const VelocityData&) override; >- void setScrollability(Scrollability) override; >- void prepopulateRect(const FloatRect&) override; >- void setIsInWindow(bool) override; >- bool isInWindow() const override { return m_isInWindow; } >- void setTileCoverage(TileCoverage) override; >- void revalidateTiles() override; >- void forceRepaint() override; >- IntRect tileGridExtent() const override; >- void setScrollingPerformanceLoggingEnabled(bool flag) override { m_scrollingPerformanceLoggingEnabled = flag; } >- double retainedTileBackingStoreMemory() const override; >- IntRect tileCoverageRect() const override; >+ void setVisibleRect(const FloatRect&) final; >+ void setLayoutViewportRect(Optional<FloatRect>) final; >+ void setCoverageRect(const FloatRect&) final; >+ bool tilesWouldChangeForCoverageRect(const FloatRect&) const final; >+ void setTiledScrollingIndicatorPosition(const FloatPoint&) final; >+ void setTopContentInset(float) final; >+ void setVelocity(const VelocityData&) final; >+ void setScrollability(OptionSet<ScrollableOnAxis>) final; >+ void prepopulateRect(const FloatRect&) final; >+ void setIsInWindow(bool) final; >+ bool isInWindow() const final { return m_isInWindow; } >+ >+ void setTileCoverage(TileCoverage) final; >+ void setTileSizing(TileSizing) final; >+ >+ void revalidateTiles() final; >+ void forceRepaint() final; >+ IntRect tileGridExtent() const final; >+ void setScrollingPerformanceLoggingEnabled(bool flag) final { m_scrollingPerformanceLoggingEnabled = flag; } >+ double retainedTileBackingStoreMemory() const final; >+ IntRect tileCoverageRect() const final; > #if USE(CA) >- PlatformCALayer* tiledScrollingIndicatorLayer() override; >+ PlatformCALayer* tiledScrollingIndicatorLayer() final; > #endif >- void setScrollingModeIndication(ScrollingModeIndication) override; >- void setHasMargins(bool marginTop, bool marginBottom, bool marginLeft, bool marginRight) override; >- void setMarginSize(int) override; >- void setZoomedOutContentsScale(float) override; >- float zoomedOutContentsScale() const override; >+ void setScrollingModeIndication(ScrollingModeIndication) final; >+ void setHasMargins(bool marginTop, bool marginBottom, bool marginLeft, bool marginRight) final; >+ void setMarginSize(int) final; >+ void setZoomedOutContentsScale(float) final; >+ float zoomedOutContentsScale() const final; > > void updateMargins(); > void clearZoomedOutTileGrid(); >@@ -195,6 +199,7 @@ private: > > float m_zoomedOutContentsScale { 0 }; > float m_deviceScaleFactor; >+ float m_topContentInset { 0 }; > > std::unique_ptr<TileCoverageMap> m_coverageMap; > >@@ -209,20 +214,20 @@ private: > Timer m_tileRevalidationTimer; > DeferrableOneShotTimer m_tileSizeChangeTimer; > >- TileCoverage m_tileCoverage { CoverageForVisibleArea }; >- > VelocityData m_velocity; > > int m_marginSize { kDefaultTileSize }; > >- Scrollability m_scrollability { HorizontallyScrollable | VerticallyScrollable }; >- > // m_marginTop and m_marginBottom are the height in pixels of the top and bottom margin tiles. The width > // of those tiles will be equivalent to the width of the other tiles in the grid. m_marginRight and > // m_marginLeft are the width in pixels of the right and left margin tiles, respectively. The height of > // those tiles will be equivalent to the height of the other tiles in the grid. >- RectEdges<bool> m_marginEdges; >- >+ RectEdges<bool> m_marginEdges { false, false, false, false }; >+ >+ OptionSet<ScrollableOnAxis> m_scrollability { ScrollableOnAxis::Horizontal, ScrollableOnAxis::Vertical }; >+ TileCoverage m_tileCoverage { TileCoverage::VisibleArea }; >+ TileSizing m_tileSizing { TileSizing::Automatic }; >+ > bool m_isInWindow { false }; > bool m_scrollingPerformanceLoggingEnabled { false }; > bool m_acceleratesDrawing { false }; >@@ -237,7 +242,6 @@ private: > Color m_tileDebugBorderColor; > float m_tileDebugBorderWidth { 0 }; > ScrollingModeIndication m_indicatorMode { SynchronousScrollingBecauseOfLackOfScrollingCoordinatorIndication }; >- float m_topContentInset { 0 }; > }; > > } // namespace WebCore >diff --git a/Source/WebCore/rendering/RenderLayerBacking.cpp b/Source/WebCore/rendering/RenderLayerBacking.cpp >index c9a9a3b703b40a584d9abc4686a27702dbbfe535..8ad0c82dceb3d740af3ae27d7301fb16d0f53050 100644 >--- a/Source/WebCore/rendering/RenderLayerBacking.cpp >+++ b/Source/WebCore/rendering/RenderLayerBacking.cpp >@@ -355,35 +355,28 @@ TiledBacking* RenderLayerBacking::tiledBacking() const > return m_graphicsLayer->tiledBacking(); > } > >-static TiledBacking::TileCoverage computePageTiledBackingCoverage(RenderLayerBacking* backing) >-{ >- // FIXME: When we use TiledBacking for overflow, this should look at RenderView scrollability. >- auto& frameView = backing->owningLayer().renderer().view().frameView(); >- >- // If the page is non-visible, don't incur the cost of keeping extra tiles for scrolling. >- if (!backing->owningLayer().page().isVisible()) >- return TiledBacking::CoverageForVisibleArea; >- >- TiledBacking::TileCoverage tileCoverage = TiledBacking::CoverageForVisibleArea; >- bool useMinimalTilesDuringLiveResize = frameView.inLiveResize(); >- if (frameView.speculativeTilingEnabled() && !useMinimalTilesDuringLiveResize) { >- bool clipsToExposedRect = static_cast<bool>(frameView.viewExposedRect()); >- if (frameView.horizontalScrollbarMode() != ScrollbarAlwaysOff || clipsToExposedRect) >- tileCoverage |= TiledBacking::CoverageForHorizontalScrolling; >- >- if (frameView.verticalScrollbarMode() != ScrollbarAlwaysOff || clipsToExposedRect) >- tileCoverage |= TiledBacking::CoverageForVerticalScrolling; >- } >- return tileCoverage; >-} >+//static TiledBacking::TileCoverage computePageTiledBackingCoverage(const RenderLayer& layer) >+//{ >+// auto& frameView = layer.renderer().view().frameView(); >+// >+// if (!layer.page().isVisible() || frameView.inLiveResize() || !frameView.speculativeTilingEnabled()) >+// return TiledBacking::TileCoverage::VisibleArea; >+// >+// if (frameView.viewExposedRect()) >+// return TiledBacking::TileCoverage::ForScrollingByExternalScrollView; >+// >+// return TiledBacking::TileCoverage::VisibleArea; >+//} > > void RenderLayerBacking::adjustTiledBackingCoverage() > { >- if (!m_isFrameLayerWithTiledBacking) >- return; >+// updateTiledBackingAdaptiveSizing does this now. >+ >+// if (!m_isFrameLayerWithTiledBacking) >+// return; > >- TiledBacking::TileCoverage tileCoverage = computePageTiledBackingCoverage(this); >- tiledBacking()->setTileCoverage(tileCoverage); >+// auto tileCoverage = computePageTiledBackingCoverage(m_owningLayer); >+// tiledBacking()->setTileCoverage(tileCoverage); > } > > void RenderLayerBacking::setTiledBackingHasMargins(bool hasExtendedBackgroundOnLeftAndRight, bool hasExtendedBackgroundOnTopAndBottom) >diff --git a/Source/WebCore/rendering/RenderLayerCompositor.cpp b/Source/WebCore/rendering/RenderLayerCompositor.cpp >index f6d258a7e645850741fda2c932134f173371959a..8feb59d10988e111267d0ac9f8685fd69cf8b2b7 100644 >--- a/Source/WebCore/rendering/RenderLayerCompositor.cpp >+++ b/Source/WebCore/rendering/RenderLayerCompositor.cpp >@@ -2041,6 +2041,7 @@ void RenderLayerCompositor::frameViewDidAddOrRemoveScrollbars() > > void RenderLayerCompositor::frameViewDidLayout() > { >+ // FIXME > if (auto* renderViewBacking = m_renderView.layer()->backing()) > renderViewBacking->adjustTiledBackingCoverage(); > }
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
ews-watchlist
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 198254
: 370641 |
370644