Changeset 86956 in webkit


Ignore:
Timestamp:
May 20, 2011 8:50:55 AM (13 years ago)
Author:
jer.noble@apple.com
Message:

2011-05-20 Jer Noble <jer.noble@apple.com>

Reviewed by Maciej Stachowiak.

Win: non-full-screen content is briefly seen when entering full-screen mode (and vice versa)
https://bugs.webkit.org/show_bug.cgi?id=61108

Instead of repainting the full- and non-full-screen windows in WebCore, delegate that
responsibility to the FullScreenControllerClient. Because the repaint operation may
be asynchronous, add a new method for clients to use to indicate repainting has completed.

  • platform/graphics/win/FullScreenController.cpp: (FullScreenController::Private::Private): Added new ivars. (FullScreenController::enterFullScreen): Split into two functions (pre-and post repaint) (FullScreenController::enterFullScreenRepaintCompleted): Ditto. (FullScreenController::exitFullScreen): Ditto. (FullScreenController::exitFullScreenRepaintCompleted): Ditto. (FullScreenController::repaintCompleted): Call the appropriated repaint completed function.
  • platform/graphics/win/FullScreenController.h:
  • platform/graphics/win/FullScreenControllerClient.h:

2011-05-20 Jer Noble <jer.noble@apple.com>

Reviewed by Maciej Stachowiak.

Win: non-full-screen content is briefly seen when entering full-screen mode (and vice versa)
https://bugs.webkit.org/show_bug.cgi?id=61108

  • WebView.cpp: (WebView::fullScreenClientForceRepaint): Repaint the view and immediately notify the

full screen controller.

  • WebView.h:

2011-05-20 Jer Noble <jer.noble@apple.com>

Reviewed by Maciej Stachowiak.

Win: non-full-screen content is briefly seen when entering full-screen mode (and vice versa)
https://bugs.webkit.org/show_bug.cgi?id=61108

When the fullScreenController asks us to repaint, make an async repaint request, and when the
callback is fired, notify the fullScreenController that repaint has completed.

  • UIProcess/win/WebView.cpp: (WebKit::fullScreenClientForceRepaintCompleted): Added. (WebKit::WebView::fullScreenClientForceRepaint): Added.
  • UIProcess/win/WebView.h:
Location:
trunk/Source
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r86955 r86956  
     12011-05-20  Jer Noble  <jer.noble@apple.com>
     2
     3        Reviewed by Maciej Stachowiak.
     4
     5        Win: non-full-screen content is briefly seen when entering full-screen mode (and vice versa)
     6        https://bugs.webkit.org/show_bug.cgi?id=61108
     7
     8        Instead of repainting the full- and non-full-screen windows in WebCore, delegate that
     9        responsibility to the FullScreenControllerClient.  Because the repaint operation may
     10        be asynchronous, add a new method for clients to use to indicate repainting has completed.
     11
     12        * platform/graphics/win/FullScreenController.cpp:
     13        (FullScreenController::Private::Private): Added new ivars.
     14        (FullScreenController::enterFullScreen): Split into two functions (pre-and post repaint)
     15        (FullScreenController::enterFullScreenRepaintCompleted): Ditto.
     16        (FullScreenController::exitFullScreen): Ditto.
     17        (FullScreenController::exitFullScreenRepaintCompleted): Ditto.
     18        (FullScreenController::repaintCompleted): Call the appropriated repaint completed function.
     19        * platform/graphics/win/FullScreenController.h:
     20        * platform/graphics/win/FullScreenControllerClient.h:
     21
    1222011-05-20  Yury Semikhatsky  <yurys@chromium.org>
    223
  • trunk/Source/WebCore/platform/graphics/win/FullScreenController.cpp

    r85699 r86956  
    5050        , m_originalHost(0)
    5151        , m_isFullScreen(false)
     52        , m_isEnteringFullScreen(false)
     53        , m_isExitingFullScreen(false)
    5254    {
    5355    }
     
    6466    HWND m_originalHost;
    6567    bool m_isFullScreen;
     68    bool m_isEnteringFullScreen;
     69    bool m_isExitingFullScreen;
    6670};
    6771
     
    111115void FullScreenController::enterFullScreen()
    112116{
    113     if (m_private->m_isFullScreen)
     117    if (m_private->m_isFullScreen || m_private->m_isEnteringFullScreen)
    114118        return;
    115119    m_private->m_isFullScreen = true;
     120    m_private->m_isEnteringFullScreen = true;
    116121
    117122    m_private->m_originalHost = m_private->m_client->fullScreenClientParentWindow();
     
    127132
    128133    m_private->m_client->fullScreenClientWillEnterFullScreen();
    129 
    130134    ASSERT(!m_private->m_fullScreenWindow);
    131135    m_private->m_fullScreenWindow = adoptPtr(new MediaPlayerPrivateFullscreenWindow(m_private.get()));
     
    138142    ::SetWindowPos(m_private->m_fullScreenWindow->hwnd(), HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
    139143    ::SetWindowPos(m_private->m_client->fullScreenClientWindow(), HWND_TOP, 0, 0, viewFrame.width(), viewFrame.height(), SWP_NOACTIVATE);
    140     ::RedrawWindow(m_private->m_client->fullScreenClientWindow(), 0, 0, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE | RDW_ALLCHILDREN);
    141144
    142145    m_private->m_client->fullScreenClientDidEnterFullScreen();
     146    m_private->m_client->fullScreenClientForceRepaint();
     147}
     148
     149void FullScreenController::enterFullScreenRepaintCompleted()
     150{
     151    if (!m_private->m_isEnteringFullScreen)
     152        return;
     153    m_private->m_isEnteringFullScreen = false;
     154
    143155    ::AnimateWindow(m_private->m_fullScreenWindow->hwnd(), kFullScreenAnimationDuration, AW_BLEND | AW_ACTIVATE);
    144156}
     
    146158void FullScreenController::exitFullScreen()
    147159{
    148     if (!m_private->m_isFullScreen)
     160    if (!m_private->m_isFullScreen || m_private->m_isExitingFullScreen)
    149161        return;
    150162    m_private->m_isFullScreen = false;
     163    m_private->m_isExitingFullScreen = true;
    151164
    152165    ::AnimateWindow(m_private->m_fullScreenWindow->hwnd(), kFullScreenAnimationDuration, AW_HIDE | AW_BLEND);
     
    156169    m_private->m_fullScreenWindow = nullptr;
    157170
     171    ::SetWindowPos(m_private->m_client->fullScreenClientWindow(), 0, m_private->m_originalFrame.x(), m_private->m_originalFrame.y(), m_private->m_originalFrame.width(), m_private->m_originalFrame.height(), SWP_NOACTIVATE | SWP_NOZORDER);
     172
    158173    m_private->m_client->fullScreenClientDidExitFullScreen();
    159     ::SetWindowPos(m_private->m_client->fullScreenClientWindow(), 0, m_private->m_originalFrame.x(), m_private->m_originalFrame.y(), m_private->m_originalFrame.width(), m_private->m_originalFrame.height(), SWP_NOACTIVATE | SWP_NOZORDER);
    160     ::RedrawWindow(m_private->m_client->fullScreenClientWindow(), 0, 0, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE | RDW_ALLCHILDREN);
     174    m_private->m_client->fullScreenClientForceRepaint();
     175}
     176
     177void FullScreenController::exitFullScreenRepaintCompleted()
     178{
     179    if (!m_private->m_isExitingFullScreen)
     180        return;
     181    m_private->m_isExitingFullScreen = false;
    161182
    162183    ASSERT(m_private->m_backgroundWindow);
     
    165186}
    166187
     188void FullScreenController::repaintCompleted()
     189{
     190    if (m_private->m_isEnteringFullScreen)
     191        enterFullScreenRepaintCompleted();
     192    else if (m_private->m_isExitingFullScreen)
     193        exitFullScreenRepaintCompleted();
     194}
     195
    167196#endif
  • trunk/Source/WebCore/platform/graphics/win/FullScreenController.h

    r85699 r86956  
    4343    void enterFullScreen();
    4444    void exitFullScreen();
     45    void repaintCompleted();
    4546   
    4647    bool isFullScreen() const;
    4748
    4849protected:
     50    void enterFullScreenRepaintCompleted();
     51    void exitFullScreenRepaintCompleted();
     52
    4953    class Private;
    5054    friend class Private;
  • trunk/Source/WebCore/platform/graphics/win/FullScreenControllerClient.h

    r85699 r86956  
    4040    virtual void fullScreenClientWillExitFullScreen() = 0;
    4141    virtual void fullScreenClientDidExitFullScreen() = 0;
     42    virtual void fullScreenClientForceRepaint() = 0;
    4243protected:
    4344    virtual ~FullScreenControllerClient() { }
  • trunk/Source/WebKit/win/ChangeLog

    r86584 r86956  
     12011-05-20  Jer Noble  <jer.noble@apple.com>
     2
     3        Reviewed by Maciej Stachowiak.
     4
     5        Win: non-full-screen content is briefly seen when entering full-screen mode (and vice versa)
     6        https://bugs.webkit.org/show_bug.cgi?id=61108
     7
     8        * WebView.cpp:
     9        (WebView::fullScreenClientForceRepaint): Repaint the view and immediately notify the
     10            full screen controller.
     11        * WebView.h:
     12
    1132011-05-13  Jon Lee  <jonlee@apple.com>
    214
  • trunk/Source/WebKit/win/WebView.cpp

    r86451 r86956  
    68296829}
    68306830
     6831void WebView::fullScreenClientForceRepaint()
     6832{
     6833    ASSERT(m_fullScreenElement);
     6834    RECT windowRect = {0};
     6835    frameRect(&windowRect);
     6836    repaint(windowRect, true /*contentChanged*/, true /*immediate*/, false /*contentOnly*/);
     6837    m_fullscreenController->repaintCompleted();
     6838}
    68316839
    68326840#endif
  • trunk/Source/WebKit/win/WebView.h

    r85699 r86956  
    10321032    virtual void fullScreenClientWillExitFullScreen();
    10331033    virtual void fullScreenClientDidExitFullScreen();
     1034    virtual void fullScreenClientForceRepaint();
    10341035#endif
    10351036
  • trunk/Source/WebKit2/ChangeLog

    r86945 r86956  
     12011-05-20  Jer Noble  <jer.noble@apple.com>
     2
     3        Reviewed by Maciej Stachowiak.
     4
     5        Win: non-full-screen content is briefly seen when entering full-screen mode (and vice versa)
     6        https://bugs.webkit.org/show_bug.cgi?id=61108
     7
     8        When the fullScreenController asks us to repaint, make an async repaint request, and when the
     9        callback is fired, notify the fullScreenController that repaint has completed.
     10
     11        * UIProcess/win/WebView.cpp:
     12        (WebKit::fullScreenClientForceRepaintCompleted): Added.
     13        (WebKit::WebView::fullScreenClientForceRepaint): Added.
     14        * UIProcess/win/WebView.h:
     15
    1162011-05-19  Adam Roben  <aroben@apple.com>
    217
  • trunk/Source/WebKit2/UIProcess/win/WebView.cpp

    r86717 r86956  
    17791779}
    17801780
     1781static void fullScreenClientForceRepaintCompleted(WKErrorRef, void* context)
     1782{
     1783    ASSERT(context);
     1784    static_cast<WebView*>(context)->fullScreenController()->repaintCompleted();
     1785}
     1786
     1787void WebView::fullScreenClientForceRepaint()
     1788{
     1789    page()->forceRepaint(VoidCallback::create(this, &fullScreenClientForceRepaintCompleted));
     1790}
     1791
    17811792#endif
    17821793} // namespace WebKit
  • trunk/Source/WebKit2/UIProcess/win/WebView.h

    r86717 r86956  
    231231    virtual void fullScreenClientWillExitFullScreen();
    232232    virtual void fullScreenClientDidExitFullScreen();
     233    virtual void fullScreenClientForceRepaint();
    233234#endif
    234235
Note: See TracChangeset for help on using the changeset viewer.