Separated USE(CA) from USE(ACCELERATED_COMPOSITING) to prepare WinCairo for accelerat...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Oct 2013 20:59:18 +0000 (20:59 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Oct 2013 20:59:18 +0000 (20:59 +0000)
https://bugs.webkit.org/show_bug.cgi?id=123214

Patch by Alex Christensen <achristensen@webkit.org> on 2013-10-23
Reviewed by Brent Fulgham.

Source/WebCore:

* platform/graphics/PlatformLayer.h:
Added TextureMapperPlatformLayer PlatformLayer declaration for WinCairo.
* platform/graphics/win/MediaPlayerPrivateFullscreenWindow.cpp:
(WebCore::MediaPlayerPrivateFullscreenWindow::createWindow):
(WebCore::MediaPlayerPrivateFullscreenWindow::wndProc):
* platform/graphics/win/MediaPlayerPrivateFullscreenWindow.h:
Added USE(CA) where necessary to compile WinCairo with accelerated compositing.

Source/WebKit/win:

* WebCoreSupport/WebChromeClient.h:
(WebChromeClient::delegatedScrollRequested): Added empty function.
* WebPreferences.cpp:
(WebPreferences::acceleratedCompositingEnabled):
Return true for non-CA ports using accelerated compositing.
* WebView.cpp:
(WebView::~WebView):
(WebView::sizeChanged):
(WebView::paint):
(WebView::setShouldInvertColors):
(WebView::flushPendingGraphicsLayerChangesSoon):
(WebView::setAcceleratedCompositing):
* WebView.h:
Added USE(CA) where necessary to compile WinCairo with accelerated compositing.

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

Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/PlatformLayer.h
Source/WebCore/platform/graphics/win/MediaPlayerPrivateFullscreenWindow.cpp
Source/WebCore/platform/graphics/win/MediaPlayerPrivateFullscreenWindow.h
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebCoreSupport/WebChromeClient.h
Source/WebKit/win/WebPreferences.cpp
Source/WebKit/win/WebView.cpp
Source/WebKit/win/WebView.h

index c78a698..8c7b373 100644 (file)
@@ -1,3 +1,18 @@
+2013-10-23  Alex Christensen  <achristensen@webkit.org>
+
+        Separated USE(CA) from USE(ACCELERATED_COMPOSITING) to prepare WinCairo for accelerated compositing.
+        https://bugs.webkit.org/show_bug.cgi?id=123214
+
+        Reviewed by Brent Fulgham.
+
+        * platform/graphics/PlatformLayer.h:
+        Added TextureMapperPlatformLayer PlatformLayer declaration for WinCairo.
+        * platform/graphics/win/MediaPlayerPrivateFullscreenWindow.cpp:
+        (WebCore::MediaPlayerPrivateFullscreenWindow::createWindow):
+        (WebCore::MediaPlayerPrivateFullscreenWindow::wndProc):
+        * platform/graphics/win/MediaPlayerPrivateFullscreenWindow.h:
+        Added USE(CA) where necessary to compile WinCairo with accelerated compositing.
+
 2013-10-23  Myles C. Maxfield  <mmaxfield@apple.com>
 
         Antialias underlines if they're not axis-aligned
index 7f2f3f8..82343cf 100644 (file)
 #if PLATFORM(MAC)
 OBJC_CLASS CALayer;
 typedef CALayer PlatformLayer;
-#elif PLATFORM(WIN)
+#elif PLATFORM(WIN) && USE(CA)
 typedef struct _CACFLayer PlatformLayer;
+#elif PLATFORM(WIN) && USE(TEXTURE_MAPPER)
+namespace WebCore {
+class TextureMapperPlatformLayer;
+typedef TextureMapperPlatformLayer PlatformLayer;
+};
 #elif PLATFORM(GTK)
 #if USE(TEXTURE_MAPPER_GL)
 namespace WebCore {
index 35ce1b3..6077f2d 100644 (file)
@@ -34,7 +34,7 @@
 #include <CoreGraphics/CGColor.h>
 #endif
 
-#if USE(ACCELERATED_COMPOSITING)
+#if USE(ACCELERATED_COMPOSITING) && USE(CA)
 #include "CACFLayerTreeHost.h"
 #include "PlatformCALayer.h"
 #endif
@@ -84,7 +84,7 @@ void MediaPlayerPrivateFullscreenWindow::createWindow(HWND parentHwnd)
         parentHwnd, 0, instanceHandle(), this);
     ASSERT(IsWindow(m_hwnd));
 
-#if USE(ACCELERATED_COMPOSITING)
+#if USE(ACCELERATED_COMPOSITING) && USE(CA)
     if (m_layerTreeHost)
         m_layerTreeHost->setWindow(m_hwnd);
 #endif
@@ -92,7 +92,7 @@ void MediaPlayerPrivateFullscreenWindow::createWindow(HWND parentHwnd)
     ::SetFocus(m_hwnd);
 }
 
