From a94275402997c11dd2e778633dacf4b7e630a35d Mon Sep 17 00:00:00 2001 From: Ben Murdoch Date: Fri, 22 Oct 2010 13:02:20 +0100 Subject: Merge WebKit at r70209: Initial merge by Git Change-Id: Id23a68efa36e9d1126bcce0b137872db00892c8e --- WebKit/qt/Api/qwebframe.cpp | 89 ++++++++++++++++++++++++++++++--------------- 1 file changed, 59 insertions(+), 30 deletions(-) (limited to 'WebKit/qt/Api/qwebframe.cpp') diff --git a/WebKit/qt/Api/qwebframe.cpp b/WebKit/qt/Api/qwebframe.cpp index 1791096..39e74d9 100644 --- a/WebKit/qt/Api/qwebframe.cpp +++ b/WebKit/qt/Api/qwebframe.cpp @@ -96,6 +96,9 @@ #include "runtime_object.h" #include "runtime_root.h" #endif +#if USE(TEXTURE_MAPPER) +#include "texmap/TextureMapperPlatformLayer.h" +#endif #include "wtf/HashMap.h" #include #include @@ -230,14 +233,6 @@ void QWebFramePrivate::init(QWebFrame *qframe, QWebFrameData *frameData) frame->init(); } -WebCore::ViewportArguments QWebFramePrivate::viewportArguments() -{ - if (!frame || !frame->document()) - return WebCore::ViewportArguments(); - - return frame->document()->viewportArguments(); -} - void QWebFramePrivate::setPage(QWebPage* newPage) { if (page == newPage) @@ -299,6 +294,16 @@ void QWebFramePrivate::renderFromTiledBackingStore(GraphicsContext* context, con painter->restore(); } +#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER) + // TextureMapper might use raw OpenGL or some other backend that requires native painting. On raster this doesn't have any effect. + if (rootGraphicsLayer) { + painter->beginNativePainting(); + rootGraphicsLayer->paint(context, view->size(), view->frameRect(), IntRect(clip.boundingRect()), TransformationMatrix(), painter->opacity()); + painter->endNativePainting(); + } + + renderRelativeCoords(context, (QWebFrame::RenderLayer)(QWebFrame::ScrollBarLayer | QWebFrame::PanIconLayer), clip); +#endif } #endif @@ -316,19 +321,18 @@ void QWebFramePrivate::renderRelativeCoords(GraphicsContext* context, QWebFrame: WebCore::FrameView* view = frame->view(); view->updateLayoutAndStyleIfNeededRecursive(); - for (int i = 0; i < vector.size(); ++i) { - const QRect& clipRect = vector.at(i); - - QRect intersectedRect = clipRect.intersected(view->frameRect()); - + if (layer & QWebFrame::ContentsLayer) { painter->save(); - painter->setClipRect(clipRect, Qt::IntersectClip); + for (int i = 0; i < vector.size(); ++i) { + const QRect& clipRect = vector.at(i); - int x = view->x(); - int y = view->y(); + QRect intersectedRect = clipRect.intersected(view->frameRect()); - if (layer & QWebFrame::ContentsLayer) { context->save(); + painter->setClipRect(clipRect, Qt::IntersectClip); + + int x = view->x(); + int y = view->y(); int scrollX = view->scrollX(); int scrollY = view->scrollY(); @@ -344,27 +348,52 @@ void QWebFramePrivate::renderRelativeCoords(GraphicsContext* context, QWebFrame: context->restore(); } + painter->restore(); - if (layer & QWebFrame::ScrollBarLayer - && !view->scrollbarsSuppressed() - && (view->horizontalScrollbar() || view->verticalScrollbar())) { - context->save(); +#if USE(ACCELERATED_COMPOSITING) && USE(TEXTURE_MAPPER) + if (rootGraphicsLayer) { + painter->save(); + painter->beginNativePainting(); + rootGraphicsLayer->paint(context, view->size(), view->frameRect(), IntRect(clip.boundingRect()), + TransformationMatrix(), context->platformContext()->opacity()); + painter->endNativePainting(); + painter->restore(); + } +#endif + } + if (layer & (QWebFrame::PanIconLayer | QWebFrame::ScrollBarLayer)) { + for (int i = 0; i < vector.size(); ++i) { + const QRect& clipRect = vector.at(i); - QRect rect = intersectedRect; - context->translate(x, y); - rect.translate(-x, -y); + QRect intersectedRect = clipRect.intersected(view->frameRect()); - view->paintScrollbars(context, rect); + painter->save(); + painter->setClipRect(clipRect, Qt::IntersectClip); - context->restore(); - } + int x = view->x(); + int y = view->y(); + + if (layer & QWebFrame::ScrollBarLayer + && !view->scrollbarsSuppressed() + && (view->horizontalScrollbar() || view->verticalScrollbar())) { + context->save(); + + QRect rect = intersectedRect; + context->translate(x, y); + rect.translate(-x, -y); + + view->paintScrollbars(context, rect); + + context->restore(); + } #if ENABLE(PAN_SCROLLING) - if (layer & QWebFrame::PanIconLayer) - view->paintPanScrollIcon(context); + if (layer & QWebFrame::PanIconLayer) + view->paintPanScrollIcon(context); #endif - painter->restore(); + painter->restore(); + } } } -- cgit v1.1