https://bugs.webkit.org/show_bug.cgi?id=55956
authorbfulgham@webkit.org <bfulgham@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Mar 2011 23:06:08 +0000 (23:06 +0000)
committerbfulgham@webkit.org <bfulgham@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Mar 2011 23:06:08 +0000 (23:06 +0000)
WebKit2 Changes to correct WinCairo port build

Reviewed by Anders Carlsson.

* Shared/LayerTreeContext.h: Don't exclude CoreIPC declarations for non-accelerated
  compositing case.
* UIProcess/DrawingAreaProxy.h: Add "stdint.h" include needed for Cairo build.
* UIProcess/DrawingAreaProxyImpl.cpp: Exclude accelerated compositing code for
  WinCairo build.
(WebKit::DrawingAreaProxyImpl::~DrawingAreaProxyImpl):
(WebKit::DrawingAreaProxyImpl::didUpdateBackingStoreState):
(WebKit::DrawingAreaProxyImpl::enterAcceleratedCompositingMode):
(WebKit::DrawingAreaProxyImpl::exitAcceleratedCompositingMode):
(WebKit::DrawingAreaProxyImpl::sendUpdateBackingStoreState):
(WebKit::DrawingAreaProxyImpl::waitForAndDispatchDidUpdateBackingStoreState):
* UIProcess/DrawingAreaProxyImpl.h: Exclude declarations for code only used when
  accelerated compositing is enabled.
(WebKit::DrawingAreaProxyImpl::isInAcceleratedCompositingMode):
* UIProcess/win/WebView.cpp: Protect CG-specific drawing code.
(WebKit::WebView::setFindIndicator):
* WebProcess/Downloads/Download.h: Allow CFLite implentation to share overwrite flag,
  as well as destination and bundle paths.
* WebProcess/Downloads/curl/DownloadCurl.cpp: Remove stub (to share CFNet implementation
  of file handling.  This will be moved to a common area in a future patch.)
* WebProcess/WebPage/DrawingAreaImpl.cpp: Exclude accelerated-compositing paths.
(WebKit::DrawingAreaImpl::layerHostDidFlushLayers):
(WebKit::DrawingAreaImpl::sendDidUpdateBackingStoreState):
(WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode):
* WebProcess/WebPage/WebPage.cpp: Protect CG-specific drawing code.
(WebKit::WebPage::drawRectToPDF):
(WebKit::WebPage::drawPagesToPDF):
* win/WebKit2.vcproj: Exclude unused LayerTreeContext from WinCairo

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

Source/WebKit2/ChangeLog
Source/WebKit2/Shared/LayerTreeContext.h
Source/WebKit2/UIProcess/DrawingAreaProxy.h
Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp
Source/WebKit2/UIProcess/DrawingAreaProxyImpl.h
Source/WebKit2/UIProcess/win/WebView.cpp
Source/WebKit2/WebProcess/Downloads/Download.h
Source/WebKit2/WebProcess/Downloads/curl/DownloadCurl.cpp
Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/win/WebKit2.vcproj

