[SCM] WebKit Debian packaging branch, webkit-1.3, updated. upstream/1.3.7-4207-g178b198

andersca at apple.com andersca at apple.com
Sun Feb 20 22:52:42 UTC 2011


The following commit has been merged in the webkit-1.3 branch:
commit bde78b27827d464f0379f19bcc1e8e9bcdc7fc6e
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Jan 12 22:34:35 2011 +0000

    2011-01-12  Anders Carlsson  <andersca at apple.com>
    
            Reviewed by Sam Weinig.
    
            Begin stubbing out some more BackingStore member functions
            https://bugs.webkit.org/show_bug.cgi?id=52323
    
            * UIProcess/BackingStore.cpp:
            (WebKit::BackingStore::~BackingStore):
            This was accidentally made into a constructor; it should be a destructor.
    
            * UIProcess/DrawingAreaProxyImpl.cpp:
            (WebKit::DrawingAreaProxyImpl::paint):
            Call the backing store.
    
            (WebKit::DrawingAreaProxyImpl::update):
            Incorporate the update.
    
            (WebKit::DrawingAreaProxyImpl::incorporateUpdate):
            Create the backing store if needed and incorporate the update.
    
            * UIProcess/mac/BackingStoreMac.mm: Added.
            (WebKit::BackingStore::platformInitialize):
            Create a bitmap context.
    
            (WebKit::BackingStore::paint):
            (WebKit::BackingStore::incorporateUpdate):
            Add stubs.
    
            * WebKit2.xcodeproj/project.pbxproj:
            Add BackingStoreMac.mm
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75640 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 682091a..5cef516 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,35 @@
+2011-01-12  Anders Carlsson  <andersca at apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Begin stubbing out some more BackingStore member functions
+        https://bugs.webkit.org/show_bug.cgi?id=52323
+
+        * UIProcess/BackingStore.cpp:
+        (WebKit::BackingStore::~BackingStore):
+        This was accidentally made into a constructor; it should be a destructor.
+
+        * UIProcess/DrawingAreaProxyImpl.cpp:
+        (WebKit::DrawingAreaProxyImpl::paint):
+        Call the backing store.
+
+        (WebKit::DrawingAreaProxyImpl::update):
+        Incorporate the update.
+
+        (WebKit::DrawingAreaProxyImpl::incorporateUpdate):
+        Create the backing store if needed and incorporate the update.
+
+        * UIProcess/mac/BackingStoreMac.mm: Added.
+        (WebKit::BackingStore::platformInitialize):
+        Create a bitmap context.
+
+        (WebKit::BackingStore::paint):
+        (WebKit::BackingStore::incorporateUpdate):
+        Add stubs.
+
+        * WebKit2.xcodeproj/project.pbxproj:
+        Add BackingStoreMac.mm
+
 2011-01-12  Beth Dakin  <bdakin at apple.com>
 
         Reviewed by Anders Carlsson.
diff --git a/WebKit2/UIProcess/BackingStore.cpp b/WebKit2/UIProcess/BackingStore.cpp
index 0fd6ccd..65d9adc 100644
--- a/WebKit2/UIProcess/BackingStore.cpp
+++ b/WebKit2/UIProcess/BackingStore.cpp
@@ -33,18 +33,17 @@ using namespace WebCore;
 
 namespace WebKit {
 
-PassOwnPtr<BackingStore> BackingStore::create(WebPageProxy* webPageProxy, const IntSize& size)
+PassOwnPtr<BackingStore> BackingStore::create(const IntSize& size)
 {
-    return adoptPtr(new BackingStore(webPageProxy, size));
+    return adoptPtr(new BackingStore(size));
 }
 
-BackingStore::BackingStore(WebPageProxy* webPageProxy, const IntSize& size)
-    : m_webPageProxy(webPageProxy)
-    , m_size(size)
+BackingStore::BackingStore(const IntSize& size)
+    : m_size(size)
 {
 }
 
-BackingStore::BackingStore()
+BackingStore::~BackingStore()
 {
 }
 
diff --git a/WebKit2/UIProcess/BackingStore.h b/WebKit2/UIProcess/BackingStore.h
index cdedd5b..4d6a49f 100644
--- a/WebKit2/UIProcess/BackingStore.h
+++ b/WebKit2/UIProcess/BackingStore.h
@@ -30,22 +30,43 @@
 #include <wtf/Noncopyable.h>
 #include <wtf/PassOwnPtr.h>
 
+#if PLATFORM(MAC)
+#include <wtf/RetainPtr.h>
+#endif
+
+namespace WebCore {
+    class IntRect;
+}
+
 namespace WebKit {
 
+class UpdateInfo;
 class WebPageProxy;
 
 class BackingStore {
     WTF_MAKE_NONCOPYABLE(BackingStore);
 
 public:
-    static PassOwnPtr<BackingStore> create(WebPageProxy*, const WebCore::IntSize&);
-    BackingStore();
+    static PassOwnPtr<BackingStore> create(const WebCore::IntSize&);
+    ~BackingStore();
+
+#if PLATFORM(MAC)
+    typedef CGContextRef PlatformGraphicsContext;
+#endif
+
+    void paint(PlatformGraphicsContext, const WebCore::IntRect&);
+    void incorporateUpdate(const UpdateInfo&);
 
 private:
-    BackingStore(WebPageProxy*, const WebCore::IntSize&);
+    explicit BackingStore(const WebCore::IntSize&);
+
+    void platformInitialize();
 
-    WebPageProxy* m_webPageProxy;
     WebCore::IntSize m_size;
+
+#if PLATFORM(MAC)
+    RetainPtr<CGContextRef> m_bitmapContext;
+#endif
 };
 
 } // namespace WebKit
diff --git a/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp b/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp
index 3a309bc..c66ecc6 100644
--- a/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp
+++ b/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp
@@ -26,6 +26,7 @@
 #include "DrawingAreaProxyImpl.h"
 
 #include "DrawingAreaMessages.h"
+#include "UpdateInfo.h"
 #include "WebPageProxy.h"
 #include "WebProcessProxy.h"
 
@@ -33,6 +34,8 @@
 #error "This drawing area is not ready for use by other ports yet."
 #endif
 
+using namespace WebCore;
+
 namespace WebKit {
 
 PassOwnPtr<DrawingAreaProxyImpl> DrawingAreaProxyImpl::create(WebPageProxy* webPageProxy)
@@ -49,6 +52,14 @@ DrawingAreaProxyImpl::~DrawingAreaProxyImpl()
 {
 }
 
+void DrawingAreaProxyImpl::paint(BackingStore::PlatformGraphicsContext context, const IntRect& rect)
+{
+    if (!m_backingStore)
+        return;
+
+    m_backingStore->paint(context, rect);
+}
+
 void DrawingAreaProxyImpl::didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*)
 {
     ASSERT_NOT_REACHED();
@@ -85,10 +96,11 @@ void DrawingAreaProxyImpl::detachCompositingContext()
     ASSERT_NOT_REACHED();
 }
 
-void DrawingAreaProxyImpl::update(const UpdateInfo&)
+void DrawingAreaProxyImpl::update(const UpdateInfo& updateInfo)
 {
-    // FIXME: Incorporate the update.
+    // FIXME: Handle the case where the view is hidden.
 
+    incorporateUpdate(updateInfo);
     m_webPageProxy->process()->send(Messages::DrawingArea::DidUpdate(), m_webPageProxy->pageID());
 }
 
@@ -96,6 +108,16 @@ void DrawingAreaProxyImpl::didSetSize()
 {
 }
 
+void DrawingAreaProxyImpl::incorporateUpdate(const UpdateInfo& updateInfo)
+{
+    // FIXME: Check for the update bounds being empty here.
+
+    if (!m_backingStore)
+        m_backingStore = BackingStore::create(m_webPageProxy, updateInfo.viewSize);
+
+    m_backingStore->incorporateUpdate(updateInfo);
+}
+
 void DrawingAreaProxyImpl::sendSetSize()
 {
     if (!m_webPageProxy->isValid())
diff --git a/WebKit2/UIProcess/DrawingAreaProxyImpl.h b/WebKit2/UIProcess/DrawingAreaProxyImpl.h
index 32ab4e1..0de7ada 100644
--- a/WebKit2/UIProcess/DrawingAreaProxyImpl.h
+++ b/WebKit2/UIProcess/DrawingAreaProxyImpl.h
@@ -26,6 +26,7 @@
 #ifndef DrawingAreaProxyImpl_h
 #define DrawingAreaProxyImpl_h
 
+#include "BackingStore.h"
 #include "DrawingAreaProxy.h"
 
 namespace WebKit {
@@ -35,6 +36,8 @@ public:
     static PassOwnPtr<DrawingAreaProxyImpl> create(WebPageProxy*);
     virtual ~DrawingAreaProxyImpl();
 
+    void paint(BackingStore::PlatformGraphicsContext, const WebCore::IntRect&);
+
 private:
     explicit DrawingAreaProxyImpl(WebPageProxy*);
 
@@ -51,7 +54,10 @@ private:
     virtual void update(const UpdateInfo&);
     virtual void didSetSize();
     
+    void incorporateUpdate(const UpdateInfo&);
     void sendSetSize();
+
+    OwnPtr<BackingStore> m_backingStore;
 };
 
 } // namespace WebKit
diff --git a/WebKit2/UIProcess/mac/BackingStoreMac.mm b/WebKit2/UIProcess/mac/BackingStoreMac.mm
new file mode 100644
index 0000000..69a9bcc
--- /dev/null
+++ b/WebKit2/UIProcess/mac/BackingStoreMac.mm
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "BackingStore.h"
+
+using namespace WebCore;
+
+namespace WebKit {
+
+void BackingStore::platformInitialize()
+{
+    RetainPtr<CGColorSpaceRef> colorSpace(AdoptCF, CGColorSpaceCreateDeviceRGB());
+
+    m_bitmapContext.adoptCF(CGBitmapContextCreate(0, m_size.width(), m_size.height(), 8, m_size.width() * 4, colorSpace.get(), kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host));
+}
+
+void BackingStore::paint(PlatformGraphicsContext, const IntRect&)
+{
+    // FIXME: Implement.
+}
+
+void BackingStore::incorporateUpdate(const UpdateInfo&)
+{
+    // FIXME: Implement.
+}
+
+} // namespace WebKit
diff --git a/WebKit2/WebKit2.xcodeproj/project.pbxproj b/WebKit2/WebKit2.xcodeproj/project.pbxproj
index 746b186..e701ff6 100644
--- a/WebKit2/WebKit2.xcodeproj/project.pbxproj
+++ b/WebKit2/WebKit2.xcodeproj/project.pbxproj
@@ -139,6 +139,7 @@
 		1A64245F12DE29A100CAAE2C /* UpdateInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A64245D12DE29A100CAAE2C /* UpdateInfo.cpp */; };
 		1A64256812DE42EC00CAAE2C /* BackingStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A64256612DE42EC00CAAE2C /* BackingStore.h */; };
 		1A64256912DE42EC00CAAE2C /* BackingStore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A64256712DE42EC00CAAE2C /* BackingStore.cpp */; };
+		1A64292D12DE5F9800CAAE2C /* BackingStoreMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A64292C12DE5F9800CAAE2C /* BackingStoreMac.mm */; };
 		1A6F9F9011E13EFC00DB1371 /* CommandLine.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A6F9F8E11E13EFC00DB1371 /* CommandLine.h */; };
 		1A6F9FB711E1408500DB1371 /* CommandLineMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6F9FB611E1408500DB1371 /* CommandLineMac.cpp */; };
 		1A6FA01E11E1526300DB1371 /* WebProcessMainMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A6FA01D11E1526300DB1371 /* WebProcessMainMac.mm */; };
@@ -859,6 +860,7 @@
 		1A64245D12DE29A100CAAE2C /* UpdateInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UpdateInfo.cpp; sourceTree = "<group>"; };
 		1A64256612DE42EC00CAAE2C /* BackingStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BackingStore.h; sourceTree = "<group>"; };
 		1A64256712DE42EC00CAAE2C /* BackingStore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BackingStore.cpp; sourceTree = "<group>"; };
+		1A64292C12DE5F9800CAAE2C /* BackingStoreMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = BackingStoreMac.mm; sourceTree = "<group>"; };
 		1A6F9F8E11E13EFC00DB1371 /* CommandLine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommandLine.h; sourceTree = "<group>"; };
 		1A6F9FB611E1408500DB1371 /* CommandLineMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CommandLineMac.cpp; sourceTree = "<group>"; };
 		1A6FA01D11E1526300DB1371 /* WebProcessMainMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebProcessMainMac.mm; sourceTree = "<group>"; };
@@ -2515,6 +2517,7 @@
 		BCCF085C113F3B7500C650C5 /* mac */ = {
 			isa = PBXGroup;
 			children = (
+				1A64292C12DE5F9800CAAE2C /* BackingStoreMac.mm */,
 				BC2651F511825EF800243E12 /* ChunkedUpdateDrawingAreaProxyMac.mm */,
 				0F5265BB11DD37860006D33C /* LayerBackedDrawingAreaProxyMac.mm */,
 				1AA417ED12C00D87002BE67B /* TextCheckerMac.mm */,
@@ -3480,6 +3483,7 @@
 				1A64235212DD187C00CAAE2C /* Region.cpp in Sources */,
 				1A64245F12DE29A100CAAE2C /* UpdateInfo.cpp in Sources */,
 				1A64256912DE42EC00CAAE2C /* BackingStore.cpp in Sources */,
+				1A64292D12DE5F9800CAAE2C /* BackingStoreMac.mm in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list