Title: [108900] trunk/Source/WebKit2
Revision
108900
Author
noam.rosent...@nokia.com
Date
2012-02-25 09:59:27 -0800 (Sat, 25 Feb 2012)

Log Message

[Qt] Use the existing inheritedOpacity/matrix properties of QSGNode
https://bugs.webkit.org/show_bug.cgi?id=79543

Use QSGNode::inheritedOpacity() and QSGNode::matrix().
Also, remove flags from changedStates() that we don't actually touch.

Reviewed by Kenneth Rohde Christiansen.

* UIProcess/API/qt/qquickwebpage.cpp:
(QQuickWebPagePrivate::paintToCurrentGLContext):
(PageProxyNode::changedStates):
(PageProxyNode::render):
* UIProcess/API/qt/qquickwebpage_p_p.h:
(QQuickWebPagePrivate):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (108899 => 108900)


--- trunk/Source/WebKit2/ChangeLog	2012-02-25 17:43:32 UTC (rev 108899)
+++ trunk/Source/WebKit2/ChangeLog	2012-02-25 17:59:27 UTC (rev 108900)
@@ -1,3 +1,20 @@
+2012-02-25  No'am Rosenthal  <noam.rosent...@nokia.com>
+
+        [Qt] Use the existing inheritedOpacity/matrix properties of QSGNode
+        https://bugs.webkit.org/show_bug.cgi?id=79543
+
+        Use QSGNode::inheritedOpacity() and QSGNode::matrix().
+        Also, remove flags from changedStates() that we don't actually touch.
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        * UIProcess/API/qt/qquickwebpage.cpp:
+        (QQuickWebPagePrivate::paintToCurrentGLContext):
+        (PageProxyNode::changedStates):
+        (PageProxyNode::render):
+        * UIProcess/API/qt/qquickwebpage_p_p.h:
+        (QQuickWebPagePrivate):
+
 2012-02-25  Sheriff Bot  <webkit.review....@gmail.com>
 
         Unreviewed, rolling out r108816.

Modified: trunk/Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp (108899 => 108900)


--- trunk/Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp	2012-02-25 17:43:32 UTC (rev 108899)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qquickwebpage.cpp	2012-02-25 17:59:27 UTC (rev 108900)
@@ -63,18 +63,6 @@
     eventHandler.reset(new QtWebPageEventHandler(toAPI(webPageProxy), q, viewportItem));
 }
 
-static float computeEffectiveOpacity(const QQuickItem* item)
-{
-    if (!item)
-        return 1;
-
-    float opacity = item->opacity();
-    if (opacity < 0.01)
-        return 0;
-
-    return opacity * computeEffectiveOpacity(item->parentItem());
-}
-
 void QQuickWebPagePrivate::setDrawingAreaSize(const QSize& size)
 {
     DrawingAreaProxy* drawingArea = webPageProxy->drawingArea();
@@ -89,15 +77,11 @@
         webPageProxy->drawingArea()->paintLayerTree(painter);
 }
 
-void QQuickWebPagePrivate::paintToCurrentGLContext()
+void QQuickWebPagePrivate::paintToCurrentGLContext(const QTransform& transform, float opacity)
 {
     if (!q->isVisible())
         return;
 
-    QTransform transform = q->itemTransform(0, 0);
-    transform.scale(contentsScale, contentsScale);
-
-    float opacity = computeEffectiveOpacity(q);
     QRectF clipRect = viewportItem->mapRectToScene(viewportItem->boundingRect());
 
     if (!clipRect.isValid())
@@ -107,7 +91,7 @@
     if (!drawingArea)
         return;
 
-    drawingArea->paintToCurrentGLContext(transform, opacity, clipRect);
+    drawingArea->paintToCurrentGLContext(QTransform(transform).scale(contentsScale, contentsScale), opacity, clipRect);
 }
 
 struct PageProxyNode : public QSGRenderNode {
@@ -118,14 +102,13 @@
 
     virtual StateFlags changedStates()
     {
-        return StateFlags(DepthState) | StencilState | ScissorState | ColorState | BlendState
-               | CullState | ViewportState;
+        return StateFlags(StencilState) | ColorState | BlendState;
     }
 
-    virtual void render(const RenderState &)
+    virtual void render(const RenderState&)
     {
         if (m_pagePrivate)
-            m_pagePrivate->paintToCurrentGLContext();
+            m_pagePrivate->paintToCurrentGLContext(matrix()->toTransform(), inheritedOpacity());
     }
 
     ~PageProxyNode()

Modified: trunk/Source/WebKit2/UIProcess/API/qt/qquickwebpage_p_p.h (108899 => 108900)


--- trunk/Source/WebKit2/UIProcess/API/qt/qquickwebpage_p_p.h	2012-02-25 17:43:32 UTC (rev 108899)
+++ trunk/Source/WebKit2/UIProcess/API/qt/qquickwebpage_p_p.h	2012-02-25 17:59:27 UTC (rev 108900)
@@ -41,7 +41,7 @@
 
     void updateSize();
 
-    void paintToCurrentGLContext();
+    void paintToCurrentGLContext(const QTransform&, float opacity);
     void paint(QPainter*);
     void resetPaintNode();
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to