Title: [102045] trunk/Source
Revision
102045
Author
[email protected]
Date
2011-12-05 14:13:56 -0800 (Mon, 05 Dec 2011)

Log Message

Make LayerFlushSchedulerClient::flushLayers indicate whether the flush was successful or not
https://bugs.webkit.org/show_bug.cgi?id=73862

Reviewed by Andy Estes.

Source/WebCore:

Change LayerFlushSchedulerClient::flushLayers to return a boolean. If it returns true, the flush was
successful and the run loop observer will be invalidated.

* platform/graphics/ca/LayerFlushScheduler.h:
* platform/graphics/ca/LayerFlushSchedulerClient.h:
* platform/graphics/ca/mac/LayerFlushSchedulerMac.cpp:
(WebCore::LayerFlushScheduler::runLoopObserverCallback):

Source/WebKit/mac:

Remove the call to LayerFlushScheduler::invalidate and return true instead. Return false for the cases
where we don't want the layer flush scheduler to be invalidated.

* WebView/WebView.mm:
(LayerFlushController::flushLayers):
* WebView/WebViewData.h:

Source/WebKit2:

Change LayerTreeHostCAMac::flushLayers to always return true and remove the call to LayerFlushScheduler::invalidate.

* WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.h:
* WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.mm:
(WebKit::LayerTreeHostCAMac::flushLayers):
(WebKit::LayerTreeHostCAMac::didPerformScheduledLayerFlush):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (102044 => 102045)


--- trunk/Source/WebCore/ChangeLog	2011-12-05 22:07:37 UTC (rev 102044)
+++ trunk/Source/WebCore/ChangeLog	2011-12-05 22:13:56 UTC (rev 102045)
@@ -1,3 +1,18 @@
+2011-12-05  Anders Carlsson  <[email protected]>
+
+        Make LayerFlushSchedulerClient::flushLayers indicate whether the flush was successful or not
+        https://bugs.webkit.org/show_bug.cgi?id=73862
+
+        Reviewed by Andy Estes.
+
+        Change LayerFlushSchedulerClient::flushLayers to return a boolean. If it returns true, the flush was
+        successful and the run loop observer will be invalidated.
+
+        * platform/graphics/ca/LayerFlushScheduler.h:
+        * platform/graphics/ca/LayerFlushSchedulerClient.h:
+        * platform/graphics/ca/mac/LayerFlushSchedulerMac.cpp:
+        (WebCore::LayerFlushScheduler::runLoopObserverCallback):
+
 2011-12-05  Dana Jansens  <[email protected]>
 
         [chromium] Set opaque flag for ImageLayerChromium

Modified: trunk/Source/WebCore/platform/graphics/ca/LayerFlushScheduler.h (102044 => 102045)


--- trunk/Source/WebCore/platform/graphics/ca/LayerFlushScheduler.h	2011-12-05 22:07:37 UTC (rev 102044)
+++ trunk/Source/WebCore/platform/graphics/ca/LayerFlushScheduler.h	2011-12-05 22:13:56 UTC (rev 102045)
@@ -53,6 +53,7 @@
 #if PLATFORM(MAC)
     RetainPtr<CFRunLoopObserverRef> m_runLoopObserver;
     static void runLoopObserverCallback(CFRunLoopObserverRef, CFRunLoopActivity, void* context);
+    void runLoopObserverCallback();
 #endif
 };
 

Modified: trunk/Source/WebCore/platform/graphics/ca/LayerFlushSchedulerClient.h (102044 => 102045)


--- trunk/Source/WebCore/platform/graphics/ca/LayerFlushSchedulerClient.h	2011-12-05 22:07:37 UTC (rev 102044)
+++ trunk/Source/WebCore/platform/graphics/ca/LayerFlushSchedulerClient.h	2011-12-05 22:13:56 UTC (rev 102045)
@@ -31,9 +31,12 @@
 namespace WebCore {
 
 class LayerFlushSchedulerClient {
+protected:
+    virtual ~LayerFlushSchedulerClient() { }
+
 public:
-    virtual ~LayerFlushSchedulerClient() { }
-    virtual void flushLayers() = 0;
+    // Flush the layers. Returns true on success.
+    virtual bool flushLayers() = 0;
 };
 
 } // namespace WebCore

