Skip to content
Permalink
Browse files
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:

Canonical link: https://commits.webkit.org/76560@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@86956 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
jernoble committed May 20, 2011
1 parent c2987af commit e55830481905734a3681d1144b9757a21b1fc733
@@ -1,3 +1,24 @@
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 Yury Semikhatsky <yurys@chromium.org>

Reviewed by Pavel Feldman.
@@ -49,6 +49,8 @@ class FullScreenController::Private : public MediaPlayerPrivateFullscreenClient
, m_client(client)
, m_originalHost(0)
, m_isFullScreen(false)
, m_isEnteringFullScreen(false)
, m_isExitingFullScreen(false)
{
}
virtual ~Private() { }
@@ -63,6 +65,8 @@ class FullScreenController::Private : public MediaPlayerPrivateFullscreenClient
IntRect m_originalFrame;
HWND m_originalHost;
bool m_isFullScreen;
bool m_isEnteringFullScreen;
bool m_isExitingFullScreen;
};

LRESULT FullScreenController::Private::fullscreenClientWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -110,9 +114,10 @@ bool FullScreenController::isFullScreen() const

void FullScreenController::enterFullScreen()
{
if (m_private->m_isFullScreen)
if (m_private->m_isFullScreen || m_private->m_isEnteringFullScreen)
return;
m_private->m_isFullScreen = true;
m_private->m_isEnteringFullScreen = true;

m_private->m_originalHost = m_private->m_client->fullScreenClientParentWindow();
RECT originalFrame = {0, 0, 0, 0};
@@ -126,7 +131,6 @@ void FullScreenController::enterFullScreen()
::AnimateWindow(m_private->m_backgroundWindow->hwnd(), kFullScreenAnimationDuration, AW_BLEND | AW_ACTIVATE);

m_private->m_client->fullScreenClientWillEnterFullScreen();

ASSERT(!m_private->m_fullScreenWindow);
m_private->m_fullScreenWindow = adoptPtr(new MediaPlayerPrivateFullscreenWindow(m_private.get()));
ASSERT(m_private->m_fullScreenWindow);
@@ -137,31 +141,56 @@ void FullScreenController::enterFullScreen()
IntRect viewFrame(IntPoint(), m_private->m_fullScreenFrame.size());
::SetWindowPos(m_private->m_fullScreenWindow->hwnd(), HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
::SetWindowPos(m_private->m_client->fullScreenClientWindow(), HWND_TOP, 0, 0, viewFrame.width(), viewFrame.height(), SWP_NOACTIVATE);
::RedrawWindow(m_private->m_client->fullScreenClientWindow(), 0, 0, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE | RDW_ALLCHILDREN);

m_private->m_client->fullScreenClientDidEnterFullScreen();
m_private->m_client->fullScreenClientForceRepaint();
}

void FullScreenController::enterFullScreenRepaintCompleted()
{
if (!m_private->m_isEnteringFullScreen)
return;
m_private->m_isEnteringFullScreen = false;

::AnimateWindow(m_private->m_fullScreenWindow->hwnd(), kFullScreenAnimationDuration, AW_BLEND | AW_ACTIVATE);
}

void FullScreenController::exitFullScreen()
{
if (!m_private->m_isFullScreen)
if (!m_private->m_isFullScreen || m_private->m_isExitingFullScreen)
return;
m_private->m_isFullScreen = false;
m_private->m_isExitingFullScreen = true;

::AnimateWindow(m_private->m_fullScreenWindow->hwnd(), kFullScreenAnimationDuration, AW_HIDE | AW_BLEND);

m_private->m_client->fullScreenClientWillExitFullScreen();
m_private->m_client->fullScreenClientSetParentWindow(m_private->m_originalHost);
m_private->m_fullScreenWindow = nullptr;

m_private->m_client->fullScreenClientDidExitFullScreen();
::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);
::RedrawWindow(m_private->m_client->fullScreenClientWindow(), 0, 0, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE | RDW_ALLCHILDREN);

m_private->m_client->fullScreenClientDidExitFullScreen();
m_private->m_client->fullScreenClientForceRepaint();
}

void FullScreenController::exitFullScreenRepaintCompleted()
{
if (!m_private->m_isExitingFullScreen)
return;
m_private->m_isExitingFullScreen = false;

ASSERT(m_private->m_backgroundWindow);
::AnimateWindow(m_private->m_backgroundWindow->hwnd(), kFullScreenAnimationDuration, AW_HIDE | AW_BLEND);
m_private->m_backgroundWindow = nullptr;
}

void FullScreenController::repaintCompleted()
{
if (m_private->m_isEnteringFullScreen)
enterFullScreenRepaintCompleted();
else if (m_private->m_isExitingFullScreen)
exitFullScreenRepaintCompleted();
}

#endif
@@ -42,10 +42,14 @@ class FullScreenController {
public:
void enterFullScreen();
void exitFullScreen();
void repaintCompleted();

bool isFullScreen() const;

protected:
void enterFullScreenRepaintCompleted();
void exitFullScreenRepaintCompleted();

class Private;
friend class Private;
OwnPtr<FullScreenController::Private> m_private;
@@ -39,6 +39,7 @@ class FullScreenControllerClient {
virtual void fullScreenClientDidEnterFullScreen() = 0;
virtual void fullScreenClientWillExitFullScreen() = 0;
virtual void fullScreenClientDidExitFullScreen() = 0;
virtual void fullScreenClientForceRepaint() = 0;
protected:
virtual ~FullScreenControllerClient() { }
};
@@ -1,3 +1,15 @@
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-13 Jon Lee <jonlee@apple.com>

Reviewed by Simon Fraser.
@@ -6828,5 +6828,13 @@ void WebView::fullScreenClientDidExitFullScreen()
m_fullScreenElement = nullptr;
}

void WebView::fullScreenClientForceRepaint()
{
ASSERT(m_fullScreenElement);
RECT windowRect = {0};
frameRect(&windowRect);
repaint(windowRect, true /*contentChanged*/, true /*immediate*/, false /*contentOnly*/);
m_fullscreenController->repaintCompleted();
}

#endif
@@ -1031,6 +1031,7 @@ class WebView
virtual void fullScreenClientDidEnterFullScreen();
virtual void fullScreenClientWillExitFullScreen();
virtual void fullScreenClientDidExitFullScreen();
virtual void fullScreenClientForceRepaint();
#endif

ULONG m_refCount;
@@ -1,3 +1,18 @@
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:

2011-05-19 Adam Roben <aroben@apple.com>

Don't try to process DownloadProxy messages twice (and robustify code that runs if we do)
@@ -1778,5 +1778,16 @@ void WebView::fullScreenClientDidExitFullScreen()
page()->fullScreenManager()->didExitFullScreen();
}

static void fullScreenClientForceRepaintCompleted(WKErrorRef, void* context)
{
ASSERT(context);
static_cast<WebView*>(context)->fullScreenController()->repaintCompleted();
}

void WebView::fullScreenClientForceRepaint()
{
page()->forceRepaint(VoidCallback::create(this, &fullScreenClientForceRepaintCompleted));
}

#endif
} // namespace WebKit
@@ -230,6 +230,7 @@ class WebView
virtual void fullScreenClientDidEnterFullScreen();
virtual void fullScreenClientWillExitFullScreen();
virtual void fullScreenClientDidExitFullScreen();
virtual void fullScreenClientForceRepaint();
#endif

HWND m_window;

0 comments on commit e558304

Please sign in to comment.