Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
2011-03-11 Sheriff Bot <webkit.review.bot@gmail.com>
        Unreviewed, rolling out r80899 and r80912.
        http://trac.webkit.org/changeset/80899
        http://trac.webkit.org/changeset/80912
        https://bugs.webkit.org/show_bug.cgi?id=56236

        Caused animation tests to crash on Snow Leopard WebKit2
        (Requested by rniwa on #webkit).

        * Shared/ShareableBitmap.cpp:
        (WebKit::ShareableBitmap::create):
        (WebKit::ShareableBitmap::createShareable):
        (WebKit::ShareableBitmap::resize):
        * Shared/ShareableBitmap.h:
        (WebKit::ShareableBitmap::numBytesForSize):
        (WebKit::ShareableBitmap::sizeInBytes):
        * UIProcess/DrawingAreaProxyImpl.cpp:
        (WebKit::DrawingAreaProxyImpl::update):
        * WebKit2.xcodeproj/project.pbxproj:
        * WebProcess/WebPage/DrawingArea.h:
        (WebKit::DrawingArea::didUpdate):
        * WebProcess/WebPage/DrawingArea.messages.in:
        * WebProcess/WebPage/DrawingAreaImpl.cpp:
        (WebKit::DrawingAreaImpl::~DrawingAreaImpl):
        (WebKit::DrawingAreaImpl::sendDidUpdateBackingStoreState):
        (WebKit::DrawingAreaImpl::didUpdate):
        (WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode):
        (WebKit::DrawingAreaImpl::display):
        * WebProcess/WebPage/DrawingAreaImpl.h:
        * WebProcess/WebPage/SharedMemoryCache.cpp: Removed.
        * WebProcess/WebPage/SharedMemoryCache.h: Removed.
        * win/WebKit2.vcproj:


Canonical link: https://commits.webkit.org/70802@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@80917 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
rniwa committed Mar 12, 2011
1 parent 6e38640 commit c5c1a6e
Show file tree
Hide file tree
Showing 12 changed files with 53 additions and 202 deletions.
34 changes: 34 additions & 0 deletions Source/WebKit2/ChangeLog
@@ -1,3 +1,37 @@
2011-03-11 Sheriff Bot <webkit.review.bot@gmail.com>

Unreviewed, rolling out r80899 and r80912.
http://trac.webkit.org/changeset/80899
http://trac.webkit.org/changeset/80912
https://bugs.webkit.org/show_bug.cgi?id=56236

Caused animation tests to crash on Snow Leopard WebKit2
(Requested by rniwa on #webkit).

* Shared/ShareableBitmap.cpp:
(WebKit::ShareableBitmap::create):
(WebKit::ShareableBitmap::createShareable):
(WebKit::ShareableBitmap::resize):
* Shared/ShareableBitmap.h:
(WebKit::ShareableBitmap::numBytesForSize):
(WebKit::ShareableBitmap::sizeInBytes):
* UIProcess/DrawingAreaProxyImpl.cpp:
(WebKit::DrawingAreaProxyImpl::update):
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebPage/DrawingArea.h:
(WebKit::DrawingArea::didUpdate):
* WebProcess/WebPage/DrawingArea.messages.in:
* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::~DrawingAreaImpl):
(WebKit::DrawingAreaImpl::sendDidUpdateBackingStoreState):
(WebKit::DrawingAreaImpl::didUpdate):
(WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode):
(WebKit::DrawingAreaImpl::display):
* WebProcess/WebPage/DrawingAreaImpl.h:
* WebProcess/WebPage/SharedMemoryCache.cpp: Removed.
* WebProcess/WebPage/SharedMemoryCache.h: Removed.
* win/WebKit2.vcproj:

2011-03-11 Brian Weinstein <bweinstein@apple.com>

Windows build fix. Add SharedMemoryCache to the vcproj.
Expand Down
8 changes: 4 additions & 4 deletions Source/WebKit2/Shared/ShareableBitmap.cpp
Expand Up @@ -35,7 +35,7 @@ namespace WebKit {

PassRefPtr<ShareableBitmap> ShareableBitmap::create(const WebCore::IntSize& size)
{
size_t numBytes = numBytesNeededForBitmapSize(size);
size_t numBytes = numBytesForSize(size);

void* data = 0;
if (!tryFastMalloc(numBytes).getValue(data))
Expand All @@ -46,7 +46,7 @@ PassRefPtr<ShareableBitmap> ShareableBitmap::create(const WebCore::IntSize& size

PassRefPtr<ShareableBitmap> ShareableBitmap::createShareable(const IntSize& size)
{
size_t numBytes = numBytesNeededForBitmapSize(size);
size_t numBytes = numBytesForSize(size);

RefPtr<SharedMemory> sharedMemory = SharedMemory::create(numBytes);
if (!sharedMemory)
Expand All @@ -59,7 +59,7 @@ PassRefPtr<ShareableBitmap> ShareableBitmap::create(const WebCore::IntSize& size
{
ASSERT(sharedMemory);

size_t numBytes = numBytesNeededForBitmapSize(size);
size_t numBytes = numBytesForSize(size);
ASSERT_UNUSED(numBytes, sharedMemory->size() >= numBytes);

return adoptRef(new ShareableBitmap(size, sharedMemory));
Expand Down Expand Up @@ -109,7 +109,7 @@ bool ShareableBitmap::resize(const IntSize& size)
if (size == m_size)
return true;

size_t newNumBytes = numBytesNeededForBitmapSize(size);
size_t newNumBytes = numBytesForSize(size);

// Try to resize.
char* newData = 0;
Expand Down
6 changes: 3 additions & 3 deletions Source/WebKit2/Shared/ShareableBitmap.h
Expand Up @@ -58,8 +58,6 @@ class ShareableBitmap : public RefCounted<ShareableBitmap> {

~ShareableBitmap();

static size_t numBytesNeededForBitmapSize(const WebCore::IntSize& size) { return size.width() * size.height() * 4; }

const WebCore::IntSize& size() const { return m_size; }
WebCore::IntRect bounds() const { return WebCore::IntRect(WebCore::IntPoint(), size()); }

Expand All @@ -77,10 +75,12 @@ class ShareableBitmap : public RefCounted<ShareableBitmap> {
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; }

static void releaseData(void* typelessBitmap, void* typelessData);

void* data() const;
size_t sizeInBytes() const { return numBytesNeededForBitmapSize(m_size); }
size_t sizeInBytes() const { return numBytesForSize(m_size); }

WebCore::IntSize m_size;

Expand Down
7 changes: 2 additions & 5 deletions Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp
Expand Up @@ -144,16 +144,13 @@ void DrawingAreaProxyImpl::setPageIsVisible(bool)
void DrawingAreaProxyImpl::update(uint64_t backingStoreStateID, const UpdateInfo& updateInfo)
{
ASSERT_ARG(backingStoreStateID, backingStoreStateID <= m_currentBackingStoreStateID);
if (backingStoreStateID < m_currentBackingStoreStateID) {
// We still want to send back a message so that the web process knows that it can reuse the shared memory used for the update info.
m_webPageProxy->process()->send(Messages::DrawingArea::DidUpdate(false), m_webPageProxy->pageID());
if (backingStoreStateID < m_currentBackingStoreStateID)
return;
}

// FIXME: Handle the case where the view is hidden.

incorporateUpdate(updateInfo);
m_webPageProxy->process()->send(Messages::DrawingArea::DidUpdate(true), m_webPageProxy->pageID());
m_webPageProxy->process()->send(Messages::DrawingArea::DidUpdate(), m_webPageProxy->pageID());
}

void DrawingAreaProxyImpl::didUpdateBackingStoreState(uint64_t backingStoreStateID, const UpdateInfo& updateInfo, const LayerTreeContext& layerTreeContext)
Expand Down
8 changes: 0 additions & 8 deletions Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
Expand Up @@ -75,8 +75,6 @@
1A24B5F311F531E800C38269 /* MachUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A24B5F111F531E800C38269 /* MachUtilities.h */; };
1A24BED5120894D100FBB059 /* SharedMemory.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A24BED3120894D100FBB059 /* SharedMemory.h */; };
1A24BF3A120896A600FBB059 /* SharedMemoryMac.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A24BF39120896A600FBB059 /* SharedMemoryMac.cpp */; };
1A27A5C8132AC86A001138FB /* SharedMemoryCache.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A27A5C6132AC86A001138FB /* SharedMemoryCache.cpp */; };
1A27A5C9132AC86A001138FB /* SharedMemoryCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A27A5C7132AC86A001138FB /* SharedMemoryCache.h */; };
1A2C307112D555450063DAA2 /* ContextMenuState.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2C306F12D555450063DAA2 /* ContextMenuState.h */; };
1A2D82A4127F4EAB001EB962 /* NPObjectMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A1FA35C127A45BF0050E709 /* NPObjectMessageReceiver.cpp */; };
1A2D82A5127F4EAB001EB962 /* NPObjectMessageReceiver.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A1FA35B127A45BF0050E709 /* NPObjectMessageReceiver.h */; };
Expand Down Expand Up @@ -902,8 +900,6 @@
1A24B5F111F531E800C38269 /* MachUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MachUtilities.h; sourceTree = "<group>"; };
1A24BED3120894D100FBB059 /* SharedMemory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SharedMemory.h; sourceTree = "<group>"; };
1A24BF39120896A600FBB059 /* SharedMemoryMac.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SharedMemoryMac.cpp; sourceTree = "<group>"; };
1A27A5C6132AC86A001138FB /* SharedMemoryCache.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SharedMemoryCache.cpp; sourceTree = "<group>"; };
1A27A5C7132AC86A001138FB /* SharedMemoryCache.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SharedMemoryCache.h; sourceTree = "<group>"; };
1A2C306F12D555450063DAA2 /* ContextMenuState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ContextMenuState.h; sourceTree = "<group>"; };
1A2D8411127F64E8001EB962 /* NPObjectMessageReceiver.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = NPObjectMessageReceiver.messages.in; sourceTree = "<group>"; };
1A2D8437127F65D5001EB962 /* NPObjectMessageReceiverMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NPObjectMessageReceiverMessageReceiver.cpp; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2327,8 +2323,6 @@
1A186EE812EF7618008E5F37 /* LayerTreeHost.h */,
1A90C23612650717003E44D4 /* PageOverlay.cpp */,
1A90C23512650717003E44D4 /* PageOverlay.h */,
1A27A5C6132AC86A001138FB /* SharedMemoryCache.cpp */,
1A27A5C7132AC86A001138FB /* SharedMemoryCache.h */,
BC72B9F811E6476B001EB4EA /* WebBackForwardListProxy.cpp */,
BC72B9F911E6476B001EB4EA /* WebBackForwardListProxy.h */,
51871B59127CB89D00F76232 /* WebContextMenu.cpp */,
Expand Down Expand Up @@ -3461,7 +3455,6 @@
37C4E9F6131C6E7E0029BD5A /* config.h in Headers */,
E1BB16A413201B9B00F49431 /* FullKeyboardAccessWatcher.h in Headers */,
33AA1067131F060000D4A575 /* WebCookieManagerProxyClient.h in Headers */,
1A27A5C9132AC86A001138FB /* SharedMemoryCache.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -4066,7 +4059,6 @@
CD73BA4E131ACDB700EEDED2 /* WebFullScreenManagerMessageReceiver.cpp in Sources */,
CD73BA53131B645B00EEDED2 /* WebFullScreenManager.cpp in Sources */,
CD6F75F4131B66D000D6B21E /* WebFullScreenManagerProxy.cpp in Sources */,
1A27A5C8132AC86A001138FB /* SharedMemoryCache.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
2 changes: 1 addition & 1 deletion Source/WebKit2/WebProcess/WebPage/DrawingArea.h
Expand Up @@ -86,7 +86,7 @@ class DrawingArea {
// CoreIPC message handlers.
// FIXME: These should be pure virtual.
virtual void updateBackingStoreState(uint64_t backingStoreStateID, bool respondImmediately, const WebCore::IntSize& size, const WebCore::IntSize& scrollOffset) { }
virtual void didUpdate(bool didIncorporateBackingStore) { }
virtual void didUpdate() { }
virtual void suspendPainting() { }
virtual void resumePainting() { }
};
Expand Down
2 changes: 1 addition & 1 deletion Source/WebKit2/WebProcess/WebPage/DrawingArea.messages.in
Expand Up @@ -22,7 +22,7 @@

messages -> DrawingArea {
UpdateBackingStoreState(uint64_t backingStoreStateID, bool respondImmediately, WebCore::IntSize size, WebCore::IntSize scrollOffset)
DidUpdate(bool didIncorporateBackingStore)
DidUpdate()
SuspendPainting()
ResumePainting()
}
41 changes: 6 additions & 35 deletions Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp
Expand Up @@ -29,7 +29,6 @@
#include "DrawingAreaProxyMessages.h"
#include "LayerTreeContext.h"
#include "ShareableBitmap.h"
#include "SharedMemoryCache.h"
#include "UpdateInfo.h"
#include "WebPage.h"
#include "WebPageCreationParameters.h"
Expand All @@ -46,23 +45,13 @@ using namespace WebCore;

namespace WebKit {

static SharedMemoryCache& sharedMemoryCache()
{
DEFINE_STATIC_LOCAL(SharedMemoryCache, sharedMemoryCache, ());

return sharedMemoryCache;
}

PassOwnPtr<DrawingAreaImpl> DrawingAreaImpl::create(WebPage* webPage, const WebPageCreationParameters& parameters)
{
return adoptPtr(new DrawingAreaImpl(webPage, parameters));
}

DrawingAreaImpl::~DrawingAreaImpl()
{
if (m_sharedMemoryUsedForLastUpdate)
sharedMemoryCache().releaseSharedMemory(m_sharedMemoryUsedForLastUpdate.release());

if (m_layerTreeHost)
m_layerTreeHost->invalidate();
}
Expand Down Expand Up @@ -307,7 +296,7 @@ void DrawingAreaImpl::sendDidUpdateBackingStoreState()
UpdateInfo updateInfo;

if (!m_isPaintingSuspended && !m_layerTreeHost)
display(updateInfo, false);
display(updateInfo);

#if USE(ACCELERATED_COMPOSITING)
LayerTreeContext layerTreeContext;
Expand All @@ -330,14 +319,8 @@ void DrawingAreaImpl::sendDidUpdateBackingStoreState()
#endif
}

void DrawingAreaImpl::didUpdate(bool didIncorporateBackingStore)
void DrawingAreaImpl::didUpdate()
{
ASSERT(m_sharedMemoryUsedForLastUpdate);
sharedMemoryCache().releaseSharedMemory(m_sharedMemoryUsedForLastUpdate.release());

if (!didIncorporateBackingStore)
return;

// We might get didUpdate messages from the UI process even after we've
// entered accelerated compositing mode. Ignore them.
if (m_layerTreeHost)
Expand Down Expand Up @@ -412,7 +395,7 @@ void DrawingAreaImpl::exitAcceleratedCompositingMode()
if (m_isPaintingSuspended)
updateInfo.viewSize = m_webPage->size();
else
display(updateInfo, false);
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
Expand Down Expand Up @@ -479,7 +462,7 @@ void DrawingAreaImpl::display()
}

UpdateInfo updateInfo;
display(updateInfo, true);
display(updateInfo);

if (m_layerTreeHost) {
// The call to update caused layout which turned on accelerated compositing.
Expand Down Expand Up @@ -512,7 +495,7 @@ static bool shouldPaintBoundsRect(const IntRect& bounds, const Vector<IntRect>&
return wastedSpace <= wastedSpaceThreshold;
}

void DrawingAreaImpl::display(UpdateInfo& updateInfo, bool useSharedMemoryCache)
void DrawingAreaImpl::display(UpdateInfo& updateInfo)
{
ASSERT(!m_isPaintingSuspended);
ASSERT(!m_layerTreeHost);
Expand All @@ -532,19 +515,7 @@ void DrawingAreaImpl::display(UpdateInfo& updateInfo, bool useSharedMemoryCache)
IntRect bounds = m_dirtyRegion.bounds();
ASSERT(m_webPage->bounds().contains(bounds));

RefPtr<ShareableBitmap> bitmap;
if (useSharedMemoryCache) {
size_t size = ShareableBitmap::numBytesNeededForBitmapSize(bounds.size());

ASSERT(!m_sharedMemoryUsedForLastUpdate);

m_sharedMemoryUsedForLastUpdate = sharedMemoryCache().acquireSharedMemory(size);
bitmap = ShareableBitmap::create(bounds.size(), m_sharedMemoryUsedForLastUpdate);
} else {
// Just create a new shareable bitmap.
bitmap = ShareableBitmap::createShareable(bounds.size());
}

RefPtr<ShareableBitmap> bitmap = ShareableBitmap::createShareable(bounds.size());
if (!bitmap->createHandle(updateInfo.bitmapHandle))
return;

Expand Down
11 changes: 2 additions & 9 deletions Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h
Expand Up @@ -33,7 +33,6 @@

namespace WebKit {

class SharedMemory;
class UpdateInfo;

class DrawingAreaImpl : public DrawingArea {
Expand Down Expand Up @@ -62,7 +61,7 @@ class DrawingAreaImpl : public DrawingArea {

// CoreIPC message handlers.
virtual void updateBackingStoreState(uint64_t backingStoreStateID, bool respondImmediately, const WebCore::IntSize&, const WebCore::IntSize& scrollOffset);
virtual void didUpdate(bool didIncorporateBackingStore);
virtual void didUpdate();
virtual void suspendPainting();
virtual void resumePainting();

Expand All @@ -75,7 +74,7 @@ class DrawingAreaImpl : public DrawingArea {
void scheduleDisplay();
void displayTimerFired();
void display();
void display(UpdateInfo&, bool useSharedMemoryCache);
void display(UpdateInfo&);

uint64_t m_backingStoreStateID;

Expand Down Expand Up @@ -106,12 +105,6 @@ class DrawingAreaImpl : public DrawingArea {

// The layer tree host that handles accelerated compositing.
RefPtr<LayerTreeHost> m_layerTreeHost;

// The shared memory we used for the last update. If possible, we'll try
// to reuse it for subsequent paints to avoid allocating/freeeing shared memory
// for every paint.
RefPtr<SharedMemory> m_sharedMemoryUsedForLastUpdate;

};

} // namespace WebKit
Expand Down
71 changes: 0 additions & 71 deletions Source/WebKit2/WebProcess/WebPage/SharedMemoryCache.cpp

This file was deleted.

0 comments on commit c5c1a6e

Please sign in to comment.