TileController can fail to receive exposedRect from the drawing area if set at the wrong time

https://bugs.webkit.org/show_bug.cgi?id=126536

Reviewed by Simon Fraser.

* Configurations/WebKit2.xcconfig:
* UIProcess/API/mac/WKView.mm:
(-[WKView _updateViewExposedRect]):
* UIProcess/DrawingAreaProxy.cpp:
(WebKit::DrawingAreaProxy::DrawingAreaProxy):
(WebKit::DrawingAreaProxy::setExposedRect):
(WebKit::DrawingAreaProxy::exposedRectChangedTimerFired):
* UIProcess/DrawingAreaProxy.h:
(WebKit::DrawingAreaProxy::exposedRect):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
(WebKit::WebPageProxy::close):
* UIProcess/WebPageProxy.h:
Move exposedRect stuff from WebPageProxy to DrawingAreaProxy.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
Push the exposedRect down into WebCore.

* WebProcess/WebPage/DrawingArea.h:
* WebProcess/WebPage/DrawingArea.messages.in:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
(WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):
(WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
(WebKit::TiledCoreAnimationDrawingArea::createPageOverlayLayer):
(WebKit::TiledCoreAnimationDrawingArea::didCommitChangesForLayer):
Get rid of "clipsToExposedRect", we just use infinite-ness of the rect
to indicate that now.
Don't scroll an infinite rect; it won't work.

* WebCore.exp.in:
Export some things.

* page/FrameView.cpp:
(WebCore::FrameView::FrameView):
(WebCore::FrameView::setExposedRect):
Store the exposed rect on FrameView. When it changes, if the main frame
has a TiledBacking, inform it of the change.

* page/FrameView.h:
* platform/graphics/TiledBacking.h:
* platform/graphics/ca/mac/TileController.h:
* platform/graphics/ca/mac/TileController.mm:
(WebCore::TileController::TileController):
(WebCore::TileController::tilesWouldChangeForVisibleRect):
(WebCore::TileController::computeTileCoverageRect):
(WebCore::TileController::revalidateTiles):
(WebCore::TileController::updateTileCoverageMap):
Make use of the fact that we can test if a rect is infinite
instead of having a separate boolean property for that.

* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::RenderLayerBacking):
(WebCore::computeTileCoverage):
Push the FrameView's cached exposed rect down into the TiledBacking when it is created.
We only support clipping for the main frame TileController for now.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@161530 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 4b8507a9
2014-01-08 Tim Horton <timothy_horton@apple.com>
TileController can fail to receive exposedRect from the drawing area if set at the wrong time
https://bugs.webkit.org/show_bug.cgi?id=126536
Reviewed by Simon Fraser.
* WebCore.exp.in:
Export some things.
* page/FrameView.cpp:
(WebCore::FrameView::FrameView):
(WebCore::FrameView::setExposedRect):
Store the exposed rect on FrameView. When it changes, if the main frame
has a TiledBacking, inform it of the change.
* page/FrameView.h:
* platform/graphics/TiledBacking.h:
* platform/graphics/ca/mac/TileController.h:
* platform/graphics/ca/mac/TileController.mm:
(WebCore::TileController::TileController):
(WebCore::TileController::tilesWouldChangeForVisibleRect):
(WebCore::TileController::computeTileCoverageRect):
(WebCore::TileController::revalidateTiles):
(WebCore::TileController::updateTileCoverageMap):
Make use of the fact that we can test if a rect is infinite
instead of having a separate boolean property for that.
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::RenderLayerBacking):
(WebCore::computeTileCoverage):
Push the FrameView's cached exposed rect down into the TiledBacking when it is created.
We only support clipping for the main frame TileController for now.
2014-01-07 Myles C. Maxfield <mmaxfield@apple.com>
a fractional value of the css letter-spacing property is not rendered as expected
......@@ -1268,6 +1268,7 @@ __ZN7WebCore9FrameView13paintContentsEPNS_15GraphicsContextERKNS_7IntRectE
__ZN7WebCore9FrameView13setNodeToDrawEPNS_4NodeE
__ZN7WebCore9FrameView14adjustViewSizeEv
__ZN7WebCore9FrameView14invalidateRectERKNS_7IntRectE
__ZN7WebCore9FrameView14setExposedRectENS_9FloatRectE
__ZN7WebCore9FrameView14setNeedsLayoutEv
__ZN7WebCore9FrameView14setTransparentEb
__ZN7WebCore9FrameView15setFooterHeightEi
......@@ -1859,6 +1860,7 @@ __ZThn???_N7WebCore15GraphicsLayerCA40platformCALayerSetNeedsToRevalidateTilesEv
__ZThn???_NK7WebCore15GraphicsLayerCA32platformCALayerDeviceScaleFactorEv
__ZThn???_NK7WebCore15GraphicsLayerCA33platformCALayerShowRepaintCounterEPNS_15PlatformCALayerE
__ZThn???_NK7WebCore15GraphicsLayerCA49platformCALayerContentsScaleMultiplierForNewTilesEPNS_15PlatformCALayerE
__ZThn???_NK7WebCore15GraphicsLayerCA26platformCALayerExposedRectEv
_filenameByFixingIllegalCharacters
_hasCaseInsensitivePrefix
_hasCaseInsensitiveSubstring
......
......@@ -201,6 +201,7 @@ FrameView::FrameView(Frame& frame)
, m_deferredRepaintTimer(this, &FrameView::deferredRepaintTimerFired)
, m_isTrackingRepaints(false)
, m_shouldUpdateWhileOffscreen(true)
, m_exposedRect(FloatRect::infiniteRect())
, m_deferSetNeedsLayouts(0)
, m_setNeedsLayoutWasDeferred(false)
#if PLATFORM(IOS)
......@@ -4371,4 +4372,20 @@ void FrameView::notifyWidgets(WidgetNotification notification)
protectedWidgets[i]->notifyWidget(notification);
}
void FrameView::setExposedRect(FloatRect exposedRect)
{
if (m_exposedRect == exposedRect)
return;
m_exposedRect = exposedRect;
#if USE(ACCELERATED_COMPOSITING)
// FIXME: We should support clipping to the exposed rect for subframes as well.
if (m_frame->isMainFrame()) {
if (TiledBacking* tiledBacking = this->tiledBacking())
tiledBacking->setExposedRect(exposedRect);
}
#endif
}
} // namespace WebCore
......@@ -445,6 +445,13 @@ public:
void addTrackedRepaintRect(const IntRect&);
// exposedRect represents WebKit's understanding of what part
// of the view is actually exposed on screen (taking into account
// clipping by other UI elements), whereas visibleContentRect is
// internal to WebCore and doesn't respect those things.
void setExposedRect(FloatRect);
FloatRect exposedRect() const { return m_exposedRect; }
protected:
virtual bool scrollContentsFastPath(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect) OVERRIDE;
virtual void scrollContentsSlowPath(const IntRect& updateRect) OVERRIDE;
......@@ -630,6 +637,8 @@ private:
bool m_shouldUpdateWhileOffscreen;
FloatRect m_exposedRect;
unsigned m_deferSetNeedsLayouts;
bool m_setNeedsLayoutWasDeferred;
......
......@@ -48,8 +48,6 @@ public:
virtual bool tilesWouldChangeForVisibleRect(const FloatRect&) const = 0;
virtual void setExposedRect(const FloatRect&) = 0;
virtual void setClipsToExposedRect(bool) = 0;
virtual bool clipsToExposedRect() = 0;
virtual void prepopulateRect(const FloatRect&) = 0;
......
......@@ -103,8 +103,6 @@ private:
virtual void setVisibleRect(const FloatRect&) OVERRIDE;
virtual bool tilesWouldChangeForVisibleRect(const FloatRect&) const OVERRIDE;
virtual void setExposedRect(const FloatRect&) OVERRIDE;
virtual bool clipsToExposedRect() OVERRIDE { return m_clipsToExposedRect; }
virtual void setClipsToExposedRect(bool) OVERRIDE;
virtual void prepopulateRect(const FloatRect&) OVERRIDE;
virtual void setIsInWindow(bool) OVERRIDE;
virtual void setTileCoverage(TileCoverage) OVERRIDE;
......@@ -245,7 +243,6 @@ private:
bool m_unparentsOffscreenTiles;
bool m_acceleratesDrawing;
bool m_tilesAreOpaque;
bool m_clipsToExposedRect;
bool m_hasTilesWithTemporaryScaleFactor; // Used to make low-res tiles when zooming.
Color m_tileDebugBorderColor;
......
......@@ -52,6 +52,7 @@ PassOwnPtr<TileController> TileController::create(PlatformCALayer* rootPlatformL
TileController::TileController(PlatformCALayer* rootPlatformLayer)
: m_tileCacheLayer(rootPlatformLayer)
, m_tileSize(defaultTileWidth, defaultTileHeight)
, m_exposedRect(FloatRect::infiniteRect())
, m_tileRevalidationTimer(this, &TileController::tileRevalidationTimerFired)
, m_cohortRemovalTimer(this, &TileController::cohortRemovalTimerFired)
, m_scale(1)
......@@ -67,7 +68,6 @@ TileController::TileController(PlatformCALayer* rootPlatformLayer)
, m_unparentsOffscreenTiles(false)
, m_acceleratesDrawing(false)
, m_tilesAreOpaque(false)
, m_clipsToExposedRect(false)
, m_hasTilesWithTemporaryScaleFactor(false)
, m_tileDebugBorderWidth(0)
, m_indicatorMode(AsyncScrollingIndication)
......@@ -277,9 +277,7 @@ void TileController::setVisibleRect(const FloatRect& visibleRect)
bool TileController::tilesWouldChangeForVisibleRect(const FloatRect& newVisibleRect) const
{
FloatRect visibleRect = newVisibleRect;
if (m_clipsToExposedRect)
visibleRect.intersect(m_exposedRect);
visibleRect.intersect(m_exposedRect);
if (visibleRect.isEmpty() || bounds().isEmpty())
return false;
......@@ -312,18 +310,6 @@ void TileController::setExposedRect(const FloatRect& exposedRect)
setNeedsRevalidateTiles();
}
void TileController::setClipsToExposedRect(bool clipsToExposedRect)
{
if (m_clipsToExposedRect == clipsToExposedRect)
return;
m_clipsToExposedRect = clipsToExposedRect;
// Going from not clipping to clipping, we don't need to revalidate right away.
if (clipsToExposedRect)
setNeedsRevalidateTiles();
}
void TileController::prepopulateRect(const FloatRect& rect)
{
FloatRect scaledRect(rect);
......@@ -487,9 +473,7 @@ void TileController::getTileIndexRangeForRect(const IntRect& rect, TileIndex& to
FloatRect TileController::computeTileCoverageRect(const FloatRect& previousVisibleRect, const FloatRect& currentVisibleRect) const
{
FloatRect visibleRect = currentVisibleRect;
if (m_clipsToExposedRect)
visibleRect.intersect(m_exposedRect);
visibleRect.intersect(m_exposedRect);
// 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.
if (!m_isInWindow)
......@@ -688,8 +672,7 @@ void TileController::revalidateTiles(TileValidationPolicyFlags foregroundValidat
FloatRect visibleRect = m_visibleRect;
IntRect bounds = this->bounds();
if (m_clipsToExposedRect)
visibleRect.intersect(m_exposedRect);
visibleRect.intersect(m_exposedRect);
if (visibleRect.isEmpty() || bounds.isEmpty())
return;
......@@ -932,9 +915,7 @@ void TileController::updateTileCoverageMap()
FloatRect containerBounds = bounds();
FloatRect visibleRect = this->visibleRect();
if (m_clipsToExposedRect)
visibleRect.intersect(m_exposedRect);
visibleRect.intersect(m_exposedRect);
visibleRect.contract(4, 4); // Layer is positioned 2px from top and left edges.
float widthScale = 1;
......@@ -948,7 +929,7 @@ void TileController::updateTileCoverageMap()
FloatRect mapBounds = containerBounds;
mapBounds.scale(indicatorScale, indicatorScale);
if (m_clipsToExposedRect)
if (!m_exposedRect.isInfinite())
m_tiledScrollingIndicatorLayer->setPosition(m_exposedRect.location() + FloatPoint(2, 2));
else
m_tiledScrollingIndicatorLayer->setPosition(FloatPoint(2, 2));
......
......@@ -142,6 +142,7 @@ RenderLayerBacking::RenderLayerBacking(RenderLayer& layer)
tiledBacking->setIsInWindow(page->isInWindow());
if (m_isMainFrameRenderViewLayer) {
tiledBacking->setExposedRect(renderer().frame().view()->exposedRect());
tiledBacking->setUnparentsOffscreenTiles(true);
if (page->settings().backgroundShouldExtendBeyondPage())
tiledBacking->setTileMargins(512, 512, 512, 512);
......@@ -228,7 +229,7 @@ static TiledBacking::TileCoverage computeTileCoverage(RenderLayerBacking* backin
backing->setDidSwitchToFullTileCoverageDuringLoading();
}
if (!(useMinimalTilesDuringLoading || useMinimalTilesDuringLiveResize)) {
bool clipsToExposedRect = backing->tiledBacking()->clipsToExposedRect();
bool clipsToExposedRect = !frameView.exposedRect().isInfinite();
if (frameView.horizontalScrollbarMode() != ScrollbarAlwaysOff || clipsToExposedRect)
tileCoverage |= TiledBacking::CoverageForHorizontalScrolling;
......
2014-01-08 Tim Horton <timothy_horton@apple.com>
TileController can fail to receive exposedRect from the drawing area if set at the wrong time
https://bugs.webkit.org/show_bug.cgi?id=126536
Reviewed by Simon Fraser.
* Configurations/WebKit2.xcconfig:
* UIProcess/API/mac/WKView.mm:
(-[WKView _updateViewExposedRect]):
* UIProcess/DrawingAreaProxy.cpp:
(WebKit::DrawingAreaProxy::DrawingAreaProxy):
(WebKit::DrawingAreaProxy::setExposedRect):
(WebKit::DrawingAreaProxy::exposedRectChangedTimerFired):
* UIProcess/DrawingAreaProxy.h:
(WebKit::DrawingAreaProxy::exposedRect):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
(WebKit::WebPageProxy::close):
* UIProcess/WebPageProxy.h:
Move exposedRect stuff from WebPageProxy to DrawingAreaProxy.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
Push the exposedRect down into WebCore.
* WebProcess/WebPage/DrawingArea.h:
* WebProcess/WebPage/DrawingArea.messages.in:
* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea):
(WebKit::RemoteLayerTreeDrawingArea::updateScrolledExposedRect):
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::TiledCoreAnimationDrawingArea):
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):
(WebKit::TiledCoreAnimationDrawingArea::updateScrolledExposedRect):
(WebKit::TiledCoreAnimationDrawingArea::setRootCompositingLayer):
(WebKit::TiledCoreAnimationDrawingArea::createPageOverlayLayer):
(WebKit::TiledCoreAnimationDrawingArea::didCommitChangesForLayer):
Get rid of "clipsToExposedRect", we just use infinite-ness of the rect
to indicate that now.
Don't scroll an infinite rect; it won't work.
2014-01-08 Simon Fraser <simon.fraser@apple.com>
Add ENABLE(ASYNC_SCROLLING) guards around WK2 scrolling files
......
......@@ -390,7 +390,7 @@ struct WKViewInterpretKeyEventsParameters {
if (_data->_useContentPreparationRectForVisibleRect)
exposedRect = NSUnionRect(_data->_contentPreparationRect, exposedRect);
_data->_page->viewExposedRectChanged(exposedRect, _data->_clipsToVisibleRect ? WebPageProxy::ClipsToExposedRect::Clip : WebPageProxy::ClipsToExposedRect::DoNotClip);
_data->_page->drawingArea()->setExposedRect(_data->_clipsToVisibleRect ? FloatRect(exposedRect) : FloatRect::infiniteRect());
}
- (void)setFrameSize:(NSSize)size
......
......@@ -26,6 +26,7 @@
#include "config.h"
#include "DrawingAreaProxy.h"
#include "DrawingAreaMessages.h"
#include "DrawingAreaProxyMessages.h"
#include "WebPageProxy.h"
#include "WebProcessProxy.h"
......@@ -38,6 +39,9 @@ DrawingAreaProxy::DrawingAreaProxy(DrawingAreaType type, WebPageProxy* webPagePr
: m_type(type)
, m_webPageProxy(webPageProxy)
, m_size(webPageProxy->viewSize())
#if PLATFORM(MAC)
, m_exposedRectChangedTimer(this, &DrawingAreaProxy::exposedRectChangedTimerFired)
#endif
{
m_webPageProxy->process().addMessageReceiver(Messages::DrawingAreaProxy::messageReceiverName(), webPageProxy->pageID(), *this);
}
......@@ -58,4 +62,29 @@ void DrawingAreaProxy::setSize(const IntSize& size, const IntSize& layerPosition
sizeDidChange();
}
#if PLATFORM(MAC)
void DrawingAreaProxy::setExposedRect(const FloatRect& exposedRect)
{
if (!m_webPageProxy->isValid())
return;
m_exposedRect = exposedRect;
if (!m_exposedRectChangedTimer.isActive())
m_exposedRectChangedTimer.startOneShot(0);
}
void DrawingAreaProxy::exposedRectChangedTimerFired(Timer<DrawingAreaProxy>*)
{
if (!m_webPageProxy->isValid())
return;
if (m_exposedRect == m_lastSentExposedRect)
return;
m_webPageProxy->process().send(Messages::DrawingArea::SetExposedRect(m_exposedRect), m_webPageProxy->pageID());
m_lastSentExposedRect = m_exposedRect;
}
#endif
} // namespace WebKit
......@@ -29,9 +29,10 @@
#include "DrawingAreaInfo.h"
#include "MessageReceiver.h"
#include <WebCore/FloatPoint.h>
#include <WebCore/FloatRect.h>
#include <WebCore/IntRect.h>
#include <WebCore/IntSize.h>
#include <WebCore/Timer.h>
#include <chrono>
#include <stdint.h>
#include <wtf/Noncopyable.h>
......@@ -72,6 +73,12 @@ public:
virtual void adjustTransientZoom(double, WebCore::FloatPoint) { }
virtual void commitTransientZoom(double, WebCore::FloatPoint) { }
#if PLATFORM(MAC)
void setExposedRect(const WebCore::FloatRect&);
WebCore::FloatRect exposedRect() const { return m_exposedRect; }
void exposedRectChangedTimerFired(WebCore::Timer<DrawingAreaProxy>*);
#endif
protected:
explicit DrawingAreaProxy(DrawingAreaType, WebPageProxy*);
......@@ -100,6 +107,10 @@ private:
#if PLATFORM(MAC)
virtual void didUpdateGeometry() { }
virtual void intrinsicContentSizeDidChange(const WebCore::IntSize& newIntrinsicContentSize) { }
WebCore::Timer<DrawingAreaProxy> m_exposedRectChangedTimer;
WebCore::FloatRect m_exposedRect;
WebCore::FloatRect m_lastSentExposedRect;
#endif
};
......
......@@ -308,11 +308,6 @@ WebPageProxy::WebPageProxy(PageClient& pageClient, WebProcessProxy& process, Web
, m_mediaVolume(1)
, m_mayStartMediaWhenInWindow(true)
, m_waitingForDidUpdateViewState(false)
#if PLATFORM(MAC)
, m_exposedRectChangedTimer(this, &WebPageProxy::exposedRectChangedTimerFired)
, m_clipsToExposedRect(ClipsToExposedRect::DoNotClip)
, m_lastSentClipsToExposedRect(ClipsToExposedRect::DoNotClip)
#endif
, m_scrollPinningBehavior(DoNotPin)
{
updateViewState();
......@@ -562,10 +557,6 @@ void WebPageProxy::close()
m_contextMenuClient.initialize(0);
#endif
#if PLATFORM(MAC) && !PLATFORM(IOS)
m_exposedRectChangedTimer.stop();
#endif
m_process->send(Messages::WebPage::Close(), m_pageID);
m_process->removeWebPage(m_pageID);
m_process->removeMessageReceiver(Messages::WebPageProxy::messageReceiverName(), m_pageID);
......@@ -4420,31 +4411,4 @@ void WebPageProxy::setScrollPinningBehavior(ScrollPinningBehavior pinning)
m_process->send(Messages::WebPage::SetScrollPinningBehavior(pinning), m_pageID);
}
#if PLATFORM(MAC) || PLATFORM(IOS)
void WebPageProxy::viewExposedRectChanged(const FloatRect& exposedRect, ClipsToExposedRect clipsToExposedRect)
{
if (!isValid())
return;
m_exposedRect = exposedRect;
m_clipsToExposedRect = clipsToExposedRect;
if (!m_exposedRectChangedTimer.isActive())
m_exposedRectChangedTimer.startOneShot(0);
}
void WebPageProxy::exposedRectChangedTimerFired(Timer<WebPageProxy>*)
{
if (!isValid())
return;
if (m_exposedRect == m_lastSentExposedRect && m_clipsToExposedRect == m_lastSentClipsToExposedRect)
return;
process().send(Messages::WebPage::ViewExposedRectChanged(m_exposedRect, m_clipsToExposedRect == ClipsToExposedRect::Clip), m_pageID);
m_lastSentExposedRect = m_exposedRect;
m_lastSentClipsToExposedRect = m_clipsToExposedRect;
}
#endif
} // namespace WebKit
......@@ -472,10 +472,6 @@ public:
#if PLATFORM(MAC)
void windowAndViewFramesChanged(const WebCore::FloatRect& viewFrameInWindowCoordinates, const WebCore::FloatPoint& accessibilityViewCoordinates);
enum class ClipsToExposedRect { DoNotClip, Clip };
void viewExposedRectChanged(const WebCore::FloatRect& exposedRect, ClipsToExposedRect);
WebCore::FloatRect viewExposedRect() const { return m_exposedRect; }
void exposedRectChangedTimerFired(WebCore::Timer<WebPageProxy>*);
void setMainFrameIsScrollable(bool);
void setComposition(const String& text, Vector<WebCore::CompositionUnderline> underlines, uint64_t selectionStart, uint64_t selectionEnd, uint64_t replacementRangeStart, uint64_t replacementRangeEnd);
......@@ -1373,14 +1369,6 @@ private:
bool m_waitingForDidUpdateViewState;
#if PLATFORM(MAC)
WebCore::Timer<WebPageProxy> m_exposedRectChangedTimer;
WebCore::FloatRect m_exposedRect;
WebCore::FloatRect m_lastSentExposedRect;
ClipsToExposedRect m_clipsToExposedRect;
ClipsToExposedRect m_lastSentClipsToExposedRect;
#endif
#if PLATFORM(MAC)
HashMap<String, String> m_temporaryPDFFiles;
#endif
......
......@@ -1238,6 +1238,7 @@ void WebFrameLoaderClient::transitionToCommittedForNewPage()
m_frame->coreFrame()->view()->setProhibitsScrolling(shouldDisableScrolling);
m_frame->coreFrame()->view()->setVisualUpdatesAllowedByClient(!webPage->shouldExtendIncrementalRenderingSuppression());
m_frame->coreFrame()->view()->setExposedRect(webPage->drawingArea()->exposedRect());
#if PLATFORM(IOS)
m_frame->coreFrame()->view()->setDelegatesScrolling(true);
#endif
......
......@@ -28,7 +28,7 @@
#include "DrawingAreaInfo.h"
#include "LayerTreeContext.h"
#include <WebCore/FloatPoint.h>
#include <WebCore/FloatRect.h>
#include <WebCore/IntRect.h>
#include <WebCore/ViewState.h>
#include <wtf/Forward.h>
......@@ -86,8 +86,8 @@ public:
virtual void updatePreferences(const WebPreferencesStore&) { }
virtual void mainFrameContentSizeChanged(const WebCore::IntSize&) { }
virtual void setExposedRect(const WebCore::FloatRect&) { }
virtual void setClipsToExposedRect(bool) { }
virtual void setExposedRect(const WebCore::FloatRect&) = 0;
virtual WebCore::FloatRect exposedRect() const = 0;
virtual void mainFrameScrollabilityChanged(bool) { }
virtual bool supportsAsyncScrolling() { return false; }
......
......@@ -29,7 +29,8 @@ messages -> DrawingArea LegacyReceiver {
UpdateGeometry(WebCore::IntSize viewSize, WebCore::IntSize layerPosition)
SetDeviceScaleFactor(float deviceScaleFactor)
SetColorSpace(WebKit::ColorSpaceData colorSpace)
SetExposedRect(WebCore::FloatRect exposedRect)
AdjustTransientZoom(double scale, WebCore::FloatPoint origin)
CommitTransientZoom(double scale, WebCore::FloatPoint origin)
#endif
......
......@@ -3075,12 +3075,6 @@ void WebPage::windowAndViewFramesChanged(const FloatRect& windowFrameInScreenCoo
}
#endif
void WebPage::viewExposedRectChanged(const FloatRect& exposedRect, bool clipsToExposedRect)
{
m_drawingArea->setExposedRect(exposedRect);
m_drawingArea->setClipsToExposedRect(clipsToExposedRect);
}
void WebPage::setMainFrameIsScrollable(bool isScrollable)
{
m_mainFrameIsScrollable = isScrollable;
......
......@@ -802,7 +802,6 @@ private:
void drawPagesToPDFFromPDFDocument(CGContextRef, PDFDocument *, const PrintInfo&, uint32_t first, uint32_t count);
#endif
void viewExposedRectChanged(const WebCore::FloatRect& exposedRect, bool clipsToExposedRect);
void setMainFrameIsScrollable(bool);
void unapplyEditCommand(uint64_t commandID);
......
......@@ -268,7 +268,6 @@ messages -> WebPage LegacyReceiver {
SendComplexTextInputToPlugin(uint64_t pluginComplexTextInputIdentifier, String textInput)
WindowAndViewFramesChanged(WebCore::FloatRect windowFrameInScreenCoordinates, WebCore::FloatRect windowFrameInUnflippedScreenCoordinates, WebCore::FloatRect viewFrameInWindowCoordinates, WebCore::FloatPoint accessibilityViewCoordinates)
ViewExposedRectChanged(WebCore::FloatRect exposedRect, bool clipsToExposedRect)
SetMainFrameIsScrollable(bool isScrollable)
RegisterUIProcessAccessibilityTokens(IPC::DataReference elemenToken, IPC::DataReference windowToken)
GetStringSelectionForPasteboard() -> (String stringValue)
......
......@@ -72,7 +72,7 @@ private:
virtual bool forceRepaintAsync(uint64_t) OVERRIDE { return false; }
virtual void setExposedRect(const WebCore::FloatRect&) OVERRIDE;
virtual void setClipsToExposedRect(bool) OVERRIDE;
virtual WebCore::FloatRect exposedRect() const OVERRIDE { return m_scrolledExposedRect; }
// WebCore::GraphicsLayerClient
virtual void notifyAnimationStarted(const WebCore::GraphicsLayer*, double time) OVERRIDE { }
......@@ -85,7 +85,6 @@ private:
virtual bool allowCompositingLayerVisualDegradation() const OVERRIDE { return false; }
#endif
void updateMainFrameClipsToExposedRect();
void updateScrolledExposedRect();
void layerFlushTimerFired(WebCore::Timer<RemoteLayerTreeDrawingArea>*);
......@@ -102,7 +101,6 @@ private:
WebCore::FloatRect m_exposedRect;
WebCore::FloatRect m_scrolledExposedRect;
bool m_clipsToExposedRect;
WebCore::Timer<RemoteLayerTreeDrawingArea> m_layerFlushTimer;
bool m_isFlushingSuspended;
......
......@@ -46,7 +46,8 @@ namespace WebKit {
RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea(WebPage* webPage, const WebPageCreationParameters&)
: DrawingArea(DrawingAreaTypeRemoteLayerTree, webPage)
, m_remoteLayerTreeContext(std::make_unique<RemoteLayerTreeContext>(webPage))
, m_clipsToExposedRect(false)
, m_exposedRect(FloatRect::infiniteRect())
, m_scrolledExposedRect(FloatRect::infiniteRect())
, m_layerFlushTimer(this, &RemoteLayerTreeDrawingArea::layerFlushTimerFired)
, m_isFlushingSuspended(false)
, m_hasDeferredFlush(false)
......@@ -54,7 +55,6 @@ RemoteLayerTreeDrawingArea::RemoteLayerTreeDrawingArea(WebPage* webPage, const W
webPage->corePage()->settings().setForceCompositingMode(true);
#if PLATFORM(IOS)
webPage->corePage()->settings().setDelegatesPageScaling(true);
setClipsToExposedRect(true);
#endif
}
......@@ -234,18 +234,8 @@ void RemoteLayerTreeDrawingArea::setExposedRect(const FloatRect& exposedRect)
updateScrolledExposedRect();
}
void RemoteLayerTreeDrawingArea::setClipsToExposedRect(bool clipsToExposedRect)
{
m_clipsToExposedRect = clipsToExposedRect;
updateScrolledExposedRect();
updateMainFrameClipsToExposedRect();
}
void RemoteLayerTreeDrawingArea::updateScrolledExposedRect()
{
if (!m_clipsToExposedRect)
return;
FrameView* frameView = m_webPage->corePage()->mainFrame().view();
if (!frameView)
return;
......@@ -253,30 +243,18 @@ void RemoteLayerTreeDrawingArea::updateScrolledExposedRect()
m_scrolledExposedRect = m_exposedRect;
#if !PLATFORM(IOS)
IntPoint scrollPositionWithOrigin = frameView->scrollPosition() + toIntSize(frameView->scrollOrigin());
m_scrolledExposedRect.moveBy(scrollPositionWithOrigin);
if (!m_exposedRect.isInfinite()) {
IntPoint scrollPositionWithOrigin = frameView->scrollPosition() + toIntSize(frameView->scrollOrigin());
m_scrolledExposedRect.moveBy(scrollPositionWithOrigin);
}
#endif
mainFrameTiledBacking()->setExposedRect(m_scrolledExposedRect);
frameView->setExposedRect(m_scrolledExposedRect);
for (auto it = m_pageOverlayLayers.begin(), end = m_pageOverlayLayers.end(); it != end; ++it) {
if (TiledBacking* tiledBacking = it->value->tiledBacking())
for (const auto& layer : m_pageOverlayLayers.values()) {
if (TiledBacking* tiledBacking = layer->tiledBacking())
tiledBacking->setExposedRect(m_scrolledExposedRect);
}
}
void RemoteLayerTreeDrawingArea::updateMainFrameClipsToExposedRect()
{
if (TiledBacking* tiledBacking = mainFrameTiledBacking())
tiledBacking->setClipsToExposedRect(m_clipsToExposedRect);
for (auto it = m_pageOverlayLayers.begin(), end = m_pageOverlayLayers.end(); it != end; ++it)
if (TiledBacking* tiledBacking = it->value->tiledBacking())
tiledBacking->setClipsToExposedRect(m_clipsToExposedRect);