Modified: trunk/Source/WebCore/platform/graphics/ca/mac/LayerFlushSchedulerMac.cpp (102044 => 102045)


--- trunk/Source/WebCore/platform/graphics/ca/mac/LayerFlushSchedulerMac.cpp	2011-12-05 22:07:37 UTC (rev 102044)
+++ trunk/Source/WebCore/platform/graphics/ca/mac/LayerFlushSchedulerMac.cpp	2011-12-05 22:13:56 UTC (rev 102045)
@@ -48,12 +48,18 @@
 
 void LayerFlushScheduler::runLoopObserverCallback(CFRunLoopObserverRef, CFRunLoopActivity, void* context)
 {
-    LayerFlushScheduler* layerFlushScheduler = static_cast<LayerFlushScheduler*>(context);
-    ASSERT(layerFlushScheduler->m_runLoopObserver);
-    ASSERT(!layerFlushScheduler->m_isSuspended);
-    layerFlushScheduler->m_client->flushLayers();
+    static_cast<LayerFlushScheduler*>(context)->runLoopObserverCallback();
 }
 
+void LayerFlushScheduler::runLoopObserverCallback()
+{
+    ASSERT(m_runLoopObserver);
+    ASSERT(!m_isSuspended);
+
+    if (m_client->flushLayers())
+        invalidate();
+}
+
 void LayerFlushScheduler::schedule()
 {
     if (m_isSuspended)

Modified: trunk/Source/WebKit/mac/ChangeLog (102044 => 102045)


--- trunk/Source/WebKit/mac/ChangeLog	2011-12-05 22:07:37 UTC (rev 102044)
+++ trunk/Source/WebKit/mac/ChangeLog	2011-12-05 22:13:56 UTC (rev 102045)
@@ -1,3 +1,17 @@
+2011-12-05  Anders Carlsson  <[email protected]>
+
+        Make LayerFlushSchedulerClient::flushLayers indicate whether the flush was successful or not
+        https://bugs.webkit.org/show_bug.cgi?id=73862
+
+        Reviewed by Andy Estes.
+
+        Remove the call to LayerFlushScheduler::invalidate and return true instead. Return false for the cases
+        where we don't want the layer flush scheduler to be invalidated.
+
+        * WebView/WebView.mm:
+        (LayerFlushController::flushLayers):
+        * WebView/WebViewData.h:
+
 2011-12-05  Eric Carlson  <[email protected]>
 
         Add WebKit preferences for text track settings

Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (102044 => 102045)


--- trunk/Source/WebKit/mac/WebView/WebView.mm	2011-12-05 22:07:37 UTC (rev 102044)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm	2011-12-05 22:13:56 UTC (rev 102045)
@@ -6182,7 +6182,7 @@
        until the time is right (essentially when there are no more pending layouts).
     
 */
-void LayerFlushController::flushLayers()
+bool LayerFlushController::flushLayers()
 {
     NSWindow *window = [m_webView window];
     
@@ -6198,20 +6198,23 @@
         viewsNeedDisplay = [window viewsNeedDisplay];
 
     if (viewsNeedDisplay)
-        return;
+        return false;
 
     if ([m_webView _syncCompositingChanges]) {
-        m_layerFlushScheduler.invalidate();
         // AppKit may have disabled screen updates, thinking an upcoming window flush will re-enable them.
         // In case setNeedsDisplayInRect() has prevented the window from needing to be flushed, re-enable screen
         // updates here.
         if (![window isFlushWindowDisabled])
             [window _enableScreenUpdatesIfNeeded];
-    } else {
-        // Since the WebView does not need display, -viewWillDraw will not be called. Perform pending layout now,
-        // so that the layers draw with up-to-date layout. 
-        [m_webView _viewWillDrawInternal];
+
+        return true;
     }
+
+    // Since the WebView does not need display, -viewWillDraw will not be called. Perform pending layout now,
+    // so that the layers draw with up-to-date layout. 
+    [m_webView _viewWillDrawInternal];
+
+    return false;
 }
 
 - (void)_scheduleCompositingLayerSync

Modified: trunk/Source/WebKit/mac/WebView/WebViewData.h (102044 => 102045)


--- trunk/Source/WebKit/mac/WebView/WebViewData.h	2011-12-05 22:07:37 UTC (rev 102044)
+++ trunk/Source/WebKit/mac/WebView/WebViewData.h	2011-12-05 22:13:56 UTC (rev 102045)
@@ -68,7 +68,7 @@
         return adoptPtr(new LayerFlushController(webView));
     }
     
