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

girish at forwardbias.in girish at forwardbias.in
Wed Dec 22 12:24:28 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 4d583cc90873ec8952c488d41230656625769844
Author: girish at forwardbias.in <girish at forwardbias.in@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Aug 21 05:14:18 2010 +0000

    [Qt] When using the raster graphics system on Maemo5, allow
    Flash to render directly into the raster window surface.
    wmode=transparent is now supported as a result of this change.
    
    Reviewed by Ariya Hidayat.
    
    https://bugs.webkit.org/show_bug.cgi?id=44043
    
    * plugins/qt/PluginViewQt.cpp:
    (WebCore::PluginView::paintUsingImageSurfaceExtension):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65775 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 45f623c..8e618bc 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2010-08-20  Girish Ramakrishnan  <girish at forwardbias.in>
+
+        Reviewed by Ariya Hidayat.
+
+        [Qt] When using the raster graphics system on Maemo5, allow
+        Flash to render directly into the raster window surface.
+        wmode=transparent is now supported as a result of this change.
+        
+        https://bugs.webkit.org/show_bug.cgi?id=44043
+        
+        * plugins/qt/PluginViewQt.cpp:
+        (WebCore::PluginView::paintUsingImageSurfaceExtension):
+
 2010-08-20  Alexey Proskuryakov  <ap at apple.com>
 
         Reviewed by Brady Eidson.
diff --git a/WebCore/plugins/qt/PluginViewQt.cpp b/WebCore/plugins/qt/PluginViewQt.cpp
index 3b41072..5c681b8 100644
--- a/WebCore/plugins/qt/PluginViewQt.cpp
+++ b/WebCore/plugins/qt/PluginViewQt.cpp
@@ -171,27 +171,49 @@ void PluginView::hide()
 #if defined(MOZ_PLATFORM_MAEMO) && (MOZ_PLATFORM_MAEMO == 5)
 void PluginView::paintUsingImageSurfaceExtension(QPainter* painter, const IntRect& exposedRect)
 {
-    if (m_isTransparent) {
-        // On Maemo5, Flash expects the buffer to contain the contents that are below it.
-        // We don't support transparency, so clean the image before giving to Flash.
-        QPainter imagePainter(&m_image);
-        imagePainter.fillRect(exposedRect, Qt::white);
-    }
-
     NPImageExpose imageExpose;
-    imageExpose.data = reinterpret_cast<char*>(m_image.bits());
-    imageExpose.stride = m_image.bytesPerLine();
-    imageExpose.depth = m_image.depth();
+    QPoint offset;
+    QWebPageClient* client = m_parentFrame->view()->hostWindow()->platformPageClient();
+    const bool surfaceHasUntransformedContents = client && qobject_cast<QWidget*>(client->pluginParent());
+
+    QPaintDevice* surface =  QPainter::redirected(painter->device(), &offset);
+
+    // If the surface is a QImage, we can render directly into it
+    if (surfaceHasUntransformedContents && surface && surface->devType() == QInternal::Image) {
+        QImage* image = static_cast<QImage*>(surface);
+        offset = -offset; // negating the offset gives us the offset of the view within the surface
+        imageExpose.data = reinterpret_cast<char*>(image->bits());
+        imageExpose.dataSize.width = image->width();
+        imageExpose.dataSize.height = image->height();
+        imageExpose.stride = image->bytesPerLine();
+        imageExpose.depth = image->depth(); // this is guaranteed to be 16 on Maemo5
+        imageExpose.translateX = offset.x() + m_windowRect.x();
+        imageExpose.translateY = offset.y() + m_windowRect.y();
+        imageExpose.scaleX = 1;
+        imageExpose.scaleY = 1;
+    } else {
+        if (m_isTransparent) {
+            // On Maemo5, Flash expects the buffer to contain the contents that are below it.
+            // We don't support transparency for non-raster graphicssystem, so clean the image 
+            // before giving to Flash.
+            QPainter imagePainter(&m_image);
+            imagePainter.fillRect(exposedRect, Qt::white);
+        }
+
+        imageExpose.data = reinterpret_cast<char*>(m_image.bits());
+        imageExpose.dataSize.width = m_image.width();
+        imageExpose.dataSize.height = m_image.height();
+        imageExpose.stride = m_image.bytesPerLine();
+        imageExpose.depth = m_image.depth();
+        imageExpose.translateX = 0;
+        imageExpose.translateY = 0;
+        imageExpose.scaleX = 1;
+        imageExpose.scaleY = 1;
+    }
     imageExpose.x = exposedRect.x();
     imageExpose.y = exposedRect.y();
     imageExpose.width = exposedRect.width();
     imageExpose.height = exposedRect.height();
-    imageExpose.dataSize.width = m_image.width();
-    imageExpose.dataSize.height = m_image.height();
-    imageExpose.translateX = 0;
-    imageExpose.translateY = 0;
-    imageExpose.scaleX = 1;
-    imageExpose.scaleY = 1;
 
     XEvent xevent;
     memset(&xevent, 0, sizeof(XEvent));
@@ -206,7 +228,8 @@ void PluginView::paintUsingImageSurfaceExtension(QPainter* painter, const IntRec
 
     dispatchNPEvent(xevent);
 
-    painter->drawImage(QPoint(frameRect().x() + exposedRect.x(), frameRect().y() + exposedRect.y()), m_image, exposedRect);
+    if (!surfaceHasUntransformedContents || !surface || surface->devType() != QInternal::Image)
+        painter->drawImage(QPoint(frameRect().x() + exposedRect.x(), frameRect().y() + exposedRect.y()), m_image, exposedRect);
 }
 #endif
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list