b=406036, canvas cleanup, r=stuart
authorvladimir@pobox.com
Fri, 18 Jan 2008 13:53:28 -0800
changeset 10416 2c54db7939751c878349931f6d1282a1156c69d7
parent 10415 99224b77f8026554900a9991c3369da59651083b
child 10417 9dfad5af39fb1d2f524ec96fe339ab352dd162dc
push id1
push userbsmedberg@mozilla.com
push dateThu, 20 Mar 2008 16:49:24 +0000
treeherdermozilla-central@61007906a1f8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersstuart
bugs406036
milestone1.9b3pre
b=406036, canvas cleanup, r=stuart
content/canvas/src/nsCanvasRenderingContext2D.cpp
--- a/content/canvas/src/nsCanvasRenderingContext2D.cpp
+++ b/content/canvas/src/nsCanvasRenderingContext2D.cpp
@@ -2604,19 +2604,20 @@ nsCanvasRenderingContext2D::PutImageData
             *imgPtr++ = ib;
 #endif
         }
     }
 
     if (mImageSurfaceData) {
         int stride = mWidth*4;
         PRUint8 *dest = mImageSurfaceData + stride*y + x*4;
-
-        for (int32 i = 0; i < y; i++) {
-            memcpy(dest, imgPtr + (w*4)*i, w*4);
+        PRUint8 *src = imageBuffer.get();
+
+        for (int32 i = 0; i < h; i++) {
+            memcpy(dest, src + (w*4)*i, w*4);
             dest += stride;
         }
     } else {
         imgsurf = cairo_image_surface_create_for_data (imageBuffer.get(),
                                                        CAIRO_FORMAT_ARGB32,
                                                        w, h, w*4);
         cairo_path_t *old_path = cairo_copy_path (mCairo);
         cairo_save (mCairo);