-#if USE(ACCELERATED_COMPOSITING)
+#if USE(ACCELERATED_COMPOSITING) && USE(CA)
 void MediaPlayerPrivateFullscreenWindow::setRootChildLayer(PassRefPtr<PlatformCALayer> rootChild)
 {
     if (m_rootChild == rootChild)
@@ -156,7 +156,7 @@ LRESULT MediaPlayerPrivateFullscreenWindow::wndProc(HWND hWnd, UINT message, WPA
         break;
     case WM_DESTROY:
         m_hwnd = 0;
-#if USE(ACCELERATED_COMPOSITING)
+#if USE(ACCELERATED_COMPOSITING) && USE(CA)
         if (m_layerTreeHost)
             m_layerTreeHost->setWindow(0);
 #endif
@@ -166,7 +166,7 @@ LRESULT MediaPlayerPrivateFullscreenWindow::wndProc(HWND hWnd, UINT message, WPA
             LPWINDOWPOS wp = reinterpret_cast<LPWINDOWPOS>(lParam);
             if (wp->flags & SWP_NOSIZE)
                 break;
-#if USE(ACCELERATED_COMPOSITING)
+#if USE(ACCELERATED_COMPOSITING) && USE(CA)
             if (m_layerTreeHost) {
                 m_layerTreeHost->resize();
                 PlatformCALayer* rootLayer = m_rootChild->rootLayer();
@@ -179,7 +179,7 @@ LRESULT MediaPlayerPrivateFullscreenWindow::wndProc(HWND hWnd, UINT message, WPA
         }
         break;
     case WM_PAINT:
-#if USE(ACCELERATED_COMPOSITING)
+#if USE(ACCELERATED_COMPOSITING) && USE(CA)
         if (m_layerTreeHost) {
             m_layerTreeHost->paint();
             ::ValidateRect(m_hwnd, 0);
index 3f8879f..9f2d63a 100644 (file)
 #include <wtf/RefPtr.h>
 #include <wtf/WindowsExtras.h>
 
-#if USE(ACCELERATED_COMPOSITING)
+#if USE(ACCELERATED_COMPOSITING) && USE(CA)
 #include "CACFLayerTreeHostClient.h"
 #endif
 
 namespace WebCore {
 
-#if USE(ACCELERATED_COMPOSITING)
+#if USE(ACCELERATED_COMPOSITING) && USE(CA)
 class CACFLayerTreeHost;
 class PlatformCALayer;
 #endif
@@ -56,7 +56,7 @@ public:
     
     HWND hwnd() const { return m_hwnd; }
 
-#if USE(ACCELERATED_COMPOSITING)
+#if USE(ACCELERATED_COMPOSITING) && USE(CA)
     PlatformCALayer* rootChildLayer() const { return m_rootChild.get(); }
     void setRootChildLayer(PassRefPtr<PlatformCALayer>);
 #endif
@@ -66,7 +66,7 @@ private:
     LRESULT wndProc(HWND, UINT message, WPARAM, LPARAM);
 
     MediaPlayerPrivateFullscreenClient* m_client;
-#if USE(ACCELERATED_COMPOSITING)
+#if USE(ACCELERATED_COMPOSITING) && USE(CA)
     RefPtr<CACFLayerTreeHost> m_layerTreeHost;
     RefPtr<PlatformCALayer> m_rootChild;
 #endif
index 21a6c3c..1cac212 100644 (file)
@@ -1,3 +1,25 @@
+2013-10-23  Alex Christensen  <achristensen@webkit.org>
+
+        Separated USE(CA) from USE(ACCELERATED_COMPOSITING) to prepare WinCairo for accelerated compositing.
+        https://bugs.webkit.org/show_bug.cgi?id=123214
+
+        Reviewed by Brent Fulgham.
+
+        * WebCoreSupport/WebChromeClient.h:
+        (WebChromeClient::delegatedScrollRequested): Added empty function.
+        * WebPreferences.cpp:
+        (WebPreferences::acceleratedCompositingEnabled):
+        Return true for non-CA ports using accelerated compositing.
+        * WebView.cpp:
+        (WebView::~WebView):
+        (WebView::sizeChanged):
+        (WebView::paint):
+        (WebView::setShouldInvertColors):
+        (WebView::flushPendingGraphicsLayerChangesSoon):
+        (WebView::setAcceleratedCompositing):
+        * WebView.h:
+        Added USE(CA) where necessary to compile WinCairo with accelerated compositing.
+
 2013-10-16  Tim Horton  <timothy_horton@apple.com>
 
         Attempt to fix the Windows build after http://trac.webkit.org/changeset/157547.
index 883412d..464e9e4 100644 (file)
@@ -141,6 +141,10 @@ public:
         virtual void scheduleCompositingLayerFlush();
 #endif
 
+#if USE(TILED_BACKING_STORE)
+    virtual void delegatedScrollRequested(const WebCore::IntPoint&) { }
+#endif
+
 #if PLATFORM(WIN) && USE(AVFOUNDATION)
     virtual WebCore::GraphicsDeviceAdapter* graphicsDeviceAdapter() const OVERRIDE;
 #endif
index 9ce8469..e3bd187 100644 (file)
@@ -1540,8 +1540,12 @@ HRESULT WebPreferences::setAcceleratedCompositingEnabled(BOOL enabled)
 HRESULT WebPreferences::acceleratedCompositingEnabled(BOOL* enabled)
 {
 #if USE(ACCELERATED_COMPOSITING)
+#if USE(CA)
     *enabled = CACFLayerTreeHost::acceleratedCompositingAvailable() && boolValueForKey(CFSTR(WebKitAcceleratedCompositingEnabledPreferenceKey));
 #else
+    *enabled = TRUE;
+#endif
+#else
     *enabled = FALSE;
 #endif
     return S_OK;
index 9be5d8c..527abfa 100644 (file)
 #include <WebKitSystemInterface/WebKitSystemInterface.h> 
 #endif
 
-#if USE(ACCELERATED_COMPOSITING)
+#if USE(ACCELERATED_COMPOSITING) && USE(CA)
 #include <WebCore/CACFLayerTreeHost.h>
 #include <WebCore/PlatformCALayer.h>
 #endif
@@ -432,7 +432,9 @@ WebView::~WebView()
     ASSERT(!m_viewWindow);
 
 #if USE(ACCELERATED_COMPOSITING)
+#if USE(CA)
     ASSERT(!m_layerTreeHost);
+#endif
     ASSERT(!m_backingLayer);
 #endif
 
@@ -936,7 +938,7 @@ void WebView::sizeChanged(const IntSize& newSize)
     if (Frame* coreFrame = core(topLevelFrame()))
         coreFrame->view()->resize(newSize);
 
-#if USE(ACCELERATED_COMPOSITING)
+#if USE(ACCELERATED_COMPOSITING) && USE(CA)
     if (m_layerTreeHost)
         m_layerTreeHost->resize();
     if (m_backingLayer) {
@@ -1073,7 +1075,7 @@ void WebView::paint(HDC dc, LPARAM options)
 {
     LOCAL_GDI_COUNTER(0, __FUNCTION__);
 
-#if USE(ACCELERATED_COMPOSITING)
+#if USE(ACCELERATED_COMPOSITING) && USE(CA)
     if (isAcceleratedCompositing() && !usesLayeredWindow()) {
         m_layerTreeHost->flushPendingLayerChangesNow();
         // Flushing might have taken us out of compositing mode.
@@ -2138,7 +2140,7 @@ void WebView::setShouldInvertColors(bool shouldInvertColors)
 
     m_shouldInvertColors = shouldInvertColors;
 
-#if USE(ACCELERATED_COMPOSITING)
+#if USE(ACCELERATED_COMPOSITING) && USE(CA)
     if (m_layerTreeHost)
         m_layerTreeHost->setShouldInvertColors(shouldInvertColors);
 #endif
@@ -6566,13 +6568,16 @@ void WebView::setRootChildLayer(GraphicsLayer* layer)
 
 void WebView::flushPendingGraphicsLayerChangesSoon()
 {
+#if USE(CA)
     if (!m_layerTreeHost)
         return;
     m_layerTreeHost->flushPendingGraphicsLayerChangesSoon();
+#endif
 }
 
 void WebView::setAcceleratedCompositing(bool accelerated)
 {
+#if USE(CA)
     if (m_isAcceleratedCompositing == accelerated || !CACFLayerTreeHost::acceleratedCompositingAvailable())
         return;
 
@@ -6613,6 +6618,7 @@ void WebView::setAcceleratedCompositing(bool accelerated)
         m_backingLayer = nullptr;
         m_isAcceleratedCompositing = false;
     }
+#endif
 }
 #endif
 
index aad295c..3f46ae0 100644 (file)
@@ -52,7 +52,7 @@
 #endif
 
 namespace WebCore {
-#if USE(ACCELERATED_COMPOSITING)
+#if USE(ACCELERATED_COMPOSITING) && USE(CA)
     class CACFLayerTreeHost;
 #endif
     class FullScreenController;
@@ -1155,8 +1155,9 @@ protected:
 #if USE(ACCELERATED_COMPOSITING)
     bool isAcceleratedCompositing() const { return m_isAcceleratedCompositing; }
     void setAcceleratedCompositing(bool);
-
+#if USE(CA)
     RefPtr<WebCore::CACFLayerTreeHost> m_layerTreeHost;
+#endif
     std::unique_ptr<WebCore::GraphicsLayer> m_backingLayer;
     bool m_isAcceleratedCompositing;
 #endif