[Pixman] [PATCH 09/14] ARMv6: add platform-specific fast path for over_n_8888

Søren Sandmann sandmann at cs.au.dk
Sun Oct 13 23:07:49 PDT 2013


Siarhei Siamashka <siarhei.siamashka at gmail.com> writes:

>> +startfunc pixman_composite_over_n_8888_asm_armv6
>> +        ldr     ip, [sp]
>> +        /* Zero source is already filtered out in armv6_composite_over_n_8888() */
>> +        mvns    ip, ip, asr #24 /* Source alpha = 0xff? */
>> +        beq     pixman_composite_src_n_8888_asm_armv6
>> +        /* else drop through... */
>
> My understanding is that the optimization of operators to do this
> OVER->SRC reduction is normally expected to be handled by the
> "optimize_operator" function. 
>
> Maybe a tweak is needed here:
>
>     http://cgit.freedesktop.org/pixman/tree/pixman/pixman-image.c?id=pixman-0.30.2#n440
>
> to additionally set "flags |= FAST_PATH_IS_OPAQUE" if the solid color
> is opaque:

I vaguely remember attempting this at one point, and gave up when I ran
into the issue that if you simply call pixman_image_get_solid(), then it
may attempt to initialize iterators, which will require access to the
image flags, which we are in the process of computing.

But something similar to this code:

    {
        if (image->bits.format == PIXMAN_a8r8g8b8)
            result = image->bits.bits[0];
        else if (image->bits.format == PIXMAN_x8r8g8b8)
            result = image->bits.bits[0] | 0xff000000;
        else if (image->bits.format == PIXMAN_a8)
            result = (*(uint8_t *)image->bits.bits) << 24;
        else
            goto otherwise;
    }

from pixman_image_get_solid() can probably just be used since in
practice these formats are the only one used for 1x1 repeating
images.


Søren


More information about the Pixman mailing list