[WinCairo] Repaint issues with accelerated compositing.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 18 Oct 2014 21:48:33 +0000 (21:48 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 18 Oct 2014 21:48:33 +0000 (21:48 +0000)
https://bugs.webkit.org/show_bug.cgi?id=137850

Patch by peavo@outlook.com <peavo@outlook.com> on 2014-10-18
Reviewed by Brent Fulgham.

There is sometimes missing content in accelerated compositing mode.
This is caused by not invalidating the non composited layer,
and not rendering when a flush did not complete.

* WebCoreSupport/AcceleratedCompositingContext.cpp:
(AcceleratedCompositingContext::flushAndRenderLayers): Also render when flush did not complete.
(AcceleratedCompositingContext::setNeedsDisplayInRect): Deleted.
* WebCoreSupport/AcceleratedCompositingContext.h: Ditto.
* WebView.cpp:
(WebView::addToDirtyRegion): Invalidate non composited layer.
(WebView::flushPendingGraphicsLayerChanges): Flush layers.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@174865 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/win/ChangeLog
Source/WebKit/win/WebCoreSupport/AcceleratedCompositingContext.cpp
Source/WebKit/win/WebCoreSupport/AcceleratedCompositingContext.h
Source/WebKit/win/WebView.cpp

index 03facc2..193ba58 100644 (file)
@@ -1,3 +1,22 @@
+2014-10-18  peavo@outlook.com  <peavo@outlook.com>
+
+        [WinCairo] Repaint issues with accelerated compositing.
+        https://bugs.webkit.org/show_bug.cgi?id=137850
+
+        Reviewed by Brent Fulgham.
+
+        There is sometimes missing content in accelerated compositing mode.
+        This is caused by not invalidating the non composited layer,
+        and not rendering when a flush did not complete.
+
+        * WebCoreSupport/AcceleratedCompositingContext.cpp:
+        (AcceleratedCompositingContext::flushAndRenderLayers): Also render when flush did not complete.
+        (AcceleratedCompositingContext::setNeedsDisplayInRect): Deleted.
+        * WebCoreSupport/AcceleratedCompositingContext.h: Ditto.
+        * WebView.cpp:
+        (WebView::addToDirtyRegion): Invalidate non composited layer.
+        (WebView::flushPendingGraphicsLayerChanges): Flush layers.
+
 2014-10-17  Chris Dumez  <cdumez@apple.com>
 
         Use is<>() / downcast<>() for RenderBox
index 81129ae..d03db72 100644 (file)
@@ -216,18 +216,6 @@ void AcceleratedCompositingContext::setNonCompositedContentsNeedDisplay(const In
     scheduleLayerFlush();
 }
 
-void AcceleratedCompositingContext::setNeedsDisplayInRect(const IntRect& rect)
-{
-    if (!m_rootLayer)
-        return;
-    if (rect.isEmpty()) {
-        m_rootLayer->setNeedsDisplay();
-        return;
-    }
-    m_rootLayer->setNeedsDisplayInRect(rect);
-    scheduleLayerFlush();
-}
-
 void AcceleratedCompositingContext::resizeRootLayer(const IntSize& newSize)
 {
     if (!enabled())
@@ -302,8 +290,7 @@ void AcceleratedCompositingContext::flushAndRenderLayers()
     if (m_context && !m_context->makeContextCurrent())
         return;
 
-    if (!flushPendingLayerChanges())
-        return;
+    flushPendingLayerChanges();
 
     compositeLayersToContext();
 }
index 9eba23f..b35792d 100644 (file)
@@ -48,7 +48,6 @@ public:
 
     void setRootCompositingLayer(WebCore::GraphicsLayer*);
     void setNonCompositedContentsNeedDisplay(const WebCore::IntRect&);
-    void setNeedsDisplayInRect(const WebCore::IntRect&);
     void scheduleLayerFlush();
     void resizeRootLayer(const WebCore::IntSize&);
     bool enabled();
index 442e7e9..1e5f42a 100644 (file)
@@ -868,7 +868,7 @@ void WebView::addToDirtyRegion(const IntRect& dirtyRect)
 #if USE(CA)
         m_backingLayer->setNeedsDisplayInRect(dirtyRect);
 #elif USE(TEXTURE_MAPPER_GL)
-        m_acceleratedCompositingContext->setNeedsDisplayInRect(dirtyRect);
+        m_acceleratedCompositingContext->setNonCompositedContentsNeedDisplay(dirtyRect);
 #endif
         return;
     }
@@ -6792,10 +6792,9 @@ void WebView::flushPendingGraphicsLayerChanges()
     FrameView* view = coreFrame->view();
     if (!view)
         return;
-#if USE(CA)
-    if (!m_backingLayer)
+
+    if (!isAcceleratedCompositing())
         return;
-#endif
 
     view->updateLayoutAndStyleIfNeededRecursive();
 
@@ -6803,9 +6802,12 @@ void WebView::flushPendingGraphicsLayerChanges()
     // Updating layout might have taken us out of compositing mode.
     if (m_backingLayer)
         m_backingLayer->flushCompositingStateForThisLayerOnly();
-#endif
 
     view->flushCompositingStateIncludingSubframes();
+#elif USE(TEXTURE_MAPPER_GL)
+    if (isAcceleratedCompositing())
+        m_acceleratedCompositingContext->flushPendingLayerChanges();
+#endif
 }
 
 class EnumTextMatches : public IEnumTextMatches