~ubuntu-branches/ubuntu/utopic/inkscape/utopic-proposed

« back to all changes in this revision

Viewing changes to src/display/nr-arena-item.cpp

Tags: upstream-0.48.0
ImportĀ upstreamĀ versionĀ 0.48.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
513
513
                                d = NR_PIXBLOCK_PX (&mpb) + (y -
514
514
                                                             carea.y0) * mpb.rs;
515
515
                                for (x = carea.x0; x < carea.x1; x++) {
516
 
                                    // See below for calculation
517
516
                                    unsigned int m;
518
 
                                    m = NR_PREMUL_112 ( (NR_PREMUL_112 (s[0],  54) +
519
 
                                                         NR_PREMUL_112 (s[1], 183) +
520
 
                                                         NR_PREMUL_112 (s[2],  19) ) >> 8, s[3]);
521
 
                                    d[0] = FAST_DIV_ROUND < 255 * 255 > ( NR_PREMUL_123 (d[0], m));
 
517
                                    m = NR_PREMUL_112 (s[0] + s[1] + s[2], s[3]);
 
518
                                    d[0] =
 
519
                                        FAST_DIV_ROUND < 3 * 255 * 255 >
 
520
                                        (NR_PREMUL_123 (d[0], m));
522
521
                                    s += 4;
523
522
                                    d += 1;
524
523
                                }
533
532
                                                             carea.y0) * mpb.rs;
534
533
                                for (x = carea.x0; x < carea.x1; x++) {
535
534
                                    unsigned int m;
536
 
                                    // m = NR_PREMUL_112 (s[0] + s[1] + s[2], s[3]);
537
 
                                    // d[0] = FAST_DIV_ROUND < 3 * 255 > (m);
538
 
                                    // Must use luminance to alpha from feColorMatrix.
539
 
                                    // This is an approximation, optimized(?) for speed.
540
 
                                    // 0.2125 * 256 =  54.4000
541
 
                                    // 0.7154 * 256 = 183.1424
542
 
                                    // 0.0721 * 256 =  18.4576
543
 
                                    m = NR_PREMUL_112 ( (NR_PREMUL_112 (s[0],  54) +
544
 
                                                         NR_PREMUL_112 (s[1], 183) +
545
 
                                                         NR_PREMUL_112 (s[2],  19) ) >> 8, s[3]);
546
 
                                    d[0] = FAST_DIV_ROUND < 255 > (m);
 
535
                                    m = NR_PREMUL_112 (s[0] + s[1] + s[2], s[3]);
 
536
                                    d[0] = FAST_DIV_ROUND < 3 * 255 > (m);
547
537
                                    s += 4;
548
538
                                    d += 1;
549
539
                                }