[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

noam.rosenthal at nokia.com noam.rosenthal at nokia.com
Wed Dec 22 14:38:15 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit d0c30570ecfc5338f12664cf4d6579d0934e7703
Author: noam.rosenthal at nokia.com <noam.rosenthal at nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Oct 14 17:31:13 2010 +0000

    2010-10-14  No'am Rosenthal  <noam.rosenthal at nokia.com>
    
            Reviewed by Kenneth Rohde Christiansen.
    
            [Texmap] [Qt] Texture mapper initial implementation
            https://bugs.webkit.org/show_bug.cgi?id=47070
    
            Allow rendering of accelerated-compositing with TextureMapper, inside a QWebFrame. The frame will render the regular content,
            either normally or through tiled backingstore, then let the TextureMapper layer render itself to the active context, and
            then render the scrollbar and pan icon. This is different from the current implementation, which uses additional QGraphicsItems for AC
            and the scrollbar overlay.
    
            * Api/qgraphicswebview.cpp:
            (QGraphicsWebView::paint):
            * Api/qwebframe.cpp:
            (QWebFramePrivate::renderFromTiledBackingStore):
            (QWebFramePrivate::renderRelativeCoords):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@69777 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/qt/Api/qgraphicswebview.cpp b/WebKit/qt/Api/qgraphicswebview.cpp
index bce0b61..df28626 100644
--- a/WebKit/qt/Api/qgraphicswebview.cpp
+++ b/WebKit/qt/Api/qgraphicswebview.cpp
@@ -297,7 +297,7 @@ void QGraphicsWebView::paint(QPainter* painter, const QStyleOptionGraphicsItem*
         return;
     } 
 #endif
-#if USE(ACCELERATED_COMPOSITING)
+#if USE(ACCELERATED_COMPOSITING) && !USE(TEXTURE_MAPPER)
     page()->mainFrame()->render(painter, d->overlay() ? QWebFrame::ContentsLayer : QWebFrame::AllLayers, option->exposedRect.toAlignedRect());
 #else
     page()->mainFrame()->render(painter, QWebFrame::AllLayers, option->exposedRect.toRect());
diff --git a/WebKit/qt/Api/qwebframe.cpp b/WebKit/qt/Api/qwebframe.cpp
index 55ec464..d2a871a 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>
@@ -291,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
 
@@ -308,18 +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);
+    if (layer & QWebFrame::ContentsLayer) {
+        painter->save();
+        for (int i = 0; i < vector.size(); ++i) {
+            const QRect& clipRect = vector.at(i);
 
-        QRect intersectedRect = clipRect.intersected(view->frameRect());
+            QRect intersectedRect = clipRect.intersected(view->frameRect());
 
-        painter->save();
-        painter->setClipRect(clipRect, Qt::IntersectClip);
+            painter->setClipRect(clipRect, Qt::IntersectClip);
 
-        int x = view->x();
-        int y = view->y();
+            int x = view->x();
+            int y = view->y();
 
-        if (layer & QWebFrame::ContentsLayer) {
             context->save();
 
             int scrollX = view->scrollX();
@@ -336,27 +349,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();
+        }
     }
 }
 
diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index 2e5834f..78bf3d7 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,3 +1,21 @@
+2010-10-14  No'am Rosenthal  <noam.rosenthal at nokia.com>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Texmap] [Qt] Texture mapper initial implementation
+        https://bugs.webkit.org/show_bug.cgi?id=47070
+
+        Allow rendering of accelerated-compositing with TextureMapper, inside a QWebFrame. The frame will render the regular content,
+        either normally or through tiled backingstore, then let the TextureMapper layer render itself to the active context, and
+        then render the scrollbar and pan icon. This is different from the current implementation, which uses additional QGraphicsItems for AC
+        and the scrollbar overlay.
+
+        * Api/qgraphicswebview.cpp:
+        (QGraphicsWebView::paint):
+        * Api/qwebframe.cpp:
+        (QWebFramePrivate::renderFromTiledBackingStore):
+        (QWebFramePrivate::renderRelativeCoords):
+
 2010-10-13  Gavin Barraclough  <barraclough at apple.com>
 
         Reviewed by Oliver Hunt.

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list