summaryrefslogtreecommitdiffstats
path: root/WebKit/qt/Api/qwebframe.cpp
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2010-10-22 13:02:20 +0100
committerBen Murdoch <benm@google.com>2010-10-26 15:21:41 +0100
commita94275402997c11dd2e778633dacf4b7e630a35d (patch)
treee66f56c67e3b01f22c9c23cd932271ee9ac558ed /WebKit/qt/Api/qwebframe.cpp
parent09e26c78506587b3f5d930d7bc72a23287ffbec0 (diff)
downloadexternal_webkit-a94275402997c11dd2e778633dacf4b7e630a35d.zip
external_webkit-a94275402997c11dd2e778633dacf4b7e630a35d.tar.gz
external_webkit-a94275402997c11dd2e778633dacf4b7e630a35d.tar.bz2
Merge WebKit at r70209: Initial merge by Git
Change-Id: Id23a68efa36e9d1126bcce0b137872db00892c8e
Diffstat (limited to 'WebKit/qt/Api/qwebframe.cpp')
-rw-r--r--WebKit/qt/Api/qwebframe.cpp89
1 files changed, 59 insertions, 30 deletions
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 <QMultiMap>
#include <qdebug.h>
@@ -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();
+ }
}
}