> how can I efficiently change the alpha value of all pixels in a pixmap?
> I want to do a fadein/-out effect. In a previous version I could do sth
> like this:
> 
> GrCopyArea(trg, gc, 0, 0, w, h, src, 0, 0,
>    MWROP_BLENDCONSTANT | (fadelevel & 0xFF));
> 
> But this does not work anymore, since the constant is now fixed at 150.

Arne,

This one will be a little complicated, because of the way that all the blit
code was rewritten in 0.93.  Here is a way that should make it work; 
we essentially need to make room for the lower eight bits to hold
the fade level as a parameter to blendconstant, like the old version did:

1. Redefine MWROP_BLENDCONSTANT to 0x100 in mwtypes.h.
This will make room, for this ROP only, for the alpha param in the
lower 8 bits.

2. Move the code handling MWROP_BLENDCONSTANT out of the
switch statement in convblit_frameb.c to just above the switch statement,
and check for "if ((op & 0xff00) == MWROP_BLENDCONSTANT) {…} else switch ...
to handle this ROP.

3. Get the alpha value as "int alpha = op & 0xff;'"

Things should work as before.  I may have forgotten something,
but that seems from visual inspection that it should work.

Regards,

Greg


---------------------------------------------------------------------
To unsubscribe, e-mail: nanogui-unsubscr...@linuxhacker.org
For additional commands, e-mail: nanogui-h...@linuxhacker.org

Reply via email to