Changeset 171191 in webkit


Ignore:
Timestamp:
Jul 17, 2014 12:19:37 PM (10 years ago)
Author:
timothy_horton@apple.com
Message:

Sometimes purgeable (or empty!) tiles are shown on screen when resuming the app
https://bugs.webkit.org/show_bug.cgi?id=135018
<rdar://problem/17615038>

Reviewed by Simon Fraser.

  • UIProcess/DrawingAreaProxy.h:

(WebKit::DrawingAreaProxy::hideContentUntilNextUpdate):

  • UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
  • UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:

(WebKit::RemoteLayerTreeDrawingAreaProxy::hideContentUntilNextUpdate):

  • UIProcess/mac/RemoteLayerTreeHost.h:
  • UIProcess/mac/RemoteLayerTreeHost.mm:

(WebKit::RemoteLayerTreeHost::detachRootLayer):
Add a mechanism to "hide" drawing area content until the next commit,
by detaching the root layer. RemoteLayerTreeHost will automatically reattach
it at the next commit.

  • UIProcess/WebPageProxy.cpp:

(WebKit::WebPageProxy::viewStateDidChange):

  • UIProcess/WebPageProxy.h:

Add a parameter to viewStateDidChange specifying whether dispatching the change
to the Web process is deferrable or not. We will also automatically use "Immediate" if
the view is coming in-window, like we did before.

  • UIProcess/ios/WKContentView.mm:

(-[WKContentView _applicationWillEnterForeground:]):
Make use of the aforementioned new mechanisms to ensure that we immediately dispatch
view state changes when coming into the foreground, and will have removed the root layer
if a commit didn't come in while waitForDidUpdateViewState blocks.

