[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

zecke at webkit.org zecke at webkit.org
Wed Apr 7 23:01:43 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit acd6828695075b46abb8aded13220ac54eb3698e
Author: zecke at webkit.org <zecke at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Oct 23 12:02:37 2009 +0000

    [Qt] Windowless Plugins : Don't use m_clipRect when painting.
    
    2009-10-23  Girish Ramakrishnan  <girish at forwardbias.in>
    
            Reviewed by Holger Freyther.
    
            [Qt] Windowless Plugins : Don't use m_clipRect when painting.
    
            Though it works, it is not correct to use m_clipRect for painting
            in Windowless mode. Instead, the rect paramater that is passed
            as a part of PluginView::paint() must be used. This change will
            also result in some speedup since previously we used to paint all
            the visible parts of a windowless plugin (even if those parts were
            not dirty).
    
            Also, fix invalidateRect() to compute the correct width and height.
    
            https://bugs.webkit.org/show_bug.cgi?id=30711
    
            * plugins/qt/PluginViewQt.cpp:
            (WebCore::PluginView::paint):
            (WebCore::PluginView::invalidateRect):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@49974 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 53d11db..0b03cb9 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,24 @@
+2009-10-23  Girish Ramakrishnan  <girish at forwardbias.in>
+
+        Reviewed by Holger Freyther.
+
+        [Qt] Windowless Plugins : Don't use m_clipRect when painting.
+
+        Though it works, it is not correct to use m_clipRect for painting
+        in Windowless mode. Instead, the rect paramater that is passed
+        as a part of PluginView::paint() must be used. This change will
+        also result in some speedup since previously we used to paint all
+        the visible parts of a windowless plugin (even if those parts were
+        not dirty).
+
+        Also, fix invalidateRect() to compute the correct width and height.
+
+        https://bugs.webkit.org/show_bug.cgi?id=30711
+
+        * plugins/qt/PluginViewQt.cpp:
+        (WebCore::PluginView::paint):
+        (WebCore::PluginView::invalidateRect):
+
 2009-10-21  Girish Ramakrishnan  <girish at forwardbias.in>
 
         Reviewed by Holger Freyther.
diff --git a/WebCore/plugins/qt/PluginViewQt.cpp b/WebCore/plugins/qt/PluginViewQt.cpp
index 28637a1..f67c6ba 100644
--- a/WebCore/plugins/qt/PluginViewQt.cpp
+++ b/WebCore/plugins/qt/PluginViewQt.cpp
@@ -178,6 +178,9 @@ void PluginView::paint(GraphicsContext* context, const IntRect& rect)
     const bool syncX = m_pluginDisplay && m_pluginDisplay != QX11Info::display();
 
     QPainter* painter = context->platformContext();
+    IntRect exposedRect(rect);
+    exposedRect.intersect(frameRect());
+    exposedRect.move(-frameRect().x(), -frameRect().y());
 
     QPixmap qtDrawable = QPixmap::fromX11Pixmap(m_drawable, QPixmap::ExplicitlyShared);
     const int drawableDepth = ((NPSetWindowCallbackStruct*)m_npWindow.ws_info)->depth;
@@ -202,11 +205,11 @@ void PluginView::paint(GraphicsContext* context, const IntRect& rect)
             && backingStoreHasUntransformedContents) {
             GC gc = XDefaultGC(QX11Info::display(), QX11Info::appScreen());
             XCopyArea(QX11Info::display(), backingStorePixmap->handle(), m_drawable, gc,
-                offset.x() + m_windowRect.x() + m_clipRect.x(), offset.y() + m_windowRect.y() + m_clipRect.y(),
-                m_clipRect.width(), m_clipRect.height(), m_clipRect.x(), m_clipRect.y());
+                offset.x() + m_windowRect.x() + exposedRect.x(), offset.y() + m_windowRect.y() + exposedRect.y(),
+                exposedRect.width(), exposedRect.height(), exposedRect.x(), exposedRect.y());
         } else { // no backing store, clean the pixmap because the plugin thinks its transparent
             QPainter painter(&qtDrawable);
-            painter.fillRect(m_clipRect, Qt::white);
+            painter.fillRect(exposedRect, Qt::white);
         }
 
         if (syncX)
@@ -219,18 +222,18 @@ void PluginView::paint(GraphicsContext* context, const IntRect& rect)
     exposeEvent.type = GraphicsExpose;
     exposeEvent.display = QX11Info::display();
     exposeEvent.drawable = m_drawable;
-    exposeEvent.x = m_clipRect.x();
-    exposeEvent.y = m_clipRect.y();
-    exposeEvent.width = m_clipRect.x() + m_clipRect.width(); // flash bug? it thinks width is the right
-    exposeEvent.height = m_clipRect.y() + m_clipRect.height(); // flash bug? it thinks height is the bottom
+    exposeEvent.x = exposedRect.x();
+    exposeEvent.y = exposedRect.y();
+    exposeEvent.width = exposedRect.x() + exposedRect.width(); // flash bug? it thinks width is the right in transparent mode
+    exposeEvent.height = exposedRect.y() + exposedRect.height(); // flash bug? it thinks height is the bottom in transparent mode
 
     dispatchNPEvent(xevent);
 
     if (syncX)
         XSync(m_pluginDisplay, False); // sync changes by plugin
 
-    painter->drawPixmap(frameRect().x() + m_clipRect.x(), frameRect().y() + m_clipRect.y(), qtDrawable,
-        m_clipRect.x(), m_clipRect.y(), m_clipRect.width(), m_clipRect.height());
+    painter->drawPixmap(QPoint(frameRect().x() + exposedRect.x(), frameRect().y() + exposedRect.y()), qtDrawable,
+                        exposedRect);
 }
 
 // TODO: Unify across ports.
@@ -661,7 +664,7 @@ void PluginView::invalidateRect(NPRect* rect)
         invalidate();
         return;
     }
-    IntRect r(rect->left, rect->top, rect->right + rect->left, rect->bottom + rect->top);
+    IntRect r(rect->left, rect->top, rect->right - rect->left, rect->bottom - rect->top);
     invalidateWindowlessPluginRect(r);
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list