From b84c3e82669db63d28f51b034d1b579f6237fbcc Mon Sep 17 00:00:00 2001 From: "simon.fraser@apple.com" Date: Sat, 3 May 2014 01:15:07 +0000 Subject: [PATCH] [iOS WK2] Tiled layer content missing on pages with animated tiled layers https://bugs.webkit.org/show_bug.cgi?id=132507 Reviewed by Tim Horton. Updating the tiling area of content TileControllers while CSS animations are running depends on GraphicsLayerUpdater triggering repeated layer flushes. With UI-side compositing, those flushes were happening, but nothing triggered RemoteLayerTreeDrawingArea to flush changes to the UI process. Fix by having RenderLayerCompositor schedule a flush, rather than just doing a flush, in response to GraphicsLayerUpdater. Also change the name of the GraphicsLayerUpdaterClient function to indicate that it suggests that a flush is required soon, rather than that the flushing has to be synchronous. * platform/graphics/GraphicsLayerUpdater.cpp: (WebCore::GraphicsLayerUpdater::displayRefreshFired): * platform/graphics/GraphicsLayerUpdater.h: * rendering/RenderLayerCompositor.cpp: (WebCore::RenderLayerCompositor::flushLayersSoon): (WebCore::RenderLayerCompositor::flushLayers): Deleted. * rendering/RenderLayerCompositor.h: git-svn-id: https://svn.webkit.org/repository/webkit/trunk@168217 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- Source/WebCore/ChangeLog | 29 ++++++++++++++++++++++ .../platform/graphics/GraphicsLayerUpdater.cpp | 2 +- .../platform/graphics/GraphicsLayerUpdater.h | 2 +- Source/WebCore/rendering/RenderLayerCompositor.cpp | 4 +-- Source/WebCore/rendering/RenderLayerCompositor.h | 7 +++--- 5 files changed, 36 insertions(+), 8 deletions(-) diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index d5e5a92..c1e7b18 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,32 @@ +2014-05-02 Simon Fraser + + [iOS WK2] Tiled layer content missing on pages with animated tiled layers + https://bugs.webkit.org/show_bug.cgi?id=132507 + + + Reviewed by Tim Horton. + + Updating the tiling area of content TileControllers while + CSS animations are running depends on GraphicsLayerUpdater + triggering repeated layer flushes. With UI-side compositing, those + flushes were happening, but nothing triggered RemoteLayerTreeDrawingArea + to flush changes to the UI process. + + Fix by having RenderLayerCompositor schedule a flush, rather + than just doing a flush, in response to GraphicsLayerUpdater. + + Also change the name of the GraphicsLayerUpdaterClient function + to indicate that it suggests that a flush is required soon, rather than + that the flushing has to be synchronous. + + * platform/graphics/GraphicsLayerUpdater.cpp: + (WebCore::GraphicsLayerUpdater::displayRefreshFired): + * platform/graphics/GraphicsLayerUpdater.h: + * rendering/RenderLayerCompositor.cpp: + (WebCore::RenderLayerCompositor::flushLayersSoon): + (WebCore::RenderLayerCompositor::flushLayers): Deleted. + * rendering/RenderLayerCompositor.h: + 2014-05-02 Jeremy Jones Use displayNameForTrack instead of textTrack->label() for captions. diff --git a/Source/WebCore/platform/graphics/GraphicsLayerUpdater.cpp b/Source/WebCore/platform/graphics/GraphicsLayerUpdater.cpp index 056992d..89867df 100644 --- a/Source/WebCore/platform/graphics/GraphicsLayerUpdater.cpp +++ b/Source/WebCore/platform/graphics/GraphicsLayerUpdater.cpp @@ -75,7 +75,7 @@ void GraphicsLayerUpdater::displayRefreshFired(double timestamp) m_scheduled = false; if (m_client) - m_client->flushLayers(this); + m_client->flushLayersSoon(this); } } // namespace WebCore diff --git a/Source/WebCore/platform/graphics/GraphicsLayerUpdater.h b/Source/WebCore/platform/graphics/GraphicsLayerUpdater.h index f4246df..58e190d 100644 --- a/Source/WebCore/platform/graphics/GraphicsLayerUpdater.h +++ b/Source/WebCore/platform/graphics/GraphicsLayerUpdater.h @@ -36,7 +36,7 @@ class GraphicsLayerUpdater; class GraphicsLayerUpdaterClient { public: virtual ~GraphicsLayerUpdaterClient() { } - virtual void flushLayers(GraphicsLayerUpdater*) = 0; + virtual void flushLayersSoon(GraphicsLayerUpdater*) = 0; }; class GraphicsLayerUpdater diff --git a/Source/WebCore/rendering/RenderLayerCompositor.cpp b/Source/WebCore/rendering/RenderLayerCompositor.cpp index a554ea9..0798da7 100644 --- a/Source/WebCore/rendering/RenderLayerCompositor.cpp +++ b/Source/WebCore/rendering/RenderLayerCompositor.cpp @@ -579,9 +579,9 @@ void RenderLayerCompositor::notifyFlushBeforeDisplayRefresh(const GraphicsLayer* m_layerUpdater->scheduleUpdate(); } -void RenderLayerCompositor::flushLayers(GraphicsLayerUpdater*) +void RenderLayerCompositor::flushLayersSoon(GraphicsLayerUpdater*) { - flushPendingLayerChanges(true); // FIXME: deal with iframes + scheduleLayerFlush(true); } void RenderLayerCompositor::layerTiledBackingUsageChanged(const GraphicsLayer*, bool usingTiledBacking) diff --git a/Source/WebCore/rendering/RenderLayerCompositor.h b/Source/WebCore/rendering/RenderLayerCompositor.h index 5916589..2a988b4 100644 --- a/Source/WebCore/rendering/RenderLayerCompositor.h +++ b/Source/WebCore/rendering/RenderLayerCompositor.h @@ -311,13 +311,12 @@ private: virtual void notifyAnimationStarted(const GraphicsLayer*, double) override { } virtual void notifyFlushRequired(const GraphicsLayer*) override; virtual void paintContents(const GraphicsLayer*, GraphicsContext&, GraphicsLayerPaintingPhase, const FloatRect&) override; - + virtual void customPositionForVisibleRectComputation(const GraphicsLayer*, FloatPoint&) const override; virtual bool isTrackingRepaints() const override; // GraphicsLayerUpdaterClient implementation - virtual void flushLayers(GraphicsLayerUpdater*) override; - virtual void customPositionForVisibleRectComputation(const GraphicsLayer*, FloatPoint&) const override; - + virtual void flushLayersSoon(GraphicsLayerUpdater*) override; + // Whether the given RL needs a compositing layer. bool needsToBeComposited(const RenderLayer&, RenderLayer::ViewportConstrainedNotCompositedReason* = 0) const; // Whether the layer has an intrinsic need for compositing layer. -- 1.8.3.1