index a7adfad..a49d0c0 100644 (file)
@@ -1,3 +1,39 @@
+2011-03-08  Brent Fulgham  <bfulgham@webkit.org>
+
+        Reviewed by Anders Carlsson.
+
+        https://bugs.webkit.org/show_bug.cgi?id=55956
+        WebKit2 Changes to correct WinCairo port build
+
+        * Shared/LayerTreeContext.h: Don't exclude CoreIPC declarations for non-accelerated
+          compositing case.
+        * UIProcess/DrawingAreaProxy.h: Add "stdint.h" include needed for Cairo build.
+        * UIProcess/DrawingAreaProxyImpl.cpp: Exclude accelerated compositing code for
+          WinCairo build.
+        (WebKit::DrawingAreaProxyImpl::~DrawingAreaProxyImpl):
+        (WebKit::DrawingAreaProxyImpl::didUpdateBackingStoreState):
+        (WebKit::DrawingAreaProxyImpl::enterAcceleratedCompositingMode):
+        (WebKit::DrawingAreaProxyImpl::exitAcceleratedCompositingMode):
+        (WebKit::DrawingAreaProxyImpl::sendUpdateBackingStoreState):
+        (WebKit::DrawingAreaProxyImpl::waitForAndDispatchDidUpdateBackingStoreState):
+        * UIProcess/DrawingAreaProxyImpl.h: Exclude declarations for code only used when
+          accelerated compositing is enabled.
+        (WebKit::DrawingAreaProxyImpl::isInAcceleratedCompositingMode):
+        * UIProcess/win/WebView.cpp: Protect CG-specific drawing code.
+        (WebKit::WebView::setFindIndicator):
+        * WebProcess/Downloads/Download.h: Allow CFLite implentation to share overwrite flag,
+          as well as destination and bundle paths.
+        * WebProcess/Downloads/curl/DownloadCurl.cpp: Remove stub (to share CFNet implementation
+          of file handling.  This will be moved to a common area in a future patch.)
+        * WebProcess/WebPage/DrawingAreaImpl.cpp: Exclude accelerated-compositing paths.
+        (WebKit::DrawingAreaImpl::layerHostDidFlushLayers):
+        (WebKit::DrawingAreaImpl::sendDidUpdateBackingStoreState):
+        (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode):
+        * WebProcess/WebPage/WebPage.cpp: Protect CG-specific drawing code.
+        (WebKit::WebPage::drawRectToPDF):
+        (WebKit::WebPage::drawPagesToPDF):
+        * win/WebKit2.vcproj: Exclude unused LayerTreeContext from WinCairo
+
 2011-03-08  Ivan Krstić  <ike@apple.com>
 
         Reviewed by Sam Weinig.
index e2938aa..233b7ae 100644 (file)
 #ifndef LayerTreeContext_h
 #define LayerTreeContext_h
 
-#if USE(ACCELERATED_COMPOSITING)
-
 namespace CoreIPC {
     class ArgumentDecoder;
     class ArgumentEncoder;
 }
 