-    virtual void flushLayers();
+    virtual bool flushLayers();
     
     void scheduleLayerFlush();
     void invalidateObserver();

Modified: trunk/Source/WebKit2/ChangeLog (102044 => 102045)


--- trunk/Source/WebKit2/ChangeLog	2011-12-05 22:07:37 UTC (rev 102044)
+++ trunk/Source/WebKit2/ChangeLog	2011-12-05 22:13:56 UTC (rev 102045)
@@ -1,3 +1,17 @@
+2011-12-05  Anders Carlsson  <[email protected]>
+
+        Make LayerFlushSchedulerClient::flushLayers indicate whether the flush was successful or not
+        https://bugs.webkit.org/show_bug.cgi?id=73862
+
+        Reviewed by Andy Estes.
+
+        Change LayerTreeHostCAMac::flushLayers to always return true and remove the call to LayerFlushScheduler::invalidate.
+
+        * WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.h:
+        * WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.mm:
+        (WebKit::LayerTreeHostCAMac::flushLayers):
+        (WebKit::LayerTreeHostCAMac::didPerformScheduledLayerFlush):
+
 2011-12-05  Michael BrĂ¼ning  <[email protected]>
 
         [Qt] Rename QQuickWebView::canStop property to just loading 

Modified: trunk/Source/WebKit2/WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.h (102044 => 102045)


--- trunk/Source/WebKit2/WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.h	2011-12-05 22:07:37 UTC (rev 102044)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.h	2011-12-05 22:13:56 UTC (rev 102045)
@@ -57,7 +57,7 @@
     virtual void didPerformScheduledLayerFlush();
     
     // LayerFlushSchedulerClient
-    virtual void flushLayers();
+    virtual bool flushLayers();
 
     RetainPtr<WKCARemoteLayerClientRef> m_remoteLayerClient;
     WebCore::LayerFlushScheduler m_layerFlushScheduler;

Modified: trunk/Source/WebKit2/WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.mm (102044 => 102045)


--- trunk/Source/WebKit2/WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.mm	2011-12-05 22:07:37 UTC (rev 102044)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ca/mac/LayerTreeHostCAMac.mm	2011-12-05 22:13:56 UTC (rev 102045)
@@ -118,19 +118,18 @@
     [[NSNotificationCenter defaultCenter] postNotificationName:@"NSCAViewRenderDidResumeNotification" object:nil userInfo:[NSDictionary dictionaryWithObject:root forKey:@"layer"]];
 }
 
-void LayerTreeHostCAMac::flushLayers()
+bool LayerTreeHostCAMac::flushLayers()
 {
     // This gets called outside of the normal event loop so wrap in an autorelease pool
     NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
     performScheduledLayerFlush();
     [pool drain];
+
+    return true;
 }
 
 void LayerTreeHostCAMac::didPerformScheduledLayerFlush()
 {
-    // We successfully flushed the pending layer changes, remove the run loop observer.
-    m_layerFlushScheduler.invalidate();
-
     LayerTreeHostCA::didPerformScheduledLayerFlush();
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to