[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.17-1283-gcf603cf
eric at webkit.org
eric at webkit.org
Tue Jan 5 23:42:30 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit 5dad1a2c8561c43f0aa4509c5a04578728ae7568
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Dec 4 17:43:29 2009 +0000
2009-12-04 Kenneth Rohde Christiansen <kenneth at webkit.org>
Reviewed by Antti Koivisto.
Split out the renderPrivate in two methods, one for working on
relative coordinates (relative to the viewport) and one for
working on absolute coordinates. The latter is more effecient
for implementing tiling, as you don't need translate the coords,
and because it avoid clipping to the viewport.
No behaviour changes, so no new tests.
* Api/qwebframe.cpp:
(QWebFramePrivate::renderContentsLayerAbsoluteCoords):
(QWebFramePrivate::renderRelativeCoords):
(QWebFrame::render):
* Api/qwebframe_p.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51698 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/qt/Api/qwebframe.cpp b/WebKit/qt/Api/qwebframe.cpp
index ec5debf..ef97c3b 100644
--- a/WebKit/qt/Api/qwebframe.cpp
+++ b/WebKit/qt/Api/qwebframe.cpp
@@ -267,7 +267,7 @@ WebCore::Scrollbar* QWebFramePrivate::verticalScrollBar() const
return frame->view()->verticalScrollbar();
}
-void QWebFramePrivate::renderPrivate(QPainter *painter, QWebFrame::RenderLayer layer, const QRegion &clip)
+void QWebFramePrivate::renderContentsLayerAbsoluteCoords(GraphicsContext* context, const QRegion& clip)
{
if (!frame->view() || !frame->contentRenderer())
return;
@@ -276,15 +276,42 @@ void QWebFramePrivate::renderPrivate(QPainter *painter, QWebFrame::RenderLayer l
if (vector.isEmpty())
return;
- GraphicsContext context(painter);
- if (context.paintingDisabled() && !context.updatingControlTints())
+ QPainter* painter = context->platformContext();
+
+ WebCore::FrameView* view = frame->view();
+ view->layoutIfNeededRecursive();
+
+ for (int i = 0; i < vector.size(); ++i) {
+ const QRect& clipRect = vector.at(i);
+
+ painter->save();
+ painter->setClipRect(clipRect, Qt::IntersectClip);
+
+ context->save();
+ view->paintContents(context, clipRect);
+ context->restore();
+
+ painter->restore();
+ }
+}
+
+void QWebFramePrivate::renderRelativeCoords(GraphicsContext* context, QWebFrame::RenderLayer layer, const QRegion& clip)
+{
+ if (!frame->view() || !frame->contentRenderer())
return;
+ QVector<QRect> vector = clip.rects();
+ if (vector.isEmpty())
+ return;
+
+ QPainter* painter = context->platformContext();
+
WebCore::FrameView* view = frame->view();
view->layoutIfNeededRecursive();
for (int i = 0; i < vector.size(); ++i) {
const QRect& clipRect = vector.at(i);
+
QRect intersectedRect = clipRect.intersected(view->frameRect());
painter->save();
@@ -294,39 +321,41 @@ void QWebFramePrivate::renderPrivate(QPainter *painter, QWebFrame::RenderLayer l
int y = view->y();
if (layer & QWebFrame::ContentsLayer) {
- context.save();
+ context->save();
int scrollX = view->scrollX();
int scrollY = view->scrollY();
QRect rect = intersectedRect;
- context.translate(x, y);
+ context->translate(x, y);
rect.translate(-x, -y);
- context.translate(-scrollX, -scrollY);
+ context->translate(-scrollX, -scrollY);
rect.translate(scrollX, scrollY);
- context.clip(view->visibleContentRect());
+ context->clip(view->visibleContentRect());
- view->paintContents(&context, rect);
+ view->paintContents(context, rect);
- context.restore();
+ context->restore();
}
if (layer & QWebFrame::ScrollBarLayer
&& !view->scrollbarsSuppressed()
&& (view->horizontalScrollbar() || view->verticalScrollbar())) {
- context.save();
+ context->save();
QRect rect = intersectedRect;
- context.translate(x, y);
+ context->translate(x, y);
rect.translate(-x, -y);
- view->paintScrollbars(&context, rect);
+ view->paintScrollbars(context, rect);
- context.restore();
+ context->restore();
}
+#if ENABLE(PAN_SCROLLING)
if (layer & QWebFrame::PanIconLayer)
- view->paintPanScrollIcon(&context);
+ view->paintPanScrollIcon(context);
+#endif
painter->restore();
}
@@ -1002,29 +1031,41 @@ void QWebFrame::setScrollPosition(const QPoint &pos)
void QWebFrame::render(QPainter* painter, RenderLayer layer, const QRegion& clip)
{
+ GraphicsContext context(painter);
+ if (context.paintingDisabled() && !context.updatingControlTints())
+ return;
+
if (!clip.isEmpty())
- d->renderPrivate(painter, layer, clip);
+ d->renderRelativeCoords(&context, layer, clip);
else if (d->frame->view())
- d->renderPrivate(painter, layer, QRegion(d->frame->view()->frameRect()));
+ d->renderRelativeCoords(&context, layer, QRegion(d->frame->view()->frameRect()));
}
/*!
Render the frame into \a painter clipping to \a clip.
*/
-void QWebFrame::render(QPainter *painter, const QRegion &clip)
+void QWebFrame::render(QPainter* painter, const QRegion& clip)
{
- d->renderPrivate(painter, AllLayers, clip);
+ GraphicsContext context(painter);
+ if (context.paintingDisabled() && !context.updatingControlTints())
+ return;
+
+ d->renderRelativeCoords(&context, AllLayers, clip);
}
/*!
Render the frame into \a painter.
*/
-void QWebFrame::render(QPainter *painter)
+void QWebFrame::render(QPainter* painter)
{
if (!d->frame->view())
return;
- d->renderPrivate(painter, AllLayers, QRegion(d->frame->view()->frameRect()));
+ GraphicsContext context(painter);
+ if (context.paintingDisabled() && !context.updatingControlTints())
+ return;
+
+ d->renderRelativeCoords(&context, AllLayers, QRegion(d->frame->view()->frameRect()));
}
/*!
diff --git a/WebKit/qt/Api/qwebframe_p.h b/WebKit/qt/Api/qwebframe_p.h
index 081e65d..045c70e 100644
--- a/WebKit/qt/Api/qwebframe_p.h
+++ b/WebKit/qt/Api/qwebframe_p.h
@@ -25,6 +25,7 @@
#include "qwebpage_p.h"
#include "EventHandler.h"
+#include "GraphicsContext.h"
#include "KURL.h"
#include "PlatformString.h"
#include "qwebelement.h"
@@ -81,7 +82,8 @@ public:
static WebCore::Frame* core(QWebFrame*);
static QWebFrame* kit(WebCore::Frame*);
- void renderPrivate(QPainter*, QWebFrame::RenderLayer, const QRegion& clip);
+ void renderRelativeCoords(WebCore::GraphicsContext*, QWebFrame::RenderLayer, const QRegion& clip);
+ void renderContentsLayerAbsoluteCoords(WebCore::GraphicsContext*, const QRegion& clip);
QWebFrame *q;
Qt::ScrollBarPolicy horizontalScrollBarPolicy;
diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index f1a97c7..5cc4e0c 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,3 +1,21 @@
+2009-12-04 Kenneth Rohde Christiansen <kenneth at webkit.org>
+
+ Reviewed by Antti Koivisto.
+
+ Split out the renderPrivate in two methods, one for working on
+ relative coordinates (relative to the viewport) and one for
+ working on absolute coordinates. The latter is more effecient
+ for implementing tiling, as you don't need translate the coords,
+ and because it avoid clipping to the viewport.
+
+ No behaviour changes, so no new tests.
+
+ * Api/qwebframe.cpp:
+ (QWebFramePrivate::renderContentsLayerAbsoluteCoords):
+ (QWebFramePrivate::renderRelativeCoords):
+ (QWebFrame::render):
+ * Api/qwebframe_p.h:
+
2009-12-04 Tor Arne Vestbø <tor.arne.vestbo at nokia.com>
Reviewed by Simon Hausmann.
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list