+#if USE(ACCELERATED_COMPOSITING)
+
 namespace WebKit {
 
 class LayerTreeContext {
index 4222c3b..c72cf03 100644 (file)
@@ -28,6 +28,7 @@
 #define DrawingAreaProxy_h
 
 #include "DrawingAreaInfo.h"
+#include <stdint.h>
 #include <WebCore/IntSize.h>
 #include <wtf/Noncopyable.h>
 
index 4cf4d2e..0ee42f4 100644 (file)
@@ -58,9 +58,11 @@ DrawingAreaProxyImpl::DrawingAreaProxyImpl(WebPageProxy* webPageProxy)
 
 DrawingAreaProxyImpl::~DrawingAreaProxyImpl()
 {
+#if USE(ACCELERATED_COMPOSITING)
     // Make sure to exit accelerated compositing mode.
     if (isInAcceleratedCompositingMode())
         exitAcceleratedCompositingMode();
+#endif
 }
 
 void DrawingAreaProxyImpl::paint(BackingStore::PlatformGraphicsContext context, const IntRect& rect, Region& unpaintedRegion)
@@ -162,6 +164,7 @@ void DrawingAreaProxyImpl::didUpdateBackingStoreState(uint64_t backingStoreState
     if (m_nextBackingStoreStateID != m_currentBackingStoreStateID)
         sendUpdateBackingStoreState(RespondImmediately);
 
+#if USE(ACCELERATED_COMPOSITING)
     if (layerTreeContext != m_layerTreeContext) {
         if (!m_layerTreeContext.isEmpty()) {
             exitAcceleratedCompositingMode();
@@ -178,6 +181,7 @@ void DrawingAreaProxyImpl::didUpdateBackingStoreState(uint64_t backingStoreState
         ASSERT(!m_backingStore);
         return;
     }
+#endif
 
     // FIXME: We could just reuse our existing backing store if it's the same size as
     // updateInfo.viewSize.
@@ -191,7 +195,9 @@ void DrawingAreaProxyImpl::enterAcceleratedCompositingMode(uint64_t backingStore
     if (backingStoreStateID < m_currentBackingStoreStateID)
         return;
 
+#if USE(ACCELERATED_COMPOSITING)
     enterAcceleratedCompositingMode(layerTreeContext);
+#endif
 }
 
 void DrawingAreaProxyImpl::exitAcceleratedCompositingMode(uint64_t backingStoreStateID, const UpdateInfo& updateInfo)
@@ -200,7 +206,9 @@ void DrawingAreaProxyImpl::exitAcceleratedCompositingMode(uint64_t backingStoreS
     if (backingStoreStateID < m_currentBackingStoreStateID)
         return;
 
+#if USE(ACCELERATED_COMPOSITING)
     exitAcceleratedCompositingMode();
+#endif
 
     incorporateUpdate(updateInfo);
 }
@@ -252,11 +260,13 @@ void DrawingAreaProxyImpl::sendUpdateBackingStoreState(RespondImmediatelyOrNot r
     m_webPageProxy->process()->send(Messages::DrawingArea::UpdateBackingStoreState(m_nextBackingStoreStateID, respondImmediatelyOrNot == RespondImmediately, m_size, m_scrollOffset), m_webPageProxy->pageID());
     m_scrollOffset = IntSize();
 
+#if USE(ACCELERATED_COMPOSITING)
     if (m_isWaitingForDidUpdateBackingStoreState && !m_layerTreeContext.isEmpty()) {
         // Wait for the DidUpdateBackingStoreState message. Normally we don this in DrawingAreaProxyImpl::paint, but that
         // function is never called when in accelerated compositing mode.
         waitForAndDispatchDidUpdateBackingStoreState();
     }
+#endif
 }
 
 void DrawingAreaProxyImpl::waitForAndDispatchDidUpdateBackingStoreState()
@@ -268,6 +278,7 @@ void DrawingAreaProxyImpl::waitForAndDispatchDidUpdateBackingStoreState()
     if (m_webPageProxy->process()->isLaunching())
         return;
     
+#if USE(ACCELERATED_COMPOSITING)
     // FIXME: waitForAndDispatchImmediately will always return the oldest DidUpdateBackingStoreState message that
     // hasn't yet been processed. But it might be better to skip ahead to some other DidUpdateBackingStoreState
     // message, if multiple DidUpdateBackingStoreState messages are waiting to be processed. For instance, we could
@@ -276,8 +287,10 @@ void DrawingAreaProxyImpl::waitForAndDispatchDidUpdateBackingStoreState()
     // The timeout, in seconds, we use when waiting for a DidUpdateBackingStoreState message when we're asked to paint.
     static const double didUpdateBackingStoreStateTimeout = 0.5;
     m_webPageProxy->process()->connection()->waitForAndDispatchImmediately<Messages::DrawingAreaProxy::DidUpdateBackingStoreState>(m_webPageProxy->pageID(), didUpdateBackingStoreStateTimeout);
+#endif
 }
 
+#if USE(ACCELERATED_COMPOSITING)
 void DrawingAreaProxyImpl::enterAcceleratedCompositingMode(const LayerTreeContext& layerTreeContext)
 {
     ASSERT(!isInAcceleratedCompositingMode());
@@ -294,6 +307,7 @@ void DrawingAreaProxyImpl::exitAcceleratedCompositingMode()
     m_layerTreeContext = LayerTreeContext();    
     m_webPageProxy->exitAcceleratedCompositingMode();
 }
+#endif
 
 void DrawingAreaProxyImpl::discardBackingStoreSoon()
 {
index 17c7512..11e430c 100644 (file)
@@ -68,10 +68,14 @@ private:
     void sendUpdateBackingStoreState(RespondImmediatelyOrNot);
     void waitForAndDispatchDidUpdateBackingStoreState();
 
+#if USE(ACCELERATED_COMPOSITING)
     void enterAcceleratedCompositingMode(const LayerTreeContext&);
     void exitAcceleratedCompositingMode();
 
     bool isInAcceleratedCompositingMode() const { return !m_layerTreeContext.isEmpty(); }
+#else
+    bool isInAcceleratedCompositingMode() const { return false; }
+#endif
 
     void discardBackingStoreSoon();
     void discardBackingStore();
@@ -85,9 +89,11 @@ private:
     // whenever our state changes in a way that will require a new backing store to be allocated.
     uint64_t m_nextBackingStoreStateID;
 
+#if USE(ACCELERATED_COMPOSITING)
     // The current layer tree context.
     LayerTreeContext m_layerTreeContext;
-    
+#endif
+
     // Whether we've sent a UpdateBackingStoreState message and are now waiting for a DidUpdateBackingStoreState message.
     // Used to throttle UpdateBackingStoreState messages so we don't send them faster than the Web process can handle.
     bool m_isWaitingForDidUpdateBackingStoreState;
index 7cee0d1..72a2a24 100644 (file)
@@ -44,7 +44,9 @@
 #include <WebCore/BitmapInfo.h>
 #include <WebCore/Cursor.h>
 #include <WebCore/FloatRect.h>
+#if PLATFORM(CG)
 #include <WebCore/GraphicsContextCG.h>
+#endif
 #include <WebCore/IntRect.h>
 #include <WebCore/SoftLinking.h>
 #include <WebCore/WebCoreInstanceHandle.h>
@@ -1110,11 +1112,15 @@ void WebView::setFindIndicator(PassRefPtr<FindIndicator> prpFindIndicator, bool
 
             hbmp = CreateDIBSection(0, &bitmapInfo, DIB_RGB_COLORS, static_cast<void**>(&bits), 0, 0);
             HBITMAP hbmpOld = static_cast<HBITMAP>(SelectObject(hdc, hbmp));
+#if PLATFORM(CG)
             RetainPtr<CGContextRef> context(AdoptCF, CGBitmapContextCreate(bits, width, height,
                 8, width * sizeof(RGBQUAD), deviceRGBColorSpaceRef(), kCGBitmapByteOrder32Little | kCGImageAlphaPremultipliedFirst));
 
             GraphicsContext graphicsContext(context.get());
             contentImage->paint(graphicsContext, IntPoint(), contentImage->bounds());
+#else
+            // FIXME: Implement!
+#endif
 
             ::SelectObject(hdc, hbmpOld);
             ::DeleteDC(hdc);
index 26d8f3d..4ec7d96 100644 (file)
@@ -105,10 +105,10 @@ private:
     RetainPtr<NSURLDownload> m_nsURLDownload;
     RetainPtr<WKDownloadAsDelegate> m_delegate;
 #endif
-#if USE(CFNETWORK)
     bool m_allowOverwrite;
     String m_destination;
     String m_bundlePath;
+#if USE(CFNETWORK)
     RetainPtr<CFURLDownloadRef> m_download;
 #endif
 };
index 6ebce01..ed79721 100644 (file)
@@ -58,9 +58,4 @@ void Download::didDecideDestination(const String& destination, bool allowOverwri
     notImplemented();
 }
 
-void Download::platformDidFinish()
-{
-    notImplemented();
-}
-
 } // namespace WebKit
index 0a18256..08fd4c4 100644 (file)
@@ -197,7 +197,9 @@ void DrawingAreaImpl::layerHostDidFlushLayers()
     if (!m_layerTreeHost)
         return;
 
+#if USE(ACCELERATED_COMPOSITING)
     m_webPage->send(Messages::DrawingAreaProxy::EnterAcceleratedCompositingMode(m_backingStoreStateID, m_layerTreeHost->layerTreeContext()));
+#endif
 }
 
 void DrawingAreaImpl::setRootCompositingLayer(GraphicsLayer* graphicsLayer)
@@ -291,11 +293,13 @@ void DrawingAreaImpl::sendDidUpdateBackingStoreState()
     m_shouldSendDidUpdateBackingStoreState = false;
 
     UpdateInfo updateInfo;
-    LayerTreeContext layerTreeContext;
 
     if (!m_isPaintingSuspended && !m_layerTreeHost)
         display(updateInfo);
 
+#if USE(ACCELERATED_COMPOSITING)
+    LayerTreeContext layerTreeContext;
+
     if (m_isPaintingSuspended || m_layerTreeHost) {
         updateInfo.viewSize = m_webPage->size();
 
@@ -311,6 +315,7 @@ void DrawingAreaImpl::sendDidUpdateBackingStoreState()
     }
 
     m_webPage->send(Messages::DrawingAreaProxy::DidUpdateBackingStoreState(m_backingStoreStateID, updateInfo, layerTreeContext));
+#endif
 }
 
 void DrawingAreaImpl::didUpdate()
@@ -391,9 +396,11 @@ void DrawingAreaImpl::exitAcceleratedCompositingMode()
     else
         display(updateInfo);
 
+#if USE(ACCELERATED_COMPOSITING)
     // Send along a complete update of the page so we can paint the contents right after we exit the
     // accelerated compositing mode, eliminiating flicker.
     m_webPage->send(Messages::DrawingAreaProxy::ExitAcceleratedCompositingMode(m_backingStoreStateID, updateInfo));
+#endif
 }
 
 void DrawingAreaImpl::exitAcceleratedCompositingModeSoon()
index d160f86..033730c 100644 (file)
@@ -2005,6 +2005,7 @@ void WebPage::drawRectToPDF(uint64_t frameID, const WebCore::IntRect& rect, uint
     if (coreFrame) {
         ASSERT(coreFrame->document()->printing());
 
+#if PLATFORM(CG)
         // FIXME: Use CGDataConsumerCreate with callbacks to avoid copying the data.
         RetainPtr<CGDataConsumerRef> pdfDataConsumer(AdoptCF, CGDataConsumerCreateWithCFData(pdfPageData.get()));
 
@@ -2020,6 +2021,7 @@ void WebPage::drawRectToPDF(uint64_t frameID, const WebCore::IntRect& rect, uint
 
         CGPDFContextEndPage(context.get());
         CGPDFContextClose(context.get());
+#endif
     }
 
     send(Messages::WebPageProxy::DataCallback(CoreIPC::DataReference(CFDataGetBytePtr(pdfPageData.get()), CFDataGetLength(pdfPageData.get())), callbackID));
@@ -2035,6 +2037,7 @@ void WebPage::drawPagesToPDF(uint64_t frameID, uint32_t first, uint32_t count, u
     if (coreFrame) {
         ASSERT(coreFrame->document()->printing());
 
+#if PLATFORM(CG)
         // FIXME: Use CGDataConsumerCreate with callbacks to avoid copying the data.
         RetainPtr<CGDataConsumerRef> pdfDataConsumer(AdoptCF, CGDataConsumerCreateWithCFData(pdfPageData.get()));
 
@@ -2055,6 +2058,7 @@ void WebPage::drawPagesToPDF(uint64_t frameID, uint32_t first, uint32_t count, u
             CGPDFContextEndPage(context.get());
         }
         CGPDFContextClose(context.get());
+#endif
     }
 
     send(Messages::WebPageProxy::DataCallback(CoreIPC::DataReference(CFDataGetBytePtr(pdfPageData.get()), CFDataGetLength(pdfPageData.get())), callbackID));
index 01fcbef..3e802ab 100755 (executable)
                                <File
                                        RelativePath="..\Shared\win\LayerTreeContextWin.cpp"
                                        >
+                                       <FileConfiguration
+                                               Name="Debug_Cairo_CFLite|Win32"
+                                               ExcludedFromBuild="true"
+                                               >
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                               />
+                                       </FileConfiguration>
+                                       <FileConfiguration
+                                               Name="Release_Cairo_CFLite|Win32"
+                                               ExcludedFromBuild="true"
+                                               >
+                                               <Tool
+                                                       Name="VCCLCompilerTool"
+                                               />
+                                       </FileConfiguration>
                                </File>
                                <File
                                        RelativePath="..\Shared\win\NativeWebKeyboardEventWin.cpp"