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

hausmann at webkit.org hausmann at webkit.org
Wed Dec 22 15:58:11 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit acc8b00136c4c3b7ed7451f21d580fd7ce44be13
Author: hausmann at webkit.org <hausmann at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Nov 17 11:01:52 2010 +0000

    [Qt] Improve painting performance on 16-bit displays
    
    Reviewed by Kenneth Christiansen.
    
    When the default pixmap depth is 16-bit, then use RGB16 instead of
    RGB32 for the chunks, to avoid unnecessary conversions and reduce
    chunk size. The conversions happen as images as QPixmaps have 16-bit
    depth and the tiles on the ui process are also backed by QPixmaps.
    
    * Shared/qt/UpdateChunk.cpp:
    (WebKit::UpdateChunk::size):
    (WebKit::UpdateChunk::createImage):
    * Shared/qt/UpdateChunk.h:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72185 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 66a7a47..cf56e64 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,19 @@
+2010-11-17  Simon Hausmann  <simon.hausmann at nokia.com>
+
+        Reviewed by Kenneth Christiansen.
+
+        [Qt] Improve painting performance on 16-bit displays
+
+        When the default pixmap depth is 16-bit, then use RGB16 instead of
+        RGB32 for the chunks, to avoid unnecessary conversions and reduce
+        chunk size. The conversions happen as images as QPixmaps have 16-bit
+        depth and the tiles on the ui process are also backed by QPixmaps.
+
+        * Shared/qt/UpdateChunk.cpp:
+        (WebKit::UpdateChunk::size):
+        (WebKit::UpdateChunk::createImage):
+        * Shared/qt/UpdateChunk.h:
+
 2010-11-16  Sam Weinig  <sam at webkit.org>
 
         Reviewed by Adam Roben.
diff --git a/WebKit2/Shared/qt/UpdateChunk.cpp b/WebKit2/Shared/qt/UpdateChunk.cpp
index 770c069..4d8e62d 100644
--- a/WebKit2/Shared/qt/UpdateChunk.cpp
+++ b/WebKit2/Shared/qt/UpdateChunk.cpp
@@ -33,6 +33,7 @@
 #include "WebCoreArgumentCoders.h"
 #include <QIODevice>
 #include <QImage>
+#include <QPixmap>
 #include <WebCore/FloatRect.h>
 #include <wtf/text/WTFString.h>
 
@@ -41,7 +42,6 @@ using namespace std;
 
 namespace WebKit {
 
-
 UpdateChunk::UpdateChunk()
     : m_mappedMemory(0)
 {
@@ -87,10 +87,32 @@ bool UpdateChunk::decode(CoreIPC::ArgumentDecoder* decoder, UpdateChunk& chunk)
     return true;
 }
 
+size_t UpdateChunk::size() const
+{
+    int bpp;
+    if (QPixmap::defaultDepth() == 16)
+        bpp = 2;
+    else
+        bpp = 4;
+
+    return ((m_rect.width() * bpp + 3) & ~0x3)
+           * m_rect.height();
+}
+
 QImage UpdateChunk::createImage() const
 {
     ASSERT(m_mappedMemory);
-    return QImage(m_mappedMemory->data(), m_rect.width(), m_rect.height(), m_rect.width() * 4, QImage::Format_RGB32);
+    QImage::Format format;
+    int bpp;
+    if (QPixmap::defaultDepth() == 16) {
+        format = QImage::Format_RGB16;
+        bpp = 2;
+    } else {
+        format = QImage::Format_RGB32;
+        bpp = 4;
+    }
+
+    return QImage(m_mappedMemory->data(), m_rect.width(), m_rect.height(), (m_rect.width() * bpp + 3) & ~0x3, format);
 }
 
 } // namespace WebKit
diff --git a/WebKit2/Shared/qt/UpdateChunk.h b/WebKit2/Shared/qt/UpdateChunk.h
index bdfd9c1..f506ba7 100644
--- a/WebKit2/Shared/qt/UpdateChunk.h
+++ b/WebKit2/Shared/qt/UpdateChunk.h
@@ -54,7 +54,7 @@ public:
     QImage createImage() const;
 
 private:
-    size_t size() const { return m_rect.width() * 4 * m_rect.height(); }
+    size_t size() const;
 
     WebCore::IntRect m_rect;
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list