[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 23:06:45 UTC 2011
The following commit has been merged in the webkit-1.3 branch:
commit 5b5fbf8c107c2c7c833433b2ef9d1eaccede5334
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Jan 17 18:21:06 2011 +0000
2011-01-17 Anders Carlsson <andersca at apple.com>
Reviewed by Sam Weinig.
Implement scrolling support
https://bugs.webkit.org/show_bug.cgi?id=52502
* Shared/UpdateInfo.cpp:
(WebKit::UpdateInfo::encode):
(WebKit::UpdateInfo::decode):
* Shared/UpdateInfo.h:
Add scrollRect and scrollDelta member variables.
* UIProcess/BackingStore.h:
Add scroll member function.
* UIProcess/DrawingAreaProxyImpl.cpp:
(WebKit::DrawingAreaProxyImpl::incorporateUpdate):
Repaint the scroll rect. Force a display of the view when the update info contains a scroll rect.
* UIProcess/mac/BackingStoreMac.mm:
(WebKit::BackingStore::incorporateUpdate):
Call scroll.
(WebKit::BackingStore::scroll):
Paint the backing store into itself.
* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::display):
Pass the scroll information in the update info.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75953 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog
index 2bdb8c7..db9a854 100644
--- a/Source/WebKit2/ChangeLog
+++ b/Source/WebKit2/ChangeLog
@@ -1,3 +1,34 @@
+2011-01-17 Anders Carlsson <andersca at apple.com>
+
+ Reviewed by Sam Weinig.
+
+ Implement scrolling support
+ https://bugs.webkit.org/show_bug.cgi?id=52502
+
+ * Shared/UpdateInfo.cpp:
+ (WebKit::UpdateInfo::encode):
+ (WebKit::UpdateInfo::decode):
+ * Shared/UpdateInfo.h:
+ Add scrollRect and scrollDelta member variables.
+
+ * UIProcess/BackingStore.h:
+ Add scroll member function.
+
+ * UIProcess/DrawingAreaProxyImpl.cpp:
+ (WebKit::DrawingAreaProxyImpl::incorporateUpdate):
+ Repaint the scroll rect. Force a display of the view when the update info contains a scroll rect.
+
+ * UIProcess/mac/BackingStoreMac.mm:
+ (WebKit::BackingStore::incorporateUpdate):
+ Call scroll.
+
+ (WebKit::BackingStore::scroll):
+ Paint the backing store into itself.
+
+ * WebProcess/WebPage/DrawingAreaImpl.cpp:
+ (WebKit::DrawingAreaImpl::display):
+ Pass the scroll information in the update info.
+
2011-01-17 Andrey Kosyakov <caseq at chromium.org>
Unreviewed. Fixed malformed reference to WebKitVSPropsRedirectionDir that broke win build.
diff --git a/Source/WebKit2/Shared/UpdateInfo.cpp b/Source/WebKit2/Shared/UpdateInfo.cpp
index 0ba4ad3..1b504ed 100644
--- a/Source/WebKit2/Shared/UpdateInfo.cpp
+++ b/Source/WebKit2/Shared/UpdateInfo.cpp
@@ -32,6 +32,8 @@ namespace WebKit {
void UpdateInfo::encode(CoreIPC::ArgumentEncoder* encoder) const
{
encoder->encode(viewSize);
+ encoder->encode(scrollRect);
+ encoder->encode(scrollDelta);
encoder->encode(updateRectBounds);
encoder->encode(updateRects);
encoder->encode(bitmapHandle);
@@ -41,6 +43,10 @@ bool UpdateInfo::decode(CoreIPC::ArgumentDecoder* decoder, UpdateInfo& result)
{
if (!decoder->decode(result.viewSize))
return false;
+ if (!decoder->decode(result.scrollRect))
+ return false;
+ if (!decoder->decode(result.scrollDelta))
+ return false;
if (!decoder->decode(result.updateRectBounds))
return false;
if (!decoder->decode(result.updateRects))
diff --git a/Source/WebKit2/Shared/UpdateInfo.h b/Source/WebKit2/Shared/UpdateInfo.h
index 827f5e0..850911c 100644
--- a/Source/WebKit2/Shared/UpdateInfo.h
+++ b/Source/WebKit2/Shared/UpdateInfo.h
@@ -49,6 +49,10 @@ public:
// The size of the web view.
WebCore::IntSize viewSize;
+ // The rect and delta to be scrolled.
+ WebCore::IntRect scrollRect;
+ WebCore::IntSize scrollDelta;
+
// The bounds of the update rects.
WebCore::IntRect updateRectBounds;
@@ -57,7 +61,6 @@ public:
// The handle of the shareable bitmap containing the updates. Will be null if there are no updates.
SharedMemory::Handle bitmapHandle;
-
};
} // namespace WebKit
diff --git a/Source/WebKit2/UIProcess/BackingStore.h b/Source/WebKit2/UIProcess/BackingStore.h
index 5375ac7..e196a55 100644
--- a/Source/WebKit2/UIProcess/BackingStore.h
+++ b/Source/WebKit2/UIProcess/BackingStore.h
@@ -60,6 +60,8 @@ public:
private:
explicit BackingStore(const WebCore::IntSize&);
+ void scroll(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollDelta);
+
WebCore::IntSize m_size;
#if PLATFORM(MAC)
diff --git a/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp b/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp
index 6ef4e7e..02b0dd2 100644
--- a/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp
+++ b/Source/WebKit2/UIProcess/DrawingAreaProxyImpl.cpp
@@ -119,6 +119,11 @@ void DrawingAreaProxyImpl::incorporateUpdate(const UpdateInfo& updateInfo)
for (size_t i = 0; i < updateInfo.updateRects.size(); ++i)
m_webPageProxy->setViewNeedsDisplay(updateInfo.updateRects[i]);
+
+ if (!updateInfo.scrollRect.isEmpty()) {
+ m_webPageProxy->setViewNeedsDisplay(updateInfo.scrollRect);
+ m_webPageProxy->displayView();
+ }
}
void DrawingAreaProxyImpl::sendSetSize()
diff --git a/Source/WebKit2/UIProcess/mac/BackingStoreMac.mm b/Source/WebKit2/UIProcess/mac/BackingStoreMac.mm
index daafdf7..5128dc3 100644
--- a/Source/WebKit2/UIProcess/mac/BackingStoreMac.mm
+++ b/Source/WebKit2/UIProcess/mac/BackingStoreMac.mm
@@ -79,6 +79,8 @@ void BackingStore::incorporateUpdate(const UpdateInfo& updateInfo)
CGContextScaleCTM(m_bitmapContext.get(), 1, -1);
}
+ scroll(updateInfo.scrollRect, updateInfo.scrollDelta);
+
IntPoint updateRectLocation = updateInfo.updateRectBounds.location();
GraphicsContext graphicsContext(m_bitmapContext.get());
@@ -93,4 +95,33 @@ void BackingStore::incorporateUpdate(const UpdateInfo& updateInfo)
}
}
+void BackingStore::scroll(const IntRect& scrollRect, const IntSize& scrollDelta)
+{
+ if (scrollDelta.isZero())
+ return;
+
+ // FIXME: This code should be shared with ShareableBitmap::paint.
+ size_t sizeInBytes = CGBitmapContextGetBytesPerRow(m_bitmapContext.get()) * CGBitmapContextGetHeight(m_bitmapContext.get());
+ RetainPtr<CGDataProviderRef> dataProvider(AdoptCF, CGDataProviderCreateWithData(0, CGBitmapContextGetData(m_bitmapContext.get()), sizeInBytes, 0));
+ RetainPtr<CGImageRef> image(AdoptCF, CGImageCreate(CGBitmapContextGetWidth(m_bitmapContext.get()),
+ CGBitmapContextGetHeight(m_bitmapContext.get()),
+ CGBitmapContextGetBitsPerComponent(m_bitmapContext.get()),
+ CGBitmapContextGetBitsPerPixel(m_bitmapContext.get()),
+ CGBitmapContextGetBytesPerRow(m_bitmapContext.get()),
+ CGBitmapContextGetColorSpace(m_bitmapContext.get()),
+ CGBitmapContextGetBitmapInfo(m_bitmapContext.get()),
+ dataProvider.get(), 0, false, kCGRenderingIntentDefault));
+
+ CGFloat imageWidth = CGImageGetWidth(image.get());
+ CGFloat imageHeight = CGImageGetHeight(image.get());
+
+ CGContextSaveGState(m_bitmapContext.get());
+
+ CGContextClipToRect(m_bitmapContext.get(), scrollRect);
+ CGContextScaleCTM(m_bitmapContext.get(), 1, -1);
+
+ CGContextDrawImage(m_bitmapContext.get(), CGRectMake(scrollDelta.width(), - imageHeight - scrollDelta.height(), imageWidth, imageHeight), image.get());
+ CGContextRestoreGState(m_bitmapContext.get());
+}
+
} // namespace WebKit
diff --git a/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp b/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp
index 06d10e4..ab4655a 100644
--- a/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp
+++ b/Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp
@@ -212,7 +212,10 @@ void DrawingAreaImpl::display(UpdateInfo& updateInfo)
rects.clear();
rects.append(bounds);
}
-
+
+ updateInfo.scrollRect = m_scrollRect;
+ updateInfo.scrollDelta = m_scrollDelta;
+
m_dirtyRegion = Region();
m_scrollRect = IntRect();
m_scrollDelta = IntSize();
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list