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

andreas.kling at nokia.com andreas.kling at nokia.com
Wed Dec 22 14:54:49 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 45b26dceae0ecff06e3f7f3b4fc65de8bb26285c
Author: andreas.kling at nokia.com <andreas.kling at nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sun Oct 24 21:08:20 2010 +0000

    2010-10-24  Andreas Kling  <kling at webkit.org>
    
            Reviewed by Kenneth Rohde Christiansen.
    
            [Qt] ImageBuffer::platformTransformColorSpace is unnecessarily slow
            https://bugs.webkit.org/show_bug.cgi?id=48211
    
            Grab the QImage::bits() and do direct access instead of going through
            QImage::pixel() and QImage::setPixel().
    
            This is a performance optimization, so no new tests.
    
            * platform/graphics/qt/ImageBufferQt.cpp:
            (WebCore::ImageBuffer::platformTransformColorSpace):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@70424 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 91dda8e..25542a0 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,18 @@
+2010-10-24  Andreas Kling  <kling at webkit.org>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt] ImageBuffer::platformTransformColorSpace is unnecessarily slow
+        https://bugs.webkit.org/show_bug.cgi?id=48211
+
+        Grab the QImage::bits() and do direct access instead of going through
+        QImage::pixel() and QImage::setPixel().
+
+        This is a performance optimization, so no new tests.
+
+        * platform/graphics/qt/ImageBufferQt.cpp:
+        (WebCore::ImageBuffer::platformTransformColorSpace):
+
 2010-10-24  Dirk Schulze  <krit at webkit.org>
 
         Reviewed by Nikolas Zimmermann.
diff --git a/WebCore/platform/graphics/qt/ImageBufferQt.cpp b/WebCore/platform/graphics/qt/ImageBufferQt.cpp
index 0cdc894..de23297 100644
--- a/WebCore/platform/graphics/qt/ImageBufferQt.cpp
+++ b/WebCore/platform/graphics/qt/ImageBufferQt.cpp
@@ -157,14 +157,17 @@ void ImageBuffer::platformTransformColorSpace(const Vector<int>& lookUpTable)
     QImage image = m_data.m_pixmap.toImage().convertToFormat(QImage::Format_ARGB32);
     ASSERT(!image.isNull());
 
+    uchar* bits = image.bits();
+    const int bytesPerLine = image.bytesPerLine();
+
     for (int y = 0; y < m_size.height(); ++y) {
-        for (int x = 0; x < m_size.width(); x++) {
-            QRgb value = image.pixel(x, y);
-            value = qRgba(lookUpTable[qRed(value)],
-                          lookUpTable[qGreen(value)],
-                          lookUpTable[qBlue(value)],
-                          qAlpha(value));
-            image.setPixel(x, y, value);
+        quint32* scanLine = reinterpret_cast_ptr<quint32*>(bits + y * bytesPerLine);
+        for (int x = 0; x < m_size.width(); ++x) {
+            QRgb& pixel = scanLine[x];
+            pixel = qRgba(lookUpTable[qRed(pixel)],
+                          lookUpTable[qGreen(pixel)],
+                          lookUpTable[qBlue(pixel)],
+                          qAlpha(pixel));
         }
     }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list