diff options
author | Ben Murdoch <benm@google.com> | 2011-05-16 16:25:10 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2011-05-23 18:54:14 +0100 |
commit | ab9e7a118cf1ea2e3a93dce683b2ded3e7291ddb (patch) | |
tree | db769fadd053248f85db67434a5b275224defef7 /Source/WebKit2/UIProcess/BackingStore.cpp | |
parent | 52e2557aeb8477967e97fd24f20f8f407a10fa15 (diff) | |
download | external_webkit-ab9e7a118cf1ea2e3a93dce683b2ded3e7291ddb.zip external_webkit-ab9e7a118cf1ea2e3a93dce683b2ded3e7291ddb.tar.gz external_webkit-ab9e7a118cf1ea2e3a93dce683b2ded3e7291ddb.tar.bz2 |
Merge WebKit at r76408: Initial merge by git.
Change-Id: I5b91decbd693ccbf5c1b8354b37cd68cc9a1ea53
Diffstat (limited to 'Source/WebKit2/UIProcess/BackingStore.cpp')
-rw-r--r-- | Source/WebKit2/UIProcess/BackingStore.cpp | 29 |
1 files changed, 26 insertions, 3 deletions
diff --git a/Source/WebKit2/UIProcess/BackingStore.cpp b/Source/WebKit2/UIProcess/BackingStore.cpp index 06d66af..b468b6b 100644 --- a/Source/WebKit2/UIProcess/BackingStore.cpp +++ b/Source/WebKit2/UIProcess/BackingStore.cpp @@ -25,6 +25,9 @@ #include "BackingStore.h" +#include "ShareableBitmap.h" +#include "UpdateInfo.h" + using namespace WebCore; #if !PLATFORM(MAC) @@ -33,13 +36,15 @@ using namespace WebCore; namespace WebKit { -PassOwnPtr<BackingStore> BackingStore::create(const IntSize& size) +PassOwnPtr<BackingStore> BackingStore::create(const IntSize& size, WebPageProxy* webPageProxy) { - return adoptPtr(new BackingStore(size)); + return adoptPtr(new BackingStore(size, webPageProxy)); } -BackingStore::BackingStore(const IntSize& size) +BackingStore::BackingStore(const IntSize& size, WebPageProxy* webPageProxy) : m_size(size) + , m_webPageProxy(webPageProxy) + , m_latestUpdateTimestamp(0) { ASSERT(!m_size.isEmpty()); } @@ -48,4 +53,22 @@ BackingStore::~BackingStore() { } +void BackingStore::incorporateUpdate(const UpdateInfo& updateInfo) +{ + if (updateInfo.timestamp < m_latestUpdateTimestamp) { + // The update is too old, discard it. + return; + } + + ASSERT(m_size == updateInfo.viewSize); + + RefPtr<ShareableBitmap> bitmap = ShareableBitmap::create(updateInfo.updateRectBounds.size(), updateInfo.bitmapHandle); + if (!bitmap) + return; + + incorporateUpdate(bitmap.get(), updateInfo); + + m_latestUpdateTimestamp = updateInfo.timestamp; +} + } // namespace WebKit |