Small performance improvement to putImageData (3-5% on assignment in my tests)
authoroliver@apple.com <oliver@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Mar 2008 09:13:42 +0000 (09:13 +0000)
committeroliver@apple.com <oliver@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Mar 2008 09:13:42 +0000 (09:13 +0000)
Reviewed by Alexey P

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@30793 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/html/CanvasPixelArray.h

index 0e5092c508c1ad8c19514ffb09bdfe5b033917ff..dc5205652b304bdc02fd685830f7ae85717e82bf 100644 (file)
@@ -1,3 +1,12 @@
+2008-03-05  Oliver Hunt  <oliver@apple.com>
+
+        Reviewed by Alexey P.
+
+        Small performance improvement to putImageData (3-5% on assignment in my tests)
+
+        * html/CanvasPixelArray.h:
+        (WebCore::CanvasPixelArray::set):
+
 2008-03-04  Sam Weinig  <sam@webkit.org>
 
         Reviewed by Adele.
index 1a7e69b21ee4072db4cf544f12ee877ed455a416..5560538595998a3f1278ac9aa25cdb2e790201ba 100644 (file)
@@ -51,7 +51,7 @@ namespace WebCore {
                 value = 0;
             else if (value > 255)
                 value = 255;
-            m_data[index] = lround(value);
+            m_data[index] = static_cast<unsigned char>(value + 0.5);
         }
 
         bool get(unsigned index, unsigned char& result) const