Location:
trunk/Source/WebKit2
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit2/ChangeLog

    r171182 r171191  
     12014-07-17  Tim Horton  <timothy_horton@apple.com>
     2
     3        Sometimes purgeable (or empty!) tiles are shown on screen when resuming the app
     4        https://bugs.webkit.org/show_bug.cgi?id=135018
     5        <rdar://problem/17615038>
     6
     7        Reviewed by Simon Fraser.
     8
     9        * UIProcess/DrawingAreaProxy.h:
     10        (WebKit::DrawingAreaProxy::hideContentUntilNextUpdate):
     11        * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h:
     12        * UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm:
     13        (WebKit::RemoteLayerTreeDrawingAreaProxy::hideContentUntilNextUpdate):
     14        * UIProcess/mac/RemoteLayerTreeHost.h:
     15        * UIProcess/mac/RemoteLayerTreeHost.mm:
     16        (WebKit::RemoteLayerTreeHost::detachRootLayer):
     17        Add a mechanism to "hide" drawing area content until the next commit,
     18        by detaching the root layer. RemoteLayerTreeHost will automatically reattach
     19        it at the next commit.
     20
     21        * UIProcess/WebPageProxy.cpp:
     22        (WebKit::WebPageProxy::viewStateDidChange):
     23        * UIProcess/WebPageProxy.h:
     24        Add a parameter to viewStateDidChange specifying whether dispatching the change
     25        to the Web process is deferrable or not. We will also automatically use "Immediate" if
     26        the view is coming in-window, like we did before.
     27
     28        * UIProcess/ios/WKContentView.mm:
     29        (-[WKContentView _applicationWillEnterForeground:]):
     30        Make use of the aforementioned new mechanisms to ensure that we immediately dispatch
     31        view state changes when coming into the foreground, and will have removed the root layer
     32        if a commit didn't come in while waitForDidUpdateViewState blocks.
     33       
    1342014-07-17  Sanghyup Lee  <sh53.lee@samsung.com>
    235
  • trunk/Source/WebKit2/UIProcess/DrawingAreaProxy.h

    r170838 r171191  
    8989    virtual void dispatchAfterEnsuringDrawing(std::function<void (CallbackBase::Error)>) { ASSERT_NOT_REACHED(); }
    9090
     91    virtual void hideContentUntilNextUpdate() { ASSERT_NOT_REACHED(); }
     92
    9193protected:
    9294    explicit DrawingAreaProxy(DrawingAreaType, WebPageProxy*);
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp

    r171167 r171191  
    11311131}
    11321132
    1133 void WebPageProxy::viewStateDidChange(ViewState::Flags mayHaveChanged, bool wantsReply)
     1133void WebPageProxy::viewStateDidChange(ViewState::Flags mayHaveChanged, bool wantsReply, ViewStateChangeDispatchMode dispatchMode)
    11341134{
    11351135    m_potentiallyChangedViewStateFlags |= mayHaveChanged;
     
    11371137
    11381138#if PLATFORM(COCOA)
    1139     if (!isInWindow() && (mayHaveChanged & ViewState::IsInWindow) && m_pageClient.isViewInWindow()) {
     1139    bool isNewlyInWindow = !isInWindow() && (mayHaveChanged & ViewState::IsInWindow) && m_pageClient.isViewInWindow();
     1140    if (dispatchMode == ViewStateChangeDispatchMode::Immediate || isNewlyInWindow) {
    11401141        dispatchViewStateChange();
    11411142        return;
  • trunk/Source/WebKit2/UIProcess/WebPageProxy.h

    r171154 r171191  
    361361    bool delegatesScrolling() const { return m_delegatesScrolling; }
    362362
    363     void viewStateDidChange(WebCore::ViewState::Flags mayHaveChanged, bool wantsReply = false);
     363    enum class ViewStateChangeDispatchMode { Deferrable, Immediate };
     364    void viewStateDidChange(WebCore::ViewState::Flags mayHaveChanged, bool wantsReply = false, ViewStateChangeDispatchMode = ViewStateChangeDispatchMode::Deferrable);
    364365    bool isInWindow() const { return m_viewState & WebCore::ViewState::IsInWindow; }
    365366    void waitForDidUpdateViewState();
  • trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm

    r171080 r171191  
    512512{
    513513    _page->applicationWillEnterForeground();
    514     _page->viewStateDidChange(ViewState::AllFlags & ~ViewState::IsInWindow, true);
     514    _page->drawingArea()->hideContentUntilNextUpdate();
     515    _page->viewStateDidChange(ViewState::AllFlags & ~ViewState::IsInWindow, true, WebPageProxy::ViewStateChangeDispatchMode::Immediate);
    515516}
    516517
  • trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.h

    r171068 r171191  
    7676
    7777    virtual void waitForDidUpdateViewState() override;
     78    virtual void hideContentUntilNextUpdate() override;
    7879   
    7980    WebCore::FloatPoint indicatorLocation() const;
  • trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeDrawingAreaProxy.mm

    r171087 r171191  
    399399}
    400400
     401void RemoteLayerTreeDrawingAreaProxy::hideContentUntilNextUpdate()
     402{
     403    m_remoteLayerTreeHost.detachRootLayer();
     404}
     405
    401406} // namespace WebKit
  • trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.h

    r169851 r171191  
    6464    void clearLayers();
    6565
     66    // Detach the root layer; it will be reattached upon the next incoming commit.
     67    void detachRootLayer();
     68
    6669private:
    6770    LayerOrView *createLayer(const RemoteLayerTreeTransaction::LayerCreationProperties&, const RemoteLayerTreeTransaction::LayerProperties*);
  • trunk/Source/WebKit2/UIProcess/mac/RemoteLayerTreeHost.mm

    r170864 r171191  
    221221#endif
    222222
     223void RemoteLayerTreeHost::detachRootLayer()
     224{
     225#if PLATFORM(IOS)
     226    [m_rootLayer removeFromSuperview];
     227#else
     228    [asLayer(m_rootLayer) removeFromSuperlayer];
     229#endif
     230    m_rootLayer = nullptr;
     231}
     232
    223233} // namespace WebKit
Note: See TracChangeset for help on using the changeset viewer.