[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:51:58 UTC 2011
The following commit has been merged in the webkit-1.3 branch:
commit cea8fe5c8ef26b1c57f8735486d7ea945bf35c4a
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Jan 12 18:19:14 2011 +0000
2011-01-12 Anders Carlsson <andersca at apple.com>
Reviewed by Sam Weinig.
More work on the new drawing area implementation
https://bugs.webkit.org/show_bug.cgi?id=52302
* Platform/Region.cpp:
(WebKit::Region::Shape::segments_end):
segments_end could end up returning an iterator that is one element past the Vector data, so
we can't use operator[] since that will assert.
* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::DrawingAreaImpl):
Initialize the timer.
(WebKit::DrawingAreaImpl::setNeedsDisplay):
Unite the rect with the dirty region and schedule a display.
(WebKit::DrawingAreaImpl::setSize):
Tell the web page to resize.
(WebKit::DrawingAreaImpl::scheduleDisplay):
Start a display timer if needed.
(WebKit::DrawingAreaImpl::display):
Add a stub.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75620 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 3da0d3c..0ef0f89 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,31 @@
+2011-01-12 Anders Carlsson <andersca at apple.com>
+
+ Reviewed by Sam Weinig.
+
+ More work on the new drawing area implementation
+ https://bugs.webkit.org/show_bug.cgi?id=52302
+
+ * Platform/Region.cpp:
+ (WebKit::Region::Shape::segments_end):
+ segments_end could end up returning an iterator that is one element past the Vector data, so
+ we can't use operator[] since that will assert.
+
+ * WebProcess/WebPage/DrawingAreaImpl.cpp:
+ (WebKit::DrawingAreaImpl::DrawingAreaImpl):
+ Initialize the timer.
+
+ (WebKit::DrawingAreaImpl::setNeedsDisplay):
+ Unite the rect with the dirty region and schedule a display.
+
+ (WebKit::DrawingAreaImpl::setSize):
+ Tell the web page to resize.
+
+ (WebKit::DrawingAreaImpl::scheduleDisplay):
+ Start a display timer if needed.
+
+ (WebKit::DrawingAreaImpl::display):
+ Add a stub.
+
2011-01-12 Brent Fulgham <bfulgham at webkit.org>
Unreviewed build fix after r75527. Rename 'BackingStoreCairo.cpp'
diff --git a/WebKit2/Platform/Region.cpp b/WebKit2/Platform/Region.cpp
index c82ccad..dfe4e09 100644
--- a/WebKit2/Platform/Region.cpp
+++ b/WebKit2/Platform/Region.cpp
@@ -153,7 +153,10 @@ Region::Shape::SegmentIterator Region::Shape::segments_end(SpanIterator it) cons
return 0;
ASSERT(it + 1 < m_spans.data() + m_spans.size());
- return &m_segments[(it + 1)->segmentIndex];
+ size_t segmentIndex = (it + 1)->segmentIndex;
+
+ ASSERT(segmentIndex <= m_segments.size());
+ return m_segments.data() + segmentIndex;
}
#ifndef NDEBUG
diff --git a/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp b/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp
index 02d327e..8902958 100644
--- a/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp
+++ b/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp
@@ -27,6 +27,7 @@
#include "DrawingAreaProxyMessages.h"
#include "WebPage.h"
+#include "WebProcess.h"
#ifndef __APPLE__
#error "This drawing area is not ready for use by other ports yet."
@@ -47,11 +48,18 @@ DrawingAreaImpl::~DrawingAreaImpl()
DrawingAreaImpl::DrawingAreaImpl(DrawingAreaInfo::Identifier identifier, WebPage* webPage)
: DrawingArea(DrawingAreaInfo::Impl, identifier, webPage)
+ , m_isWaitingForDidUpdate(false)
+ , m_displayTimer(WebProcess::shared().runLoop(), this, &DrawingAreaImpl::display)
{
}
void DrawingAreaImpl::setNeedsDisplay(const IntRect& rect)
{
+ if (rect.isEmpty())
+ return;
+
+ m_dirtyRegion.unite(rect);
+ scheduleDisplay();
}
void DrawingAreaImpl::scroll(const IntSize& scrollDelta, const IntRect& rectToScroll, const IntRect& clipRect)
@@ -84,9 +92,37 @@ void DrawingAreaImpl::didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID
void DrawingAreaImpl::setSize(const IntSize& size)
{
- // FIXME: Actually do something.
+ // Set this to false since we're about to call display().
+ m_isWaitingForDidUpdate = false;
+
+ m_webPage->setSize(size);
+ m_webPage->layoutIfNeeded();
+
+ // FIXME: Repaint.
m_webPage->send(Messages::DrawingAreaProxy::DidSetSize());
}
+void DrawingAreaImpl::scheduleDisplay()
+{
+ if (m_isWaitingForDidUpdate)
+ return;
+
+ if (m_dirtyRegion.isEmpty())
+ return;
+
+ if (m_displayTimer.isActive())
+ return;
+
+ m_displayTimer.startOneShot(0);
+}
+
+void DrawingAreaImpl::display()
+{
+ if (m_dirtyRegion.isEmpty())
+ return;
+
+ // FIXME: Actually paint.
+}
+
} // namespace WebKit
diff --git a/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h b/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h
index 1708943..caec677 100644
--- a/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h
+++ b/WebKit2/WebProcess/WebPage/DrawingAreaImpl.h
@@ -27,6 +27,8 @@
#define DrawingAreaImpl_h
#include "DrawingArea.h"
+#include "Region.h"
+#include "RunLoop.h"
namespace WebKit {
@@ -51,6 +53,16 @@ private:
// CoreIPC message handlers.
virtual void setSize(const WebCore::IntSize&);
+ void scheduleDisplay();
+ void display();
+
+ Region m_dirtyRegion;
+
+ // 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.
+ bool m_isWaitingForDidUpdate;
+
+ RunLoop::Timer<DrawingAreaImpl> m_displayTimer;
};
} // namespace WebKit
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list