[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 13:32:19 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit ee5cd1f4a5b4518df08c8a4ae7ad8cddf105e121
Author: andreas.kling at nokia.com <andreas.kling at nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sun Sep 19 00:52:02 2010 +0000

    2010-09-18  Andreas Kling  <andreas.kling at nokia.com>
    
            Reviewed by Oliver Hunt.
    
            Gradient: Fast-path for the ideal case in sortStopsIfNecessary()
            https://bugs.webkit.org/show_bug.cgi?id=46045
    
            Avoid calling std::stable_sort for 2-stop gradients that are already in order.
    
            * platform/graphics/Gradient.cpp:
            (WebCore::Gradient::sortStopsIfNecessary):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67804 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index f6a8129..43f2d19 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,15 @@
+2010-09-18  Andreas Kling  <andreas.kling at nokia.com>
+
+        Reviewed by Oliver Hunt.
+
+        Gradient: Fast-path for the ideal case in sortStopsIfNecessary()
+        https://bugs.webkit.org/show_bug.cgi?id=46045
+
+        Avoid calling std::stable_sort for 2-stop gradients that are already in order.
+
+        * platform/graphics/Gradient.cpp:
+        (WebCore::Gradient::sortStopsIfNecessary):
+
 2010-09-18  Kwang Yul Seo  <skyul at company100.net>
 
         Reviewed by Andreas Kling.
diff --git a/WebCore/platform/graphics/Gradient.cpp b/WebCore/platform/graphics/Gradient.cpp
index 7ea6b47..8bc9b3f 100644
--- a/WebCore/platform/graphics/Gradient.cpp
+++ b/WebCore/platform/graphics/Gradient.cpp
@@ -117,9 +117,16 @@ void Gradient::sortStopsIfNecessary()
     if (m_stopsSorted)
         return;
 
-    if (m_stops.size())
-        std::stable_sort(m_stops.begin(), m_stops.end(), compareStops);
     m_stopsSorted = true;
+
+    if (!m_stops.size())
+        return;
+
+    // Shortcut for the ideal case (ordered 2-stop gradient)
+    if (m_stops.size() == 2 && compareStops(*m_stops.begin(), *m_stops.end()))
+        return;
+
+    std::stable_sort(m_stops.begin(), m_stops.end(), compareStops);
 }
 
 void Gradient::getColor(float value, float* r, float* g, float* b, float* a) const

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list