]> granicus.if.org Git - php/commitdiff
optimization via the row-major order.
authorTakeshi Abe <tabe@php.net>
Wed, 11 Feb 2009 16:30:48 +0000 (16:30 +0000)
committerTakeshi Abe <tabe@php.net>
Wed, 11 Feb 2009 16:30:48 +0000 (16:30 +0000)
ext/gd/libgd/gd.c

index 091e10b841a7a69a9ed360035de5212a50465960..7f5620cc61a5f8e273a8783434f62e05f04622e7 100644 (file)
@@ -613,8 +613,8 @@ void gdImagePaletteCopy (gdImagePtr to, gdImagePtr from)
                xlate[i] = -1;
        }
 
-       for (x = 0; x < to->sx; x++) {
-               for (y = 0; y < to->sy; y++) {
+       for (y = 0; y < to->sy; y++) {
+               for (x = 0; x < to->sx; x++) {
                        p = gdImageGetPixel(to, x, y);
                        if (xlate[p] == -1) {
                                /* This ought to use HWB, but we don't have an alpha-aware version of that yet. */