[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:48:16 UTC 2011


The following commit has been merged in the webkit-1.3 branch:
commit a094bedb03ce14547378cfcaa2190607f8b717e8
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jan 11 20:13:20 2011 +0000

    2011-01-11  Anders Carlsson  <andersca at apple.com>
    
            Reviewed by Sam Weinig.
    
            Rename BackingStore to ShareableBitmap
            https://bugs.webkit.org/show_bug.cgi?id=52228
    
            * GNUmakefile.am:
            * PluginProcess/PluginControllerProxy.cpp:
            (WebKit::PluginControllerProxy::geometryDidChange):
            * PluginProcess/PluginControllerProxy.h:
            * Shared/API/c/cg/WKImageCG.cpp:
            (WKImageCreateCGImage):
            * Shared/BackingStore.cpp: Removed.
            * Shared/BackingStore.h: Removed.
            * Shared/PlatformPopupMenuData.cpp:
            (WebKit::PlatformPopupMenuData::decode):
            * Shared/PlatformPopupMenuData.h:
            * Shared/ShareableBitmap.cpp: Copied from WebKit2/Shared/BackingStore.cpp.
            (WebKit::ShareableBitmap::create):
            (WebKit::ShareableBitmap::createSharable):
            (WebKit::ShareableBitmap::createHandle):
            (WebKit::ShareableBitmap::ShareableBitmap):
            (WebKit::ShareableBitmap::~ShareableBitmap):
            (WebKit::ShareableBitmap::resize):
            (WebKit::ShareableBitmap::data):
            * Shared/ShareableBitmap.h: Copied from WebKit2/Shared/BackingStore.h.
            * Shared/UserMessageCoders.h:
            (WebKit::UserMessageEncoder::baseEncode):
            (WebKit::UserMessageDecoder::baseDecode):
            * Shared/WebImage.cpp:
            (WebKit::WebImage::create):
            (WebKit::WebImage::WebImage):
            (WebKit::WebImage::~WebImage):
            (WebKit::WebImage::size):
            * Shared/WebImage.h:
            (WebKit::WebImage::bitmap):
            * Shared/cairo/BackingStoreCairo.cpp:
            (WebKit::ShareableBitmap::createGraphicsContext):
            (WebKit::ShareableBitmap::paint):
            * Shared/cg/BackingStoreCG.cpp: Removed.
            * Shared/cg/ShareableBitmapCG.cpp: Copied from WebKit2/Shared/cg/BackingStoreCG.cpp.
            (WebKit::ShareableBitmap::createGraphicsContext):
            (WebKit::ShareableBitmap::paint):
            * Shared/gtk/BackingStoreGtk.cpp: Removed.
            * Shared/gtk/ShareableBitmapGtk.cpp: Copied from WebKit2/Shared/gtk/BackingStoreGtk.cpp.
            (WebKit::ShareableBitmap::createGraphicsContext):
            (WebKit::ShareableBitmap::paint):
            * Shared/qt/BackingStoreQt.cpp: Removed.
            * Shared/qt/ShareableBitmapQt.cpp: Copied from WebKit2/Shared/qt/BackingStoreQt.cpp.
            (WebKit::ShareableBitmap::createGraphicsContext):
            (WebKit::ShareableBitmap::paint):
            * UIProcess/FindIndicator.cpp:
            (WebKit::FindIndicator::create):
            (WebKit::FindIndicator::FindIndicator):
            * UIProcess/FindIndicator.h:
            (WebKit::FindIndicator::contentImage):
            * WebKit2.pro:
            * WebKit2.xcodeproj/project.pbxproj:
            * WebProcess/Plugins/PluginProxy.cpp:
            (WebKit::PluginProxy::geometryDidChange):
            * WebProcess/Plugins/PluginProxy.h:
            * WebProcess/WebPage/FindController.cpp:
            (WebKit::FindController::updateFindIndicator):
            * WebProcess/WebPage/WebPage.cpp:
            (WebKit::WebPage::snapshotInViewCoordinates):
            (WebKit::WebPage::snapshotInDocumentCoordinates):
            * win/WebKit2.vcproj:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75527 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 6111f66..1459fdd 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,72 @@
+2011-01-11  Anders Carlsson  <andersca at apple.com>
+
+        Reviewed by Sam Weinig.
+
+        Rename BackingStore to ShareableBitmap
+        https://bugs.webkit.org/show_bug.cgi?id=52228
+
+        * GNUmakefile.am:
+        * PluginProcess/PluginControllerProxy.cpp:
+        (WebKit::PluginControllerProxy::geometryDidChange):
+        * PluginProcess/PluginControllerProxy.h:
+        * Shared/API/c/cg/WKImageCG.cpp:
+        (WKImageCreateCGImage):
+        * Shared/BackingStore.cpp: Removed.
+        * Shared/BackingStore.h: Removed.
+        * Shared/PlatformPopupMenuData.cpp:
+        (WebKit::PlatformPopupMenuData::decode):
+        * Shared/PlatformPopupMenuData.h:
+        * Shared/ShareableBitmap.cpp: Copied from WebKit2/Shared/BackingStore.cpp.
+        (WebKit::ShareableBitmap::create):
+        (WebKit::ShareableBitmap::createSharable):
+        (WebKit::ShareableBitmap::createHandle):
+        (WebKit::ShareableBitmap::ShareableBitmap):
+        (WebKit::ShareableBitmap::~ShareableBitmap):
+        (WebKit::ShareableBitmap::resize):
+        (WebKit::ShareableBitmap::data):
+        * Shared/ShareableBitmap.h: Copied from WebKit2/Shared/BackingStore.h.
+        * Shared/UserMessageCoders.h:
+        (WebKit::UserMessageEncoder::baseEncode):
+        (WebKit::UserMessageDecoder::baseDecode):
+        * Shared/WebImage.cpp:
+        (WebKit::WebImage::create):
+        (WebKit::WebImage::WebImage):
+        (WebKit::WebImage::~WebImage):
+        (WebKit::WebImage::size):
+        * Shared/WebImage.h:
+        (WebKit::WebImage::bitmap):
+        * Shared/cairo/BackingStoreCairo.cpp:
+        (WebKit::ShareableBitmap::createGraphicsContext):
+        (WebKit::ShareableBitmap::paint):
+        * Shared/cg/BackingStoreCG.cpp: Removed.
+        * Shared/cg/ShareableBitmapCG.cpp: Copied from WebKit2/Shared/cg/BackingStoreCG.cpp.
+        (WebKit::ShareableBitmap::createGraphicsContext):
+        (WebKit::ShareableBitmap::paint):
+        * Shared/gtk/BackingStoreGtk.cpp: Removed.
+        * Shared/gtk/ShareableBitmapGtk.cpp: Copied from WebKit2/Shared/gtk/BackingStoreGtk.cpp.
+        (WebKit::ShareableBitmap::createGraphicsContext):
+        (WebKit::ShareableBitmap::paint):
+        * Shared/qt/BackingStoreQt.cpp: Removed.
+        * Shared/qt/ShareableBitmapQt.cpp: Copied from WebKit2/Shared/qt/BackingStoreQt.cpp.
+        (WebKit::ShareableBitmap::createGraphicsContext):
+        (WebKit::ShareableBitmap::paint):
+        * UIProcess/FindIndicator.cpp:
+        (WebKit::FindIndicator::create):
+        (WebKit::FindIndicator::FindIndicator):
+        * UIProcess/FindIndicator.h:
+        (WebKit::FindIndicator::contentImage):
+        * WebKit2.pro:
+        * WebKit2.xcodeproj/project.pbxproj:
+        * WebProcess/Plugins/PluginProxy.cpp:
+        (WebKit::PluginProxy::geometryDidChange):
+        * WebProcess/Plugins/PluginProxy.h:
+        * WebProcess/WebPage/FindController.cpp:
+        (WebKit::FindController::updateFindIndicator):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::snapshotInViewCoordinates):
+        (WebKit::WebPage::snapshotInDocumentCoordinates):
+        * win/WebKit2.vcproj:
+
 2011-01-11  John Sullivan  <sullivan at apple.com>
 
         Reviewed by Anders Carlsson.
diff --git a/WebKit2/GNUmakefile.am b/WebKit2/GNUmakefile.am
index a14022c..1a753c2 100644
--- a/WebKit2/GNUmakefile.am
+++ b/WebKit2/GNUmakefile.am
@@ -152,8 +152,8 @@ libWebKit2_la_SOURCES = \
 	WebKit2/Shared/API/c/WKUserContentURLPattern.cpp \
 	WebKit2/Shared/API/c/WKUserContentURLPattern.h \
 	WebKit2/Shared/APIObject.h \
-	WebKit2/Shared/BackingStore.cpp \
-	WebKit2/Shared/BackingStore.h \
+	WebKit2/Shared/ShareableBitmap.cpp \
+	WebKit2/Shared/ShareableBitmap.h \
 	WebKit2/Shared/CacheModel.h \
 	WebKit2/Shared/ChildProcess.cpp \
 	WebKit2/Shared/ChildProcess.h \
@@ -166,7 +166,7 @@ libWebKit2_la_SOURCES = \
 	WebKit2/Shared/CoreIPCSupport/WebProcessProxyMessageKinds.h \
 	WebKit2/Shared/DrawingAreaInfo.h \
 	WebKit2/Shared/FontSmoothingLevel.h \
-	WebKit2/Shared/gtk/BackingStoreGtk.cpp \
+	WebKit2/Shared/gtk/ShareableBitmapGtk.cpp \
 	WebKit2/Shared/gtk/PlatformCertificateInfo.h \
 	WebKit2/Shared/gtk/WebCoreArgumentCodersGtk.cpp \
 	WebKit2/Shared/ImageOptions.h \
diff --git a/WebKit2/PluginProcess/PluginControllerProxy.cpp b/WebKit2/PluginProcess/PluginControllerProxy.cpp
index 881d5d2..5eb8dd4 100644
--- a/WebKit2/PluginProcess/PluginControllerProxy.cpp
+++ b/WebKit2/PluginProcess/PluginControllerProxy.cpp
@@ -27,7 +27,6 @@
 
 #include "PluginControllerProxy.h"
 
-#include "BackingStore.h"
 #include "DataReference.h"
 #include "NPObjectProxy.h"
 #include "NPRemoteObjectMap.h"
@@ -36,6 +35,7 @@
 #include "NetscapePlugin.h"
 #include "PluginProcess.h"
 #include "PluginProxyMessages.h"
+#include "ShareableBitmap.h"
 #include "WebCoreArgumentCoders.h"
 #include "WebProcessConnection.h"
 #include <WebCore/GraphicsContext.h>
@@ -298,7 +298,7 @@ void PluginControllerProxy::geometryDidChange(const IntRect& frameRect, const In
 
     if (!backingStoreHandle.isNull()) {
         // Create a new backing store.
-        m_backingStore = BackingStore::create(frameRect.size(), backingStoreHandle);
+        m_backingStore = ShareableBitmap::create(frameRect.size(), backingStoreHandle);
     }
 
     m_plugin->geometryDidChange(frameRect, clipRect);
diff --git a/WebKit2/PluginProcess/PluginControllerProxy.h b/WebKit2/PluginProcess/PluginControllerProxy.h
index ebf4567..339c151 100644
--- a/WebKit2/PluginProcess/PluginControllerProxy.h
+++ b/WebKit2/PluginProcess/PluginControllerProxy.h
@@ -47,7 +47,7 @@ namespace CoreIPC {
 
 namespace WebKit {
 
-class BackingStore;
+class ShareableBitmap;
 class WebProcessConnection;
 
 class PluginControllerProxy : PluginController {
@@ -168,7 +168,7 @@ private:
 #endif
     
     // The backing store that this plug-in draws into.
-    RefPtr<BackingStore> m_backingStore;
+    RefPtr<ShareableBitmap> m_backingStore;
 };
 
 } // namespace WebKit
diff --git a/WebKit2/Shared/API/c/cg/WKImageCG.cpp b/WebKit2/Shared/API/c/cg/WKImageCG.cpp
index 687415c..34a8bf1 100644
--- a/WebKit2/Shared/API/c/cg/WKImageCG.cpp
+++ b/WebKit2/Shared/API/c/cg/WKImageCG.cpp
@@ -25,6 +25,7 @@
 
 #include "WKImageCG.h"
 
+#include "ShareableBitmap.h"
 #include "WKSharedAPICast.h"
 #include "WebImage.h"
 #include <WebCore/GraphicsContext.h>
@@ -34,6 +35,6 @@ using namespace WebCore;
 
 CGImageRef WKImageCreateCGImage(WKImageRef imageRef)
 {
-    OwnPtr<GraphicsContext> sourceContext = toImpl(imageRef)->backingStore()->createGraphicsContext();
+    OwnPtr<GraphicsContext> sourceContext = toImpl(imageRef)->bitmap()->createGraphicsContext();
     return CGBitmapContextCreateImage(sourceContext->platformContext());
 }
diff --git a/WebKit2/Shared/BackingStore.cpp b/WebKit2/Shared/BackingStore.cpp
deleted file mode 100644
index 4244eaa..0000000
--- a/WebKit2/Shared/BackingStore.cpp
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Copyright (C) 2010 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"
-
-#include "SharedMemory.h"
-#include <WebCore/GraphicsContext.h>
-
-using namespace WebCore;
-
-namespace WebKit {
-
-PassRefPtr<BackingStore> BackingStore::create(const WebCore::IntSize& size)
-{
-    size_t numBytes = numBytesForSize(size);
-    
-    void* data = 0;
-    if (!tryFastMalloc(numBytes).getValue(data))
-        return 0;
-
-    return adoptRef(new BackingStore(size, data));
-}
-
-PassRefPtr<BackingStore> BackingStore::createSharable(const IntSize& size)
-{
-    size_t numBytes = numBytesForSize(size);
-    
-    RefPtr<SharedMemory> sharedMemory = SharedMemory::create(numBytes);
-    if (!sharedMemory)
-        return 0;
-    
-    return adoptRef(new BackingStore(size, sharedMemory));
-}
-
-PassRefPtr<BackingStore> BackingStore::create(const WebCore::IntSize& size, const SharedMemory::Handle& handle)
-{
-    // Create the shared memory.
-    RefPtr<SharedMemory> sharedMemory = SharedMemory::create(handle, SharedMemory::ReadWrite);
-    if (!sharedMemory)
-        return 0;
-
-    size_t numBytes = numBytesForSize(size);
-    ASSERT_UNUSED(numBytes, sharedMemory->size() >= numBytes);
-
-    return adoptRef(new BackingStore(size, sharedMemory));
-}
-
-bool BackingStore::createHandle(SharedMemory::Handle& handle)
-{
-    ASSERT(isBackedBySharedMemory());
-
-    return m_sharedMemory->createHandle(handle, SharedMemory::ReadWrite);
-}
-
-BackingStore::BackingStore(const IntSize& size, void* data)
-    : m_size(size)
-    , m_data(data)
-{
-}
-
-BackingStore::BackingStore(const IntSize& size, PassRefPtr<SharedMemory> sharedMemory)
-    : m_size(size)
-    , m_sharedMemory(sharedMemory)
-    , m_data(0)
-{
-}
-
-BackingStore::~BackingStore()
-{
-    if (!isBackedBySharedMemory())
-        fastFree(m_data);
-}
-
-bool BackingStore::resize(const IntSize& size)
-{
-    // We can't resize backing stores that are backed by shared memory.
-    ASSERT(!isBackedBySharedMemory());
-
-    if (size == m_size)
-        return true;
-
-    size_t newNumBytes = numBytesForSize(size);
-    
-    // Try to resize.
-    char* newData = 0;
-    if (!tryFastRealloc(m_data, newNumBytes).getValue(newData)) {
-        // We failed, but the backing store is still kept in a consistent state.
-        return false;
-    }
-
-    m_size = size;
-    m_data = newData;
-
-    return true;
-}
-
-void* BackingStore::data() const
-{
-    if (isBackedBySharedMemory())
-        return m_sharedMemory->data();
-
-    ASSERT(m_data);
-    return m_data;
-}
-
-} // namespace WebKit
diff --git a/WebKit2/Shared/BackingStore.h b/WebKit2/Shared/BackingStore.h
deleted file mode 100644
index f2c580d..0000000
--- a/WebKit2/Shared/BackingStore.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (C) 2010 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.
- */
-
-#ifndef BackingStore_h
-#define BackingStore_h
-
-#include "SharedMemory.h"
-#include <WebCore/IntRect.h>
-#include <wtf/PassOwnPtr.h>
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefCounted.h>
-#include <wtf/RefPtr.h>
-
-namespace WebCore {
-    class GraphicsContext;
-}
-
-namespace WebKit {
-    
-class BackingStore : public RefCounted<BackingStore> {
-public:
-    // Create a backing store that uses malloced memory.
-    static PassRefPtr<BackingStore> create(const WebCore::IntSize&);
-
-    // Create a backing store whose backing memory can be shared with another process.
-    static PassRefPtr<BackingStore> createSharable(const WebCore::IntSize&);
-
-    // Create a backing store from a shared memory handle.
-    static PassRefPtr<BackingStore> create(const WebCore::IntSize&, const SharedMemory::Handle&);
-
-    // Create a shared memory handle.
-    bool createHandle(SharedMemory::Handle&);
-
-    ~BackingStore();
-
-    const WebCore::IntSize& size() const { return m_size; }
-    WebCore::IntRect bounds() const { return WebCore::IntRect(WebCore::IntPoint(), size()); }
-
-    bool resize(const WebCore::IntSize& size);
-
-    // Create a graphics context that can be used to paint into the backing store.
-    PassOwnPtr<WebCore::GraphicsContext> createGraphicsContext();
-
-    // Paint the backing store into the given context.
-    void paint(WebCore::GraphicsContext&, const WebCore::IntPoint& dstPoint, const WebCore::IntRect& srcRect);
-
-    bool isBackedBySharedMemory() const { return m_sharedMemory; }
-
-private:
-    BackingStore(const WebCore::IntSize&, void*);
-    BackingStore(const WebCore::IntSize&, PassRefPtr<SharedMemory>);
-
-    static size_t numBytesForSize(const WebCore::IntSize& size) { return size.width() * size.height() * 4; }
-
-    void* data() const;
-    size_t sizeInBytes() const { return numBytesForSize(m_size); }
-
-    WebCore::IntSize m_size;
-
-    // If the backing store is backed by shared memory, this points to the shared memory object.
-    RefPtr<SharedMemory> m_sharedMemory;
-
-    // If the backing store is backed by fastMalloced memory, this points to the data.
-    void* m_data;
-};
-
-} // namespace WebKit
-
-#endif // BackingStore_h
diff --git a/WebKit2/Shared/PlatformPopupMenuData.cpp b/WebKit2/Shared/PlatformPopupMenuData.cpp
index 0a3f6ef..6d90ce5 100644
--- a/WebKit2/Shared/PlatformPopupMenuData.cpp
+++ b/WebKit2/Shared/PlatformPopupMenuData.cpp
@@ -84,12 +84,12 @@ bool PlatformPopupMenuData::decode(CoreIPC::ArgumentDecoder* decoder, PlatformPo
     SharedMemory::Handle notSelectedBackingStoreHandle;
     if (!decoder->decode(notSelectedBackingStoreHandle))
         return false;
-    d.m_notSelectedBackingStore = BackingStore::create(d.m_backingStoreSize, notSelectedBackingStoreHandle);
+    d.m_notSelectedBackingStore = ShareableBitmap::create(d.m_backingStoreSize, notSelectedBackingStoreHandle);
 
     SharedMemory::Handle selectedBackingStoreHandle;
     if (!decoder->decode(selectedBackingStoreHandle))
         return false;
-    d.m_selectedBackingStore = BackingStore::create(d.m_backingStoreSize, selectedBackingStoreHandle);
+    d.m_selectedBackingStore = ShareableBitmap::create(d.m_backingStoreSize, selectedBackingStoreHandle);
 
     data = d;
 #endif
diff --git a/WebKit2/Shared/PlatformPopupMenuData.h b/WebKit2/Shared/PlatformPopupMenuData.h
index 6f743da..88e03fc 100644
--- a/WebKit2/Shared/PlatformPopupMenuData.h
+++ b/WebKit2/Shared/PlatformPopupMenuData.h
@@ -26,7 +26,7 @@
 #ifndef PlatformPopupMenuData_h
 #define PlatformPopupMenuData_h
 
-#include "BackingStore.h"
+#include "ShareableBitmap.h"
 #include <wtf/text/WTFString.h>
 
 namespace CoreIPC {
@@ -50,8 +50,8 @@ struct PlatformPopupMenuData {
     int m_popupWidth;
     int m_itemHeight;
     WebCore::IntSize m_backingStoreSize;
-    RefPtr<BackingStore> m_notSelectedBackingStore;
-    RefPtr<BackingStore> m_selectedBackingStore;
+    RefPtr<ShareableBitmap> m_notSelectedBackingStore;
+    RefPtr<ShareableBitmap> m_selectedBackingStore;
 #endif
 };
 
diff --git a/WebKit2/Shared/ShareableBitmap.cpp b/WebKit2/Shared/ShareableBitmap.cpp
new file mode 100644
index 0000000..b2393c9
--- /dev/null
+++ b/WebKit2/Shared/ShareableBitmap.cpp
@@ -0,0 +1,128 @@
+/*
+ * Copyright (C) 2010 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 "ShareableBitmap.h"
+
+#include "SharedMemory.h"
+#include <WebCore/GraphicsContext.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+PassRefPtr<ShareableBitmap> ShareableBitmap::create(const WebCore::IntSize& size)
+{
+    size_t numBytes = numBytesForSize(size);
+    
+    void* data = 0;
+    if (!tryFastMalloc(numBytes).getValue(data))
+        return 0;
+
+    return adoptRef(new ShareableBitmap(size, data));
+}
+
+PassRefPtr<ShareableBitmap> ShareableBitmap::createSharable(const IntSize& size)
+{
+    size_t numBytes = numBytesForSize(size);
+    
+    RefPtr<SharedMemory> sharedMemory = SharedMemory::create(numBytes);
+    if (!sharedMemory)
+        return 0;
+    
+    return adoptRef(new ShareableBitmap(size, sharedMemory));
+}
+
+PassRefPtr<ShareableBitmap> ShareableBitmap::create(const WebCore::IntSize& size, const SharedMemory::Handle& handle)
+{
+    // Create the shared memory.
+    RefPtr<SharedMemory> sharedMemory = SharedMemory::create(handle, SharedMemory::ReadWrite);
+    if (!sharedMemory)
+        return 0;
+
+    size_t numBytes = numBytesForSize(size);
+    ASSERT_UNUSED(numBytes, sharedMemory->size() >= numBytes);
+
+    return adoptRef(new ShareableBitmap(size, sharedMemory));
+}
+
+bool ShareableBitmap::createHandle(SharedMemory::Handle& handle)
+{
+    ASSERT(isBackedBySharedMemory());
+
+    return m_sharedMemory->createHandle(handle, SharedMemory::ReadWrite);
+}
+
+ShareableBitmap::ShareableBitmap(const IntSize& size, void* data)
+    : m_size(size)
+    , m_data(data)
+{
+}
+
+ShareableBitmap::ShareableBitmap(const IntSize& size, PassRefPtr<SharedMemory> sharedMemory)
+    : m_size(size)
+    , m_sharedMemory(sharedMemory)
+    , m_data(0)
+{
+}
+
+ShareableBitmap::~ShareableBitmap()
+{
+    if (!isBackedBySharedMemory())
+        fastFree(m_data);
+}
+
+bool ShareableBitmap::resize(const IntSize& size)
+{
+    // We can't resize backing stores that are backed by shared memory.
+    ASSERT(!isBackedBySharedMemory());
+
+    if (size == m_size)
+        return true;
+
+    size_t newNumBytes = numBytesForSize(size);
+    
+    // Try to resize.
+    char* newData = 0;
+    if (!tryFastRealloc(m_data, newNumBytes).getValue(newData)) {
+        // We failed, but the backing store is still kept in a consistent state.
+        return false;
+    }
+
+    m_size = size;
+    m_data = newData;
+
+    return true;
+}
+
+void* ShareableBitmap::data() const
+{
+    if (isBackedBySharedMemory())
+        return m_sharedMemory->data();
+
+    ASSERT(m_data);
+    return m_data;
+}
+
+} // namespace WebKit
diff --git a/WebKit2/Shared/ShareableBitmap.h b/WebKit2/Shared/ShareableBitmap.h
new file mode 100644
index 0000000..fe61395
--- /dev/null
+++ b/WebKit2/Shared/ShareableBitmap.h
@@ -0,0 +1,91 @@
+/*
+ * Copyright (C) 2010 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.
+ */
+
+#ifndef ShareableBitmap_h
+#define ShareableBitmap_h
+
+#include "SharedMemory.h"
+#include <WebCore/IntRect.h>
+#include <wtf/PassOwnPtr.h>
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+    class GraphicsContext;
+}
+
+namespace WebKit {
+    
+class ShareableBitmap : public RefCounted<ShareableBitmap> {
+public:
+    // Create a shareable bitmap that uses malloced memory.
+    static PassRefPtr<ShareableBitmap> create(const WebCore::IntSize&);
+
+    // Create a shareable bitmap whose backing memory can be shared with another process.
+    static PassRefPtr<ShareableBitmap> createSharable(const WebCore::IntSize&);
+
+    // Create a shareable bitmap from a shared memory handle.
+    static PassRefPtr<ShareableBitmap> create(const WebCore::IntSize&, const SharedMemory::Handle&);
+
+    // Create a shared memory handle.
+    bool createHandle(SharedMemory::Handle&);
+
+    ~ShareableBitmap();
+
+    const WebCore::IntSize& size() const { return m_size; }
+    WebCore::IntRect bounds() const { return WebCore::IntRect(WebCore::IntPoint(), size()); }
+
+    bool resize(const WebCore::IntSize& size);
+
+    // Create a graphics context that can be used to paint into the backing store.
+    PassOwnPtr<WebCore::GraphicsContext> createGraphicsContext();
+
+    // Paint the backing store into the given context.
+    void paint(WebCore::GraphicsContext&, const WebCore::IntPoint& dstPoint, const WebCore::IntRect& srcRect);
+
+    bool isBackedBySharedMemory() const { return m_sharedMemory; }
+
+private:
+    ShareableBitmap(const WebCore::IntSize&, void*);
+    ShareableBitmap(const WebCore::IntSize&, PassRefPtr<SharedMemory>);
+
+    static size_t numBytesForSize(const WebCore::IntSize& size) { return size.width() * size.height() * 4; }
+
+    void* data() const;
+    size_t sizeInBytes() const { return numBytesForSize(m_size); }
+
+    WebCore::IntSize m_size;
+
+    // If the shareable bitmap is backed by shared memory, this points to the shared memory object.
+    RefPtr<SharedMemory> m_sharedMemory;
+
+    // If the shareable bitmap is backed by fastMalloced memory, this points to the data.
+    void* m_data;
+};
+
+} // namespace WebKit
+
+#endif // ShareableBitmap_h
diff --git a/WebKit2/Shared/UserMessageCoders.h b/WebKit2/Shared/UserMessageCoders.h
index 5cc5a9e..e1d0e19 100644
--- a/WebKit2/Shared/UserMessageCoders.h
+++ b/WebKit2/Shared/UserMessageCoders.h
@@ -27,6 +27,7 @@
 #include "ArgumentEncoder.h"
 #include "ImmutableArray.h"
 #include "ImmutableDictionary.h"
+#include "ShareableBitmap.h"
 #include "WebCoreArgumentCoders.h"
 #include "WebImage.h"
 #include "WebNumber.h"
@@ -119,13 +120,13 @@ public:
         }
         case APIObject::TypeImage: {
             WebImage* image = static_cast<WebImage*>(m_root);
-            if (!image->backingStore()->isBackedBySharedMemory()) {
+            if (!image->bitmap()->isBackedBySharedMemory()) {
                 encoder->encode(false);
                 return true;
             }
 
             SharedMemory::Handle handle;
-            if (!image->backingStore()->createHandle(handle))
+            if (!image->bitmap()->createHandle(handle))
                 return false;
 
             encoder->encode(true);
@@ -281,7 +282,7 @@ public:
             if (!decoder->decode(handle))
                 return false;
 
-            coder.m_root = WebImage::create(BackingStore::create(size, handle));
+            coder.m_root = WebImage::create(ShareableBitmap::create(size, handle));
             return true;
         }
         default:
diff --git a/WebKit2/Shared/WebImage.cpp b/WebKit2/Shared/WebImage.cpp
index 81f30fc..30d19cd 100644
--- a/WebKit2/Shared/WebImage.cpp
+++ b/WebKit2/Shared/WebImage.cpp
@@ -25,6 +25,8 @@
 
 #include "WebImage.h"
 
+#include "ShareableBitmap.h"
+
 using namespace WebCore;
 
 namespace WebKit {
@@ -32,18 +34,28 @@ namespace WebKit {
 PassRefPtr<WebImage> WebImage::create(const IntSize& size, ImageOptions options)
 {
     if (options & ImageOptionsSharable)
-        return WebImage::create(BackingStore::createSharable(size));
-    return WebImage::create(BackingStore::create(size));
+        return WebImage::create(ShareableBitmap::createSharable(size));
+    return WebImage::create(ShareableBitmap::create(size));
+}
+
+PassRefPtr<WebImage> WebImage::create(PassRefPtr<ShareableBitmap> bitmap)
+{
+    return adoptRef(new WebImage(bitmap));
+}
+
+WebImage::WebImage(PassRefPtr<ShareableBitmap> bitmap)
+    : m_bitmap(bitmap)
+{
+    ASSERT(m_bitmap);
 }
 
-PassRefPtr<WebImage> WebImage::create(PassRefPtr<BackingStore> backingStore)
+WebImage::~WebImage()
 {
-    return adoptRef(new WebImage(backingStore));
 }
 
 const IntSize& WebImage::size() const
 {
-    return m_backingStore->size();
+    return m_bitmap->size();
 }
 
 } // namespace WebKit
diff --git a/WebKit2/Shared/WebImage.h b/WebKit2/Shared/WebImage.h
index cafbe8d..0380b7d 100644
--- a/WebKit2/Shared/WebImage.h
+++ b/WebKit2/Shared/WebImage.h
@@ -27,12 +27,17 @@
 #define WebImage_h
 
 #include "APIObject.h"
-#include "BackingStore.h"
 #include "ImageOptions.h"
-#include <wtf/Forward.h>
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+    class IntSize;
+}
 
 namespace WebKit {
 
+class ShareableBitmap;
+
 // WebImage - An image type suitable for vending to an API.
 
 class WebImage : public APIObject {
@@ -40,22 +45,19 @@ public:
     static const Type APIType = TypeImage;
 
     static PassRefPtr<WebImage> create(const WebCore::IntSize&, ImageOptions);
-    static PassRefPtr<WebImage> create(PassRefPtr<BackingStore>);
-
+    static PassRefPtr<WebImage> create(PassRefPtr<ShareableBitmap>);
+    ~WebImage();
+    
     const WebCore::IntSize& size() const;
 
-    BackingStore* backingStore() const { return m_backingStore.get(); }
+    ShareableBitmap* bitmap() const { return m_bitmap.get(); }
 
 private:
-    WebImage(PassRefPtr<BackingStore> backingStore)
-        : m_backingStore(backingStore)
-    {
-        ASSERT(m_backingStore);
-    }
+    WebImage(PassRefPtr<ShareableBitmap>);
 
     virtual Type type() const { return APIType; }
 
-    RefPtr<BackingStore> m_backingStore;
+    RefPtr<ShareableBitmap> m_bitmap;
 };
 
 } // namespace WebKit
diff --git a/WebKit2/Shared/cairo/BackingStoreCairo.cpp b/WebKit2/Shared/cairo/BackingStoreCairo.cpp
index ac18dfb..f5dbbc4 100644
--- a/WebKit2/Shared/cairo/BackingStoreCairo.cpp
+++ b/WebKit2/Shared/cairo/BackingStoreCairo.cpp
@@ -23,7 +23,7 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#include "BackingStore.h"
+#include "ShareableBitmap.h"
 
 #include "NotImplemented.h"
 #include <WebCore/GraphicsContext.h>
@@ -32,13 +32,13 @@ using namespace WebCore;
 
 namespace WebKit {
 
-PassOwnPtr<GraphicsContext> BackingStore::createGraphicsContext()
+PassOwnPtr<GraphicsContext> ShareableBitmap::createGraphicsContext()
 {
     notImplemented();
     return 0;
 }
 
-void BackingStore::paint(GraphicsContext&, const IntPoint&, const IntRect&)
+void ShareableBitmap::paint(GraphicsContext&, const IntPoint&, const IntRect&)
 {
     notImplemented();
 }
diff --git a/WebKit2/Shared/cg/BackingStoreCG.cpp b/WebKit2/Shared/cg/BackingStoreCG.cpp
deleted file mode 100644
index 97c6a00..0000000
--- a/WebKit2/Shared/cg/BackingStoreCG.cpp
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (C) 2010 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"
-
-#include <WebCore/GraphicsContext.h>
-#include <wtf/RetainPtr.h>
-
-using namespace WebCore;
-
-namespace WebKit {
-
-PassOwnPtr<GraphicsContext> BackingStore::createGraphicsContext()
-{
-    RetainPtr<CGColorSpaceRef> colorSpace(AdoptCF, CGColorSpaceCreateDeviceRGB());
-    RetainPtr<CGContextRef> bitmapContext(AdoptCF, CGBitmapContextCreate(data(), m_size.width(), m_size.height(), 8,  m_size.width() * 4, colorSpace.get(), 
-                                                                         kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host));
-
-    // We want the origin to be in the top left corner so flip the backing store context.
-    CGContextTranslateCTM(bitmapContext.get(), 0, m_size.height());
-    CGContextScaleCTM(bitmapContext.get(), 1, -1);
-
-    return adoptPtr(new GraphicsContext(bitmapContext.get()));
-}
-
-void BackingStore::paint(WebCore::GraphicsContext& context, const WebCore::IntPoint& dstPoint, const WebCore::IntRect& srcRect)
-{
-    OwnPtr<GraphicsContext> sourceContext(createGraphicsContext());
-
-    CGContextRef sourceCGContext = sourceContext->platformContext();
-
-    RetainPtr<CGDataProviderRef> dataProvider(AdoptCF, CGDataProviderCreateWithData(0, data(), sizeInBytes(), 0));
-    RetainPtr<CGImageRef> image(AdoptCF, CGImageCreate(CGBitmapContextGetWidth(sourceCGContext), 
-                                                       CGBitmapContextGetHeight(sourceCGContext),
-                                                       CGBitmapContextGetBitsPerComponent(sourceCGContext),
-                                                       CGBitmapContextGetBitsPerPixel(sourceCGContext),
-                                                       CGBitmapContextGetBytesPerRow(sourceCGContext),
-                                                       CGBitmapContextGetColorSpace(sourceCGContext),
-                                                       CGBitmapContextGetBitmapInfo(sourceCGContext),
-                                                       dataProvider.get(), 0, false, kCGRenderingIntentDefault));
-
-    CGContextRef cgContext = context.platformContext();
-    
-    CGContextSaveGState(cgContext);
-
-    CGContextClipToRect(cgContext, CGRectMake(dstPoint.x(), dstPoint.y(), srcRect.width(), srcRect.height()));
-    CGContextScaleCTM(cgContext, 1, -1);
-
-    CGFloat imageHeight = CGImageGetHeight(image.get());
-    CGFloat imageWidth = CGImageGetWidth(image.get());
-
-    CGFloat destX = dstPoint.x() - srcRect.x();
-    CGFloat destY = -imageHeight - dstPoint.y() + srcRect.y();
-
-    CGContextDrawImage(cgContext, CGRectMake(destX, destY, imageWidth, imageHeight), image.get());
-    CGContextRestoreGState(cgContext);
-}
-        
-} // namespace WebKit
diff --git a/WebKit2/Shared/cg/ShareableBitmapCG.cpp b/WebKit2/Shared/cg/ShareableBitmapCG.cpp
new file mode 100644
index 0000000..286923b
--- /dev/null
+++ b/WebKit2/Shared/cg/ShareableBitmapCG.cpp
@@ -0,0 +1,81 @@
+/*
+ * Copyright (C) 2010 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 "ShareableBitmap.h"
+
+#include <WebCore/GraphicsContext.h>
+#include <wtf/RetainPtr.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+PassOwnPtr<GraphicsContext> ShareableBitmap::createGraphicsContext()
+{
+    RetainPtr<CGColorSpaceRef> colorSpace(AdoptCF, CGColorSpaceCreateDeviceRGB());
+    RetainPtr<CGContextRef> bitmapContext(AdoptCF, CGBitmapContextCreate(data(), m_size.width(), m_size.height(), 8,  m_size.width() * 4, colorSpace.get(), 
+                                                                         kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host));
+
+    // We want the origin to be in the top left corner so flip the backing store context.
+    CGContextTranslateCTM(bitmapContext.get(), 0, m_size.height());
+    CGContextScaleCTM(bitmapContext.get(), 1, -1);
+
+    return adoptPtr(new GraphicsContext(bitmapContext.get()));
+}
+
+void ShareableBitmap::paint(WebCore::GraphicsContext& context, const WebCore::IntPoint& dstPoint, const WebCore::IntRect& srcRect)
+{
+    OwnPtr<GraphicsContext> sourceContext(createGraphicsContext());
+
+    CGContextRef sourceCGContext = sourceContext->platformContext();
+
+    RetainPtr<CGDataProviderRef> dataProvider(AdoptCF, CGDataProviderCreateWithData(0, data(), sizeInBytes(), 0));
+    RetainPtr<CGImageRef> image(AdoptCF, CGImageCreate(CGBitmapContextGetWidth(sourceCGContext), 
+                                                       CGBitmapContextGetHeight(sourceCGContext),
+                                                       CGBitmapContextGetBitsPerComponent(sourceCGContext),
+                                                       CGBitmapContextGetBitsPerPixel(sourceCGContext),
+                                                       CGBitmapContextGetBytesPerRow(sourceCGContext),
+                                                       CGBitmapContextGetColorSpace(sourceCGContext),
+                                                       CGBitmapContextGetBitmapInfo(sourceCGContext),
+                                                       dataProvider.get(), 0, false, kCGRenderingIntentDefault));
+
+    CGContextRef cgContext = context.platformContext();
+    
+    CGContextSaveGState(cgContext);
+
+    CGContextClipToRect(cgContext, CGRectMake(dstPoint.x(), dstPoint.y(), srcRect.width(), srcRect.height()));
+    CGContextScaleCTM(cgContext, 1, -1);
+
+    CGFloat imageHeight = CGImageGetHeight(image.get());
+    CGFloat imageWidth = CGImageGetWidth(image.get());
+
+    CGFloat destX = dstPoint.x() - srcRect.x();
+    CGFloat destY = -imageHeight - dstPoint.y() + srcRect.y();
+
+    CGContextDrawImage(cgContext, CGRectMake(destX, destY, imageWidth, imageHeight), image.get());
+    CGContextRestoreGState(cgContext);
+}
+        
+} // namespace WebKit
diff --git a/WebKit2/Shared/gtk/BackingStoreGtk.cpp b/WebKit2/Shared/gtk/BackingStoreGtk.cpp
deleted file mode 100644
index 7407fd9..0000000
--- a/WebKit2/Shared/gtk/BackingStoreGtk.cpp
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
- * Portions Copyright (c) 2010 Motorola Mobility, 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"
-
-#include "NotImplemented.h"
-#include <WebCore/GraphicsContext.h>
-
-using namespace WebCore;
-
-namespace WebKit {
-
-PassOwnPtr<GraphicsContext> BackingStore::createGraphicsContext()
-{
-    notImplemented();
-    return 0;
-}
-
-void BackingStore::paint(WebCore::GraphicsContext&, const WebCore::IntPoint& dstPoint, const WebCore::IntRect& srcRect)
-{
-    notImplemented();
-}
-        
-} // namespace WebKit
diff --git a/WebKit2/Shared/gtk/ShareableBitmapGtk.cpp b/WebKit2/Shared/gtk/ShareableBitmapGtk.cpp
new file mode 100644
index 0000000..b84f05c
--- /dev/null
+++ b/WebKit2/Shared/gtk/ShareableBitmapGtk.cpp
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ * Portions Copyright (c) 2010 Motorola Mobility, 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 "ShareableBitmap.h"
+
+#include "NotImplemented.h"
+#include <WebCore/GraphicsContext.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+PassOwnPtr<GraphicsContext> ShareableBitmap::createGraphicsContext()
+{
+    notImplemented();
+    return 0;
+}
+
+void ShareableBitmap::paint(WebCore::GraphicsContext&, const WebCore::IntPoint& dstPoint, const WebCore::IntRect& srcRect)
+{
+    notImplemented();
+}
+        
+} // namespace WebKit
diff --git a/WebKit2/Shared/qt/BackingStoreQt.cpp b/WebKit2/Shared/qt/BackingStoreQt.cpp
deleted file mode 100644
index b2f766c..0000000
--- a/WebKit2/Shared/qt/BackingStoreQt.cpp
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Copyright (C) 2010 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"
-
-#include <QImage>
-#include <QPainter>
-#include <WebCore/GraphicsContext.h>
-
-using namespace WebCore;
-
-namespace WebKit {
-
-static inline QImage createQImage(void* data, int width, int height)
-{
-    return QImage(reinterpret_cast<uchar*>(data), width, height, width * 4, QImage::Format_RGB32);
-}
-
-PassOwnPtr<GraphicsContext> BackingStore::createGraphicsContext()
-{
-    QImage* image = new QImage(createQImage(data(), m_size.width(), m_size.height()));
-    GraphicsContext* context = new GraphicsContext(new QPainter(image));
-    context->takeOwnershipOfPlatformContext();
-    return context;
-}
-
-void BackingStore::paint(GraphicsContext& context, const IntPoint& dstPoint, const IntRect& srcRect)
-{
-    QImage image = createQImage(data(), m_size.width(), m_size.height());
-    QPainter* painter = context.platformContext();
-    painter->translate(-srcRect.x(), -srcRect.y());
-    painter->drawImage(dstPoint, image, QRect(srcRect));
-    painter->translate(srcRect.x(), srcRect.y());
-}
-
-} // namespace WebKit
diff --git a/WebKit2/Shared/qt/ShareableBitmapQt.cpp b/WebKit2/Shared/qt/ShareableBitmapQt.cpp
new file mode 100644
index 0000000..184b0f8
--- /dev/null
+++ b/WebKit2/Shared/qt/ShareableBitmapQt.cpp
@@ -0,0 +1,58 @@
+/*
+ * Copyright (C) 2010 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 "ShareableBitmap.h"
+
+#include <QImage>
+#include <QPainter>
+#include <WebCore/GraphicsContext.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+static inline QImage createQImage(void* data, int width, int height)
+{
+    return QImage(reinterpret_cast<uchar*>(data), width, height, width * 4, QImage::Format_RGB32);
+}
+
+PassOwnPtr<GraphicsContext> ShareableBitmap::createGraphicsContext()
+{
+    QImage* image = new QImage(createQImage(data(), m_size.width(), m_size.height()));
+    GraphicsContext* context = new GraphicsContext(new QPainter(image));
+    context->takeOwnershipOfPlatformContext();
+    return context;
+}
+
+void ShareableBitmap::paint(GraphicsContext& context, const IntPoint& dstPoint, const IntRect& srcRect)
+{
+    QImage image = createQImage(data(), m_size.width(), m_size.height());
+    QPainter* painter = context.platformContext();
+    painter->translate(-srcRect.x(), -srcRect.y());
+    painter->drawImage(dstPoint, image, QRect(srcRect));
+    painter->translate(srcRect.x(), srcRect.y());
+}
+
+} // namespace WebKit
diff --git a/WebKit2/UIProcess/FindIndicator.cpp b/WebKit2/UIProcess/FindIndicator.cpp
index a3eb93e..f1357e7 100644
--- a/WebKit2/UIProcess/FindIndicator.cpp
+++ b/WebKit2/UIProcess/FindIndicator.cpp
@@ -25,7 +25,7 @@
 
 #include "FindIndicator.h"
 
-#include "BackingStore.h"
+#include "ShareableBitmap.h"
 #include <WebCore/Gradient.h>
 #include <WebCore/GraphicsContext.h>
 #include <WebCore/IntRect.h>
@@ -78,14 +78,14 @@ namespace WebKit {
 
 PassRefPtr<FindIndicator> FindIndicator::create(const FloatRect& selectionRect, const Vector<FloatRect>& textRects, const SharedMemory::Handle& contentImageHandle)
 {
-    RefPtr<BackingStore> contentImage = BackingStore::create(enclosingIntRect(selectionRect).size(), contentImageHandle);
+    RefPtr<ShareableBitmap> contentImage = ShareableBitmap::create(enclosingIntRect(selectionRect).size(), contentImageHandle);
     if (!contentImage)
         return 0;
 
     return adoptRef(new FindIndicator(selectionRect, textRects, contentImage.release()));
 }
 
-FindIndicator::FindIndicator(const WebCore::FloatRect& selectionRect, const Vector<WebCore::FloatRect>& textRects, PassRefPtr<BackingStore> contentImage)
+FindIndicator::FindIndicator(const WebCore::FloatRect& selectionRect, const Vector<WebCore::FloatRect>& textRects, PassRefPtr<ShareableBitmap> contentImage)
     : m_selectionRect(selectionRect)
     , m_textRects(textRects)
     , m_contentImage(contentImage)
diff --git a/WebKit2/UIProcess/FindIndicator.h b/WebKit2/UIProcess/FindIndicator.h
index 3220193..997d537 100644
--- a/WebKit2/UIProcess/FindIndicator.h
+++ b/WebKit2/UIProcess/FindIndicator.h
@@ -38,7 +38,7 @@ namespace WebCore {
 
 namespace WebKit {
 
-class BackingStore;
+class ShareableBitmap;
 
 class FindIndicator : public RefCounted<FindIndicator> {
 public:
@@ -49,16 +49,16 @@ public:
 
     const Vector<WebCore::FloatRect>& textRects() const { return m_textRects; }
 
-    BackingStore* contentImage() const { return m_contentImage.get(); }
+    ShareableBitmap* contentImage() const { return m_contentImage.get(); }
 
     void draw(WebCore::GraphicsContext&, const WebCore::IntRect& dirtyRect);
 
 private:
-    FindIndicator(const WebCore::FloatRect& selectionRect, const Vector<WebCore::FloatRect>& textRects, PassRefPtr<BackingStore> contentImage);
+    FindIndicator(const WebCore::FloatRect& selectionRect, const Vector<WebCore::FloatRect>& textRects, PassRefPtr<ShareableBitmap> contentImage);
 
     WebCore::FloatRect m_selectionRect;
     Vector<WebCore::FloatRect> m_textRects;
-    RefPtr<BackingStore> m_contentImage;
+    RefPtr<ShareableBitmap> m_contentImage;
 };
 
 } // namespace WebKit
diff --git a/WebKit2/WebKit2.pro b/WebKit2/WebKit2.pro
index fbcaa45..18f52ee 100644
--- a/WebKit2/WebKit2.pro
+++ b/WebKit2/WebKit2.pro
@@ -252,7 +252,7 @@ HEADERS += \
     Shared/API/c/WKURLRequest.h \
     Shared/API/c/WKURLResponse.h \
     Shared/API/c/WKUserContentURLPattern.h \
-    Shared/BackingStore.h \
+    Shared/ShareableBitmap.h \
     Shared/CacheModel.h \
     Shared/ChildProcess.h \
     Shared/CoreIPCSupport/DrawingAreaMessageKinds.h \
@@ -484,7 +484,7 @@ SOURCES += \
     Shared/API/c/WKUserContentURLPattern.cpp \
     Shared/Plugins/Netscape/NetscapePluginModule.cpp \
     Shared/Plugins/Netscape/x11/NetscapePluginModuleX11.cpp \
-    Shared/BackingStore.cpp \
+    Shared/ShareableBitmap.cpp \
     Shared/ChildProcess.cpp \
     Shared/ImmutableArray.cpp \
     Shared/ImmutableDictionary.cpp \
@@ -515,7 +515,7 @@ SOURCES += \
     Shared/WebURLRequest.cpp \
     Shared/WebURLResponse.cpp \
     Shared/WebWheelEvent.cpp \
-    Shared/qt/BackingStoreQt.cpp \
+    Shared/qt/ShareableBitmapQt.cpp \
     Shared/qt/CleanupHandler.cpp \
     Shared/qt/NativeWebKeyboardEventQt.cpp \
     Shared/qt/UpdateChunk.cpp \
diff --git a/WebKit2/WebKit2.xcodeproj/project.pbxproj b/WebKit2/WebKit2.xcodeproj/project.pbxproj
index bc048ef..ff1b44d 100644
--- a/WebKit2/WebKit2.xcodeproj/project.pbxproj
+++ b/WebKit2/WebKit2.xcodeproj/project.pbxproj
@@ -47,8 +47,6 @@
 		1A043B5D124D5E9D00FFBFB5 /* PluginProcessProxyMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A043B5B124D5E9D00FFBFB5 /* PluginProcessProxyMessageReceiver.cpp */; };
 		1A043B5E124D5E9D00FFBFB5 /* PluginProcessProxyMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A043B5C124D5E9D00FFBFB5 /* PluginProcessProxyMessages.h */; };
 		1A043CEB124FE38F00FFBFB5 /* PluginProcessMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A0EC6BD124BBD9B007EF4A5 /* PluginProcessMessageReceiver.cpp */; };
-		1A043D7A124FEFC100FFBFB5 /* BackingStore.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A043D78124FEFC100FFBFB5 /* BackingStore.h */; };
-		1A043D7B124FEFC100FFBFB5 /* BackingStore.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A043D79124FEFC100FFBFB5 /* BackingStore.cpp */; };
 		1A043DC1124FF87500FFBFB5 /* PluginProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A043DBF124FF87500FFBFB5 /* PluginProxy.h */; };
 		1A043DC2124FF87500FFBFB5 /* PluginProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A043DC0124FF87500FFBFB5 /* PluginProxy.cpp */; };
 		1A043F6912514D8B00FFBFB5 /* WebProcessConnectionMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A043F6712514D8B00FFBFB5 /* WebProcessConnectionMessageReceiver.cpp */; };
@@ -124,6 +122,8 @@
 		1A6161D41278981C003ACD86 /* Download.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A6161D21278981C003ACD86 /* Download.h */; };
 		1A6161D51278981C003ACD86 /* Download.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6161D31278981C003ACD86 /* Download.cpp */; };
 		1A61639612789B2F003ACD86 /* DownloadMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A61639512789B2F003ACD86 /* DownloadMac.mm */; };
+		1A6420E412DCE2FF00CAAE2C /* ShareableBitmap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A6420E212DCE2FF00CAAE2C /* ShareableBitmap.cpp */; };
+		1A6420E512DCE2FF00CAAE2C /* ShareableBitmap.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A6420E312DCE2FF00CAAE2C /* ShareableBitmap.h */; };
 		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 */; };
@@ -625,7 +625,7 @@
 		BCF69FA31176D01400471A52 /* WebNavigationData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCF69FA11176D01400471A52 /* WebNavigationData.cpp */; };
 		BCF69FA91176D1CB00471A52 /* WKNavigationData.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF69FA71176D1CB00471A52 /* WKNavigationData.h */; settings = {ATTRIBUTES = (Public, ); }; };
 		BCF69FAA1176D1CB00471A52 /* WKNavigationData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCF69FA81176D1CB00471A52 /* WKNavigationData.cpp */; };
-		C01A260112662F2100C9ED55 /* BackingStoreCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C01A260012662F2100C9ED55 /* BackingStoreCG.cpp */; };
+		C01A260112662F2100C9ED55 /* ShareableBitmapCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C01A260012662F2100C9ED55 /* ShareableBitmapCG.cpp */; };
 		C02BFF1E1251502E009CCBEA /* NativeWebKeyboardEventMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = C02BFF1D1251502E009CCBEA /* NativeWebKeyboardEventMac.mm */; };
 		C0337DAE127A24FE008FF4F4 /* WebEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C0337DAD127A24FE008FF4F4 /* WebEvent.cpp */; };
 		C0337DB0127A28D0008FF4F4 /* WebMouseEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C0337DAF127A28D0008FF4F4 /* WebMouseEvent.cpp */; };
@@ -743,8 +743,6 @@
 		1A043B4C124D5E3600FFBFB5 /* PluginProcessProxy.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = PluginProcessProxy.messages.in; sourceTree = "<group>"; };
 		1A043B5B124D5E9D00FFBFB5 /* PluginProcessProxyMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginProcessProxyMessageReceiver.cpp; sourceTree = "<group>"; };
 		1A043B5C124D5E9D00FFBFB5 /* PluginProcessProxyMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginProcessProxyMessages.h; sourceTree = "<group>"; };
-		1A043D78124FEFC100FFBFB5 /* BackingStore.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BackingStore.h; sourceTree = "<group>"; };
-		1A043D79124FEFC100FFBFB5 /* BackingStore.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BackingStore.cpp; sourceTree = "<group>"; };
 		1A043DBF124FF87500FFBFB5 /* PluginProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginProxy.h; sourceTree = "<group>"; };
 		1A043DC0124FF87500FFBFB5 /* PluginProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PluginProxy.cpp; sourceTree = "<group>"; };
 		1A043F5912514CF300FFBFB5 /* WebProcessConnection.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebProcessConnection.messages.in; sourceTree = "<group>"; };
@@ -827,6 +825,8 @@
 		1A6161D21278981C003ACD86 /* Download.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Download.h; sourceTree = "<group>"; };
 		1A6161D31278981C003ACD86 /* Download.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Download.cpp; sourceTree = "<group>"; };
 		1A61639512789B2F003ACD86 /* DownloadMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DownloadMac.mm; sourceTree = "<group>"; };
+		1A6420E212DCE2FF00CAAE2C /* ShareableBitmap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ShareableBitmap.cpp; sourceTree = "<group>"; };
+		1A6420E312DCE2FF00CAAE2C /* ShareableBitmap.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ShareableBitmap.h; 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>"; };
@@ -1350,7 +1350,7 @@
 		BCF69FA11176D01400471A52 /* WebNavigationData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebNavigationData.cpp; sourceTree = "<group>"; };
 		BCF69FA71176D1CB00471A52 /* WKNavigationData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKNavigationData.h; sourceTree = "<group>"; };
 		BCF69FA81176D1CB00471A52 /* WKNavigationData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKNavigationData.cpp; sourceTree = "<group>"; };
-		C01A260012662F2100C9ED55 /* BackingStoreCG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BackingStoreCG.cpp; sourceTree = "<group>"; };
+		C01A260012662F2100C9ED55 /* ShareableBitmapCG.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ShareableBitmapCG.cpp; sourceTree = "<group>"; };
 		C02BFF1512514FD8009CCBEA /* NativeWebKeyboardEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeWebKeyboardEvent.h; sourceTree = "<group>"; };
 		C02BFF1D1251502E009CCBEA /* NativeWebKeyboardEventMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = NativeWebKeyboardEventMac.mm; sourceTree = "<group>"; };
 		C0337DAD127A24FE008FF4F4 /* WebEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebEvent.cpp; sourceTree = "<group>"; };
@@ -1685,8 +1685,6 @@
 				1AAE058C1279DCD400852418 /* Plugins */,
 				1A3DD205125E5A2F004515E6 /* APIClient.h */,
 				BCF04C8C11FF9B7D00F86A58 /* APIObject.h */,
-				1A043D79124FEFC100FFBFB5 /* BackingStore.cpp */,
-				1A043D78124FEFC100FFBFB5 /* BackingStore.h */,
 				BC3065F91259344E00E71278 /* CacheModel.h */,
 				1A2D956E12848564001EB962 /* ChildProcess.cpp */,
 				1A2D956D12848564001EB962 /* ChildProcess.h */,
@@ -1716,6 +1714,8 @@
 				1AA41AB412C02EC4002BE67B /* SelectionState.h */,
 				518D2CC812D51DFB003BB93B /* SessionState.cpp */,
 				518D2CC912D51DFB003BB93B /* SessionState.h */,
+				1A6420E212DCE2FF00CAAE2C /* ShareableBitmap.cpp */,
+				1A6420E312DCE2FF00CAAE2C /* ShareableBitmap.h */,
 				BCBD3C3A125BFA7A00D2C29F /* StringPairVector.h */,
 				1A5E4DA312D3BD3D0099A2BB /* TextCheckerState.h */,
 				BCB0B0DF12305AB100B1341E /* UserMessageCoders.h */,
@@ -2562,7 +2562,7 @@
 		C01A25FF12662F2100C9ED55 /* cg */ = {
 			isa = PBXGroup;
 			children = (
-				C01A260012662F2100C9ED55 /* BackingStoreCG.cpp */,
+				C01A260012662F2100C9ED55 /* ShareableBitmapCG.cpp */,
 			);
 			path = cg;
 			sourceTree = "<group>";
@@ -2832,7 +2832,6 @@
 				BC407627124FF0400068F20A /* WKCertificateInfoMac.h in Headers */,
 				BC407629124FF0400068F20A /* WKURLRequestNS.h in Headers */,
 				BC40762B124FF0400068F20A /* WKURLResponseNS.h in Headers */,
-				1A043D7A124FEFC100FFBFB5 /* BackingStore.h in Headers */,
 				BC40783D1250FADD0068F20A /* WKEvent.h in Headers */,
 				1A043DC1124FF87500FFBFB5 /* PluginProxy.h in Headers */,
 				1A043F6A12514D8B00FFBFB5 /* WebProcessConnectionMessages.h in Headers */,
@@ -2970,6 +2969,7 @@
 				BC06F43A12DBCCFB002D78DE /* GeolocationPermissionRequestProxy.h in Headers */,
 				BC06F44A12DBD1F5002D78DE /* GeolocationPermissionRequestManagerProxy.h in Headers */,
 				BC06F44E12DBDF3F002D78DE /* WKGeolocationPermissionRequest.h in Headers */,
+				1A6420E512DCE2FF00CAAE2C /* ShareableBitmap.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -3277,7 +3277,6 @@
 				BC40762A124FF0400068F20A /* WKURLRequestNS.mm in Sources */,
 				BC40762C124FF0400068F20A /* WKURLResponseNS.mm in Sources */,
 				1A043CEB124FE38F00FFBFB5 /* PluginProcessMessageReceiver.cpp in Sources */,
-				1A043D7B124FEFC100FFBFB5 /* BackingStore.cpp in Sources */,
 				1A043DC2124FF87500FFBFB5 /* PluginProxy.cpp in Sources */,
 				1A043F6912514D8B00FFBFB5 /* WebProcessConnectionMessageReceiver.cpp in Sources */,
 				1A8EF4CC1252403700F7067F /* PluginControllerProxy.cpp in Sources */,
@@ -3297,7 +3296,7 @@
 				1AC41AC81263C88300054E94 /* BinarySemaphore.cpp in Sources */,
 				1A90C1F51264FD71003E44D4 /* FindController.cpp in Sources */,
 				1A90C23812650717003E44D4 /* PageOverlay.cpp in Sources */,
-				C01A260112662F2100C9ED55 /* BackingStoreCG.cpp in Sources */,
+				C01A260112662F2100C9ED55 /* ShareableBitmapCG.cpp in Sources */,
 				BC5750981268F3C6006F0F12 /* WebPopupMenuProxyMac.mm in Sources */,
 				1A910072126675C4001842F5 /* FindIndicator.cpp in Sources */,
 				1A91010B1268C8CA001842F5 /* FindIndicatorWindow.mm in Sources */,
@@ -3418,6 +3417,7 @@
 				BC06F43B12DBCCFB002D78DE /* GeolocationPermissionRequestProxy.cpp in Sources */,
 				BC06F44B12DBD1F5002D78DE /* GeolocationPermissionRequestManagerProxy.cpp in Sources */,
 				BC06F44F12DBDF3F002D78DE /* WKGeolocationPermissionRequest.cpp in Sources */,
+				1A6420E412DCE2FF00CAAE2C /* ShareableBitmap.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
diff --git a/WebKit2/WebProcess/Plugins/PluginProxy.cpp b/WebKit2/WebProcess/Plugins/PluginProxy.cpp
index b12b43e..549f53a 100644
--- a/WebKit2/WebProcess/Plugins/PluginProxy.cpp
+++ b/WebKit2/WebProcess/Plugins/PluginProxy.cpp
@@ -27,7 +27,6 @@
 
 #include "PluginProxy.h"
 
-#include "BackingStore.h"
 #include "DataReference.h"
 #include "NPRemoteObjectMap.h"
 #include "NPRuntimeUtilities.h"
@@ -36,6 +35,7 @@
 #include "PluginControllerProxyMessages.h"
 #include "PluginProcessConnection.h"
 #include "PluginProcessConnectionManager.h"
+#include "ShareableBitmap.h"
 #include "WebCoreArgumentCoders.h"
 #include "WebEvent.h"
 #include "WebProcessConnectionMessages.h"
@@ -161,7 +161,7 @@ void PluginProxy::geometryDidChange(const IntRect& frameRect, const IntRect& cli
 
     bool didUpdateBackingStore = false;
     if (!m_backingStore) {
-        m_backingStore = BackingStore::create(frameRect.size());
+        m_backingStore = ShareableBitmap::create(frameRect.size());
         didUpdateBackingStore = true;
     } else if (frameRect.size() != m_backingStore->size()) {
         // The backing store already exists, just resize it.
@@ -175,7 +175,7 @@ void PluginProxy::geometryDidChange(const IntRect& frameRect, const IntRect& cli
 
     if (didUpdateBackingStore) {
         // Create a new plug-in backing store.
-        m_pluginBackingStore = BackingStore::createSharable(frameRect.size());
+        m_pluginBackingStore = ShareableBitmap::createSharable(frameRect.size());
         if (!m_pluginBackingStore)
             return;
 
diff --git a/WebKit2/WebProcess/Plugins/PluginProxy.h b/WebKit2/WebProcess/Plugins/PluginProxy.h
index 0e4136d..2c3b052 100644
--- a/WebKit2/WebProcess/Plugins/PluginProxy.h
+++ b/WebKit2/WebProcess/Plugins/PluginProxy.h
@@ -46,7 +46,7 @@ namespace WebCore {
 
 namespace WebKit {
 
-class BackingStore;
+class ShareableBitmap;
 class NPVariantData;
 class PluginProcessConnection;
 
@@ -132,11 +132,11 @@ private:
     WebCore::IntRect m_frameRect;
 
     // This is the backing store that we paint when we're told to paint.
-    RefPtr<BackingStore> m_backingStore;
+    RefPtr<ShareableBitmap> m_backingStore;
 
     // This is the shared memory backing store that the plug-in paints into. When the plug-in tells us
     // that it's painted something in it, we'll blit from it to our own backing store.
-    RefPtr<BackingStore> m_pluginBackingStore;
+    RefPtr<ShareableBitmap> m_pluginBackingStore;
     
     // Whether all of the plug-in backing store contains valid data.
     bool m_pluginBackingStoreContainsValidData;
diff --git a/WebKit2/WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp b/WebKit2/WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp
index 32d276e..bf3010a 100644
--- a/WebKit2/WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp
+++ b/WebKit2/WebProcess/WebCoreSupport/win/WebPopupMenuWin.cpp
@@ -78,8 +78,8 @@ void WebPopupMenu::setUpPlatformData(const WebCore::IntRect& pageCoordinates, Pl
     int backingStoreWidth = max(pageCoordinates.width() - m_popupClient->clientInsetLeft() - m_popupClient->clientInsetRight(), popupWidth);
 
     data.m_backingStoreSize = IntSize(backingStoreWidth, (itemCount * data.m_itemHeight));
-    data.m_notSelectedBackingStore = BackingStore::createSharable(data.m_backingStoreSize);
-    data.m_selectedBackingStore = BackingStore::createSharable(data.m_backingStoreSize);
+    data.m_notSelectedBackingStore = ShareableImage::createSharable(data.m_backingStoreSize);
+    data.m_selectedBackingStore = ShareableImage::createSharable(data.m_backingStoreSize);
 
     OwnPtr<GraphicsContext> notSelectedBackingStoreContext = data.m_notSelectedBackingStore->createGraphicsContext();
     OwnPtr<GraphicsContext> selectedBackingStoreContext = data.m_selectedBackingStore->createGraphicsContext();
diff --git a/WebKit2/WebProcess/WebPage/FindController.cpp b/WebKit2/WebProcess/WebPage/FindController.cpp
index a32391c..e59988b 100644
--- a/WebKit2/WebProcess/WebPage/FindController.cpp
+++ b/WebKit2/WebProcess/WebPage/FindController.cpp
@@ -25,7 +25,7 @@
 
 #include "FindController.h"
 
-#include "BackingStore.h"
+#include "ShareableBitmap.h"
 #include "WKPage.h"
 #include "WebCoreArgumentCoders.h"
 #include "WebPage.h"
@@ -158,7 +158,7 @@ bool FindController::updateFindIndicator(Frame* selectedFrame, bool isShowingOve
     selectedFrame->selection()->getClippedVisibleTextRectangles(textRects);
 
     // Create a backing store and paint the find indicator text into it.
-    RefPtr<BackingStore> findIndicatorTextBackingStore = BackingStore::createSharable(selectionRectInWindowCoordinates.size());
+    RefPtr<ShareableBitmap> findIndicatorTextBackingStore = ShareableBitmap::createSharable(selectionRectInWindowCoordinates.size());
     OwnPtr<GraphicsContext> graphicsContext = findIndicatorTextBackingStore->createGraphicsContext();
 
     graphicsContext->translate(-selectionRectInWindowCoordinates.x(), -selectionRectInWindowCoordinates.y());
diff --git a/WebKit2/WebProcess/WebPage/WebPage.cpp b/WebKit2/WebProcess/WebPage/WebPage.cpp
index 9710db5..9c7c864 100644
--- a/WebKit2/WebProcess/WebPage/WebPage.cpp
+++ b/WebKit2/WebProcess/WebPage/WebPage.cpp
@@ -37,6 +37,7 @@
 #include "PluginProxy.h"
 #include "PluginView.h"
 #include "SessionState.h"
+#include "ShareableBitmap.h"
 #include "WebBackForwardList.h"
 #include "WebBackForwardListItem.h"
 #include "WebBackForwardListProxy.h"
@@ -623,7 +624,7 @@ PassRefPtr<WebImage> WebPage::snapshotInViewCoordinates(const IntRect& rect, Ima
     frameView->setPaintBehavior(oldBehavior | PaintBehaviorFlattenCompositingLayers);
 
     RefPtr<WebImage> snapshot = WebImage::create(rect.size(), options);
-    OwnPtr<WebCore::GraphicsContext> graphicsContext = snapshot->backingStore()->createGraphicsContext();
+    OwnPtr<WebCore::GraphicsContext> graphicsContext = snapshot->bitmap()->createGraphicsContext();
 
     graphicsContext->save();
     graphicsContext->translate(-rect.x(), -rect.y());
@@ -647,7 +648,7 @@ PassRefPtr<WebImage> WebPage::snapshotInDocumentCoordinates(const IntRect& rect,
     frameView->setPaintBehavior(oldBehavior | PaintBehaviorFlattenCompositingLayers);
 
     RefPtr<WebImage> snapshot = WebImage::create(rect.size(), options);
-    OwnPtr<WebCore::GraphicsContext> graphicsContext = snapshot->backingStore()->createGraphicsContext();
+    OwnPtr<WebCore::GraphicsContext> graphicsContext = snapshot->bitmap()->createGraphicsContext();
 
     graphicsContext->save();
     graphicsContext->translate(-rect.x(), -rect.y());
diff --git a/WebKit2/win/WebKit2.vcproj b/WebKit2/win/WebKit2.vcproj
index 29414ba..a5e30b3 100755
--- a/WebKit2/win/WebKit2.vcproj
+++ b/WebKit2/win/WebKit2.vcproj
@@ -399,11 +399,11 @@
 				>
 			</File>
 			<File
-				RelativePath="..\Shared\BackingStore.cpp"
+				RelativePath="..\Shared\ShareableBitmap.cpp"
 				>
 			</File>
 			<File
-				RelativePath="..\Shared\BackingStore.h"
+				RelativePath="..\Shared\ShareableBitmap.h"
 				>
 			</File>
 			<File
@@ -1130,7 +1130,7 @@
 				Name="cg"
 				>
 				<File
-					RelativePath="..\Shared\cg\BackingStoreCG.cpp"
+					RelativePath="..\Shared\cg\ShareableBitmapCG.cpp"
 					>
 					<FileConfiguration
 						Name="Debug_Cairo_CFLite|Win32"
@@ -1154,7 +1154,7 @@
 				Name="cairo"
 				>
 				<File
-					RelativePath="..\Shared\cairo\BackingStoreCairo.cpp"
+					RelativePath="..\Shared\cairo\ShareableBitmapCairo.cpp"
 					>
 					<FileConfiguration
 						Name="Debug|Win32"

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list