[haiku-development] Re: Optimizing Painter::_DrawBitmapBilinearCopy32

  • From: Christian Packmann <Christian.Packmann@xxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Fri, 13 Mar 2009 12:39:13 +0100

Stephan Aßmus - 2009-03-11 17:00 :
We need definitely both. We want fast B_OP_COPY for MediaPlayer and fast B_OP_ALPHA/OVER for Showimage displaying images with alpha channel. Therefor we need at least those two routines. In B_OP_COPY mode, you can calculate alpha if that's easier for you, but you need to write 255 as result and perform no blending.

I've adjusted my code for this.

In B_OP_ALPHA mode, you would additionally perform blending when writing the result. Blending with screen contents, but alpha always results in 255. Screen alpha is to be assumed 255 already in the blending calculations (simplifying them).

I'll wait with this until there is a C reference routine. But adaption of the B_OP_COPY SSE/MMX code shouldn't be hard. And vector code should really shine here, the relative speedup gets higher the more arithmetic instructions you perform on the same data.

Christian

Other related posts: