Commit 3ca0a74d authored by andersca@apple.com's avatar andersca@apple.com
Browse files

Rename scrollDelta to scrollOffset everywhere.

Reviewed by Sam Weinig.

* Shared/UpdateInfo.cpp:
(WebKit::UpdateInfo::encode):
(WebKit::UpdateInfo::decode):
* Shared/UpdateInfo.h:
* UIProcess/BackingStore.h:
* UIProcess/mac/BackingStoreMac.mm:
(WebKit::BackingStore::incorporateUpdate):
(WebKit::BackingStore::scroll):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::scroll):
(WebKit::WebChromeClient::delegatedScrollRequested):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/ChunkedUpdateDrawingArea.cpp:
(WebKit::ChunkedUpdateDrawingArea::scroll):
* WebProcess/WebPage/ChunkedUpdateDrawingArea.h:
* WebProcess/WebPage/DrawingArea.h:
* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::scroll):
(WebKit::DrawingAreaImpl::display):
* WebProcess/WebPage/DrawingAreaImpl.h:
* WebProcess/WebPage/LayerBackedDrawingArea.cpp:
(WebKit::LayerBackedDrawingArea::scroll):
* WebProcess/WebPage/LayerBackedDrawingArea.h:



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76061 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent bbe606b0
2011-01-18 Anders Carlsson <andersca@apple.com>
Reviewed by Sam Weinig.
Rename scrollDelta to scrollOffset everywhere.
* Shared/UpdateInfo.cpp:
(WebKit::UpdateInfo::encode):
(WebKit::UpdateInfo::decode):
* Shared/UpdateInfo.h:
* UIProcess/BackingStore.h:
* UIProcess/mac/BackingStoreMac.mm:
(WebKit::BackingStore::incorporateUpdate):
(WebKit::BackingStore::scroll):
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::scroll):
(WebKit::WebChromeClient::delegatedScrollRequested):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/ChunkedUpdateDrawingArea.cpp:
(WebKit::ChunkedUpdateDrawingArea::scroll):
* WebProcess/WebPage/ChunkedUpdateDrawingArea.h:
* WebProcess/WebPage/DrawingArea.h:
* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::scroll):
(WebKit::DrawingAreaImpl::display):
* WebProcess/WebPage/DrawingAreaImpl.h:
* WebProcess/WebPage/LayerBackedDrawingArea.cpp:
(WebKit::LayerBackedDrawingArea::scroll):
* WebProcess/WebPage/LayerBackedDrawingArea.h:
2011-01-18 Anders Carlsson <andersca@apple.com>
 
Reviewed by Sam Weinig.
......@@ -33,7 +33,7 @@ void UpdateInfo::encode(CoreIPC::ArgumentEncoder* encoder) const
{
encoder->encode(viewSize);
encoder->encode(scrollRect);
encoder->encode(scrollDelta);
encoder->encode(scrollOffset);
encoder->encode(updateRectBounds);
encoder->encode(updateRects);
encoder->encode(bitmapHandle);
......@@ -45,7 +45,7 @@ bool UpdateInfo::decode(CoreIPC::ArgumentDecoder* decoder, UpdateInfo& result)
return false;
if (!decoder->decode(result.scrollRect))
return false;
if (!decoder->decode(result.scrollDelta))
if (!decoder->decode(result.scrollOffset))
return false;
if (!decoder->decode(result.updateRectBounds))
return false;
......
......@@ -51,7 +51,7 @@ public:
// The rect and delta to be scrolled.
WebCore::IntRect scrollRect;
WebCore::IntSize scrollDelta;
WebCore::IntSize scrollOffset;
// The bounds of the update rects.
WebCore::IntRect updateRectBounds;
......
......@@ -60,7 +60,7 @@ public:
private:
explicit BackingStore(const WebCore::IntSize&);
void scroll(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollDelta);
void scroll(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollOffset);
WebCore::IntSize m_size;
......
......@@ -59,7 +59,7 @@ void BackingStore::incorporateUpdate(const UpdateInfo& updateInfo)
CGContextScaleCTM(m_bitmapContext.get(), 1, -1);
}
scroll(updateInfo.scrollRect, updateInfo.scrollDelta);
scroll(updateInfo.scrollRect, updateInfo.scrollOffset);
IntPoint updateRectLocation = updateInfo.updateRectBounds.location();
......@@ -75,16 +75,16 @@ void BackingStore::incorporateUpdate(const UpdateInfo& updateInfo)
}
}
void BackingStore::scroll(const IntRect& scrollRect, const IntSize& scrollDelta)
void BackingStore::scroll(const IntRect& scrollRect, const IntSize& scrollOffset)
{
if (scrollDelta.isZero())
if (scrollOffset.isZero())
return;
CGContextSaveGState(m_bitmapContext.get());
CGContextClipToRect(m_bitmapContext.get(), scrollRect);
CGPoint destination = CGPointMake(scrollRect.x() + scrollDelta.width(), scrollRect.y() + scrollDelta.height());
CGPoint destination = CGPointMake(scrollRect.x() + scrollOffset.width(), scrollRect.y() + scrollOffset.height());
paintBitmapContext(m_bitmapContext.get(), m_bitmapContext.get(), destination, scrollRect);
CGContextRestoreGState(m_bitmapContext.get());
......
......@@ -364,16 +364,16 @@ void WebChromeClient::invalidateContentsForSlowScroll(const IntRect& rect, bool)
m_page->drawingArea()->setNeedsDisplay(rect);
}
void WebChromeClient::scroll(const IntSize& scrollDelta, const IntRect& scrollRect, const IntRect&)
void WebChromeClient::scroll(const IntSize& scrollOffset, const IntRect& scrollRect, const IntRect&)
{
m_page->pageDidScroll();
m_page->drawingArea()->scroll(scrollRect, scrollDelta);
m_page->drawingArea()->scroll(scrollRect, scrollOffset);
}
#if ENABLE(TILED_BACKING_STORE)
void WebChromeClient::delegatedScrollRequested(const IntSize& scrollDelta)
void WebChromeClient::delegatedScrollRequested(const IntSize& scrollOffset)
{
m_page->pageDidRequestScroll(scrollDelta);
m_page->pageDidRequestScroll(scrollOffset);
}
#endif
......
......@@ -107,9 +107,9 @@ private:
virtual void invalidateWindow(const WebCore::IntRect&, bool);
virtual void invalidateContentsAndWindow(const WebCore::IntRect&, bool);
virtual void invalidateContentsForSlowScroll(const WebCore::IntRect&, bool);
virtual void scroll(const WebCore::IntSize& scrollDelta, const WebCore::IntRect& scrollRect, const WebCore::IntRect& clipRect);
virtual void scroll(const WebCore::IntSize& scrollOffset, const WebCore::IntRect& scrollRect, const WebCore::IntRect& clipRect);
#if ENABLE(TILED_BACKING_STORE)
virtual void delegatedScrollRequested(const WebCore::IntSize& scrollDelta);
virtual void delegatedScrollRequested(const WebCore::IntSize& scrollOffset);
#endif
virtual WebCore::IntPoint screenToWindow(const WebCore::IntPoint&) const;
virtual WebCore::IntRect windowToScreen(const WebCore::IntRect&) const;
......
......@@ -49,7 +49,7 @@ ChunkedUpdateDrawingArea::~ChunkedUpdateDrawingArea()
{
}
void ChunkedUpdateDrawingArea::scroll(const IntRect& scrollRect, const IntSize& scrollDelta)
void ChunkedUpdateDrawingArea::scroll(const IntRect& scrollRect, const IntSize& scrollOffset)
{
// FIXME: Do something much smarter.
setNeedsDisplay(scrollRect);
......
......@@ -40,7 +40,7 @@ public:
virtual ~ChunkedUpdateDrawingArea();
virtual void setNeedsDisplay(const WebCore::IntRect&);
virtual void scroll(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollDelta);
virtual void scroll(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollOffset);
virtual void display();
#if USE(ACCELERATED_COMPOSITING)
......
......@@ -52,7 +52,7 @@ public:
#endif
virtual void setNeedsDisplay(const WebCore::IntRect&) = 0;
virtual void scroll(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollDelta) = 0;
virtual void scroll(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollOffset) = 0;
virtual void pageBackgroundTransparencyChanged() { }
......
......@@ -65,7 +65,7 @@ void DrawingAreaImpl::setNeedsDisplay(const IntRect& rect)
scheduleDisplay();
}
void DrawingAreaImpl::scroll(const IntRect& scrollRect, const IntSize& scrollDelta)
void DrawingAreaImpl::scroll(const IntRect& scrollRect, const IntSize& scrollOffset)
{
if (!m_scrollRect.isEmpty() && scrollRect != m_scrollRect) {
unsigned scrollArea = scrollRect.width() * scrollRect.height();
......@@ -81,7 +81,7 @@ void DrawingAreaImpl::scroll(const IntRect& scrollRect, const IntSize& scrollDel
// Just repaint the entire current scroll rect, we'll scroll the new rect instead.
setNeedsDisplay(m_scrollRect);
m_scrollRect = IntRect();
m_scrollDelta = IntSize();
m_scrollOffset = IntSize();
}
// Get the part of the dirty region that is in the scroll rect.
......@@ -92,19 +92,19 @@ void DrawingAreaImpl::scroll(const IntRect& scrollRect, const IntSize& scrollDel
m_dirtyRegion.subtract(scrollRect);
// Move the dirty parts.
Region movedDirtyRegionInScrollRect = intersect(translate(dirtyRegionInScrollRect, scrollDelta), scrollRect);
Region movedDirtyRegionInScrollRect = intersect(translate(dirtyRegionInScrollRect, scrollOffset), scrollRect);
// And add them back.
m_dirtyRegion.unite(movedDirtyRegionInScrollRect);
}
// Compute the scroll repaint region.
Region scrollRepaintRegion = subtract(scrollRect, translate(scrollRect, scrollDelta));
Region scrollRepaintRegion = subtract(scrollRect, translate(scrollRect, scrollOffset));
m_dirtyRegion.unite(scrollRepaintRegion);
m_scrollRect = scrollRect;
m_scrollDelta += scrollDelta;
m_scrollOffset += scrollOffset;
}
void DrawingAreaImpl::attachCompositingContext()
......@@ -214,11 +214,11 @@ void DrawingAreaImpl::display(UpdateInfo& updateInfo)
}
updateInfo.scrollRect = m_scrollRect;
updateInfo.scrollDelta = m_scrollDelta;
updateInfo.scrollOffset = m_scrollOffset;
m_dirtyRegion = Region();
m_scrollRect = IntRect();
m_scrollDelta = IntSize();
m_scrollOffset = IntSize();
RefPtr<ShareableBitmap> bitmap = ShareableBitmap::createShareable(bounds.size());
if (!bitmap->createHandle(updateInfo.bitmapHandle))
......
......@@ -44,7 +44,7 @@ private:
// DrawingArea
virtual void setNeedsDisplay(const WebCore::IntRect&);
virtual void scroll(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollDelta);
virtual void scroll(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollOffset);
virtual void attachCompositingContext();
virtual void detachCompositingContext();
virtual void setRootCompositingLayer(WebCore::GraphicsLayer*);
......@@ -62,7 +62,7 @@ private:
Region m_dirtyRegion;
WebCore::IntRect m_scrollRect;
WebCore::IntSize m_scrollDelta;
WebCore::IntSize m_scrollOffset;
// Whether we're waiting for a DidUpdate message. Used for throttling paints so that the
// web process won't paint more frequent than the UI process can handle.
......
......@@ -61,7 +61,7 @@ LayerBackedDrawingArea::~LayerBackedDrawingArea()
platformClear();
}
void LayerBackedDrawingArea::scroll(const IntRect& scrollRect, const IntSize& scrollDelta)
void LayerBackedDrawingArea::scroll(const IntRect& scrollRect, const IntSize& scrollOffset)
{
// FIXME: Do something much smarter.
setNeedsDisplay(scrollRect);
......
......@@ -56,7 +56,7 @@ public:
virtual ~LayerBackedDrawingArea();
virtual void setNeedsDisplay(const WebCore::IntRect&);
virtual void scroll(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollDelta);
virtual void scroll(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollOffset);
virtual void display();
virtual void pageBackgroundTransparencyChanged();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment