Title: [128772] trunk/Source/WebKit/blackberry
Revision
128772
Author
[email protected]
Date
2012-09-17 10:03:45 -0700 (Mon, 17 Sep 2012)

Log Message

[BlackBerry] [FullScreen] entering/leaving fullscreen results in temporary glitches on the screen
https://bugs.webkit.org/show_bug.cgi?id=96927
PR #180866

Reviewed by Yong Li.
Patch by Antonio Gomes <[email protected]>

Suspend backing store and screen updates while entering fullscreen,
and only resume at the end, when viewport is resized.

* Api/WebPage.cpp:
(BlackBerry::WebKit::WebPagePrivate::WebPagePrivate):
(BlackBerry::WebKit::WebPagePrivate::setViewportSize):
* Api/WebPage_p.h:
(WebPagePrivate):
* WebCoreSupport/ChromeClientBlackBerry.cpp:
(WebCore::ChromeClientBlackBerry::enterFullScreenForElement):
(WebCore::ChromeClientBlackBerry::exitFullScreenForElement):

Modified Paths

Diff

Modified: trunk/Source/WebKit/blackberry/Api/WebPage.cpp (128771 => 128772)


--- trunk/Source/WebKit/blackberry/Api/WebPage.cpp	2012-09-17 17:02:18 UTC (rev 128771)
+++ trunk/Source/WebKit/blackberry/Api/WebPage.cpp	2012-09-17 17:03:45 UTC (rev 128772)
@@ -386,10 +386,13 @@
     , m_cursorEventMode(ProcessedCursorEvents)
     , m_touchEventMode(ProcessedTouchEvents)
 #endif
-#if ENABLE(FULLSCREEN_API) && ENABLE(VIDEO)
+#if ENABLE(FULLSCREEN_API)
+#if ENABLE(VIDEO)
     , m_scaleBeforeFullScreen(-1.0)
     , m_xScrollOffsetBeforeFullScreen(-1)
 #endif
+    , m_isTogglingFullScreenState(false)
+#endif
     , m_currentCursor(Platform::CursorNone)
     , m_dumpRenderTree(0) // Lazy initialization.
     , m_initialScale(-1.0)
@@ -3892,6 +3895,13 @@
         // If we need layout then render and blit, otherwise just blit as our viewport has changed.
         m_backingStore->d->resumeScreenAndBackingStoreUpdates(needsLayout ? BackingStore::RenderAndBlit : BackingStore::Blit);
     }
+
+#if ENABLE(FULLSCREEN_API)
+    if (m_isTogglingFullScreenState) {
+        m_backingStore->d->resumeScreenAndBackingStoreUpdates(BackingStore::RenderAndBlit);
+        m_isTogglingFullScreenState = false;
+    }
+#endif
 }
 
 void WebPage::setViewportSize(const Platform::IntSize& viewportSize, bool ensureFocusElementVisible)

Modified: trunk/Source/WebKit/blackberry/Api/WebPage_p.h (128771 => 128772)


--- trunk/Source/WebKit/blackberry/Api/WebPage_p.h	2012-09-17 17:02:18 UTC (rev 128771)
+++ trunk/Source/WebKit/blackberry/Api/WebPage_p.h	2012-09-17 17:03:45 UTC (rev 128772)
@@ -525,6 +525,7 @@
     double m_scaleBeforeFullScreen;
     int m_xScrollOffsetBeforeFullScreen;
 #endif
+    bool m_isTogglingFullScreenState;
 #endif
 
     Platform::BlackBerryCursor m_currentCursor;

Modified: trunk/Source/WebKit/blackberry/ChangeLog (128771 => 128772)


--- trunk/Source/WebKit/blackberry/ChangeLog	2012-09-17 17:02:18 UTC (rev 128771)
+++ trunk/Source/WebKit/blackberry/ChangeLog	2012-09-17 17:03:45 UTC (rev 128772)
@@ -1,3 +1,23 @@
+2012-09-17  Antonio Gomes  <[email protected]>
+
+        [BlackBerry] [FullScreen] entering/leaving fullscreen results in temporary glitches on the screen
+        https://bugs.webkit.org/show_bug.cgi?id=96927
+        PR #180866
+
+        Reviewed by Yong Li.
+
+        Suspend backing store and screen updates while entering fullscreen,
+        and only resume at the end, when viewport is resized.
+
+        * Api/WebPage.cpp:
+        (BlackBerry::WebKit::WebPagePrivate::WebPagePrivate):
+        (BlackBerry::WebKit::WebPagePrivate::setViewportSize):
+        * Api/WebPage_p.h:
+        (WebPagePrivate):
+        * WebCoreSupport/ChromeClientBlackBerry.cpp:
+        (WebCore::ChromeClientBlackBerry::enterFullScreenForElement):
+        (WebCore::ChromeClientBlackBerry::exitFullScreenForElement):
+
 2012-09-17  Rob Buis  <[email protected]>
 
         [BlackBerry] Fix compile problems in WebKit/blackberry

Modified: trunk/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp (128771 => 128772)


--- trunk/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp	2012-09-17 17:02:18 UTC (rev 128771)
+++ trunk/Source/WebKit/blackberry/WebCoreSupport/ChromeClientBlackBerry.cpp	2012-09-17 17:03:45 UTC (rev 128772)
@@ -735,6 +735,11 @@
 
 void ChromeClientBlackBerry::enterFullScreenForElement(WebCore::Element* element)
 {
+    // To avoid glitches on the screen when entering fullscreen, lets suspend the
+    // Backing Store screen updates and only resume at the next call of WebPagePrivate::setViewportSize.
+    m_webPagePrivate->m_isTogglingFullScreenState = true;
+    m_webPagePrivate->m_backingStore->d->suspendScreenAndBackingStoreUpdates();
+
     element->document()->webkitWillEnterFullScreenForElement(element);
     m_webPagePrivate->enterFullScreenForElement(element);
     element->document()->webkitDidEnterFullScreenForElement(element);
@@ -743,6 +748,9 @@
 
 void ChromeClientBlackBerry::exitFullScreenForElement(WebCore::Element*)
 {
+    m_webPagePrivate->m_isTogglingFullScreenState = true;
+    m_webPagePrivate->m_backingStore->d->suspendScreenAndBackingStoreUpdates();
+
     // The element passed into this function is not reliable, i.e. it could
     // be null. In addition the parameter may be disappearing in the future.
     // So we use the reference to the element we saved above.
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to