Code

Small fix for nr-compose-transform (I compared against 255 where I should have compar...
authorJasper van de Gronde <jasper.vandegronde@gmail.com>
Tue, 20 Apr 2010 12:13:56 +0000 (14:13 +0200)
committerJasper van de Gronde <jasper.vandegronde@gmail.com>
Tue, 20 Apr 2010 12:13:56 +0000 (14:13 +0200)
src/libnr/nr-compose-transform.cpp

index bc05c7b519d6feab284d1dedd87bf6da526982d5..e7c2865698f31ecef2c49387972e43238b573f2e 100644 (file)
@@ -135,7 +135,7 @@ nr_R8G8B8A8_N_R8G8B8A8_N_R8G8B8A8_N_TRANSFORM (unsigned char *px, int w, int h,
                                r = (r + rounding_fix) >> dbits;
                                g = (g + rounding_fix) >> dbits;
                                b = (b + rounding_fix) >> dbits;
-                if (a == 255) {
+                if (a == 255*255) {
                                        /* Full coverage, demul src */
                                        d[0] = NR_NORMALIZE_21(r);
                                        d[1] = NR_NORMALIZE_21(g);
@@ -275,7 +275,7 @@ nr_R8G8B8A8_P_R8G8B8A8_P_R8G8B8A8_N_TRANSFORM_n (unsigned char *px, int w, int h
                                r = (r + rounding_fix) >> dbits;
                                g = (g + rounding_fix) >> dbits;
                                b = (b + rounding_fix) >> dbits;
-                               if ((a == 255) || (d[3] == 0)) {
+                               if ((a == 255*255) || (d[3] == 0)) {
                                        /* Transparent BG, premul src */
                                        d[0] = NR_NORMALIZE_21(r);
                                        d[1] = NR_NORMALIZE_21(g);