[cairo] Does pixman refactoring also contain new pixel formats?
Stefan Landvogt
stefan.landvogt at gmail.com
Tue Jun 2 04:34:11 PDT 2009
Hi Soeren,
I did not follow the list closely in the last weeks, but I was
wondering, whether the pixman refactoring also lead to new pixel
formats.
At the moment my main performance bottleneck is the following code,
that I have to use, when putting the graphics onto the screen in my
environment:
int currentWidth = GetWidth();
int currentHeight = GetHeight();
unsigned char *bufferARGB = 0;
bufferARGB = cairo_image_surface_get_data( GetCairoSurface() );
unsigned char* bufferRGBA = new unsigned char[currentWidth *
currentHeight * 4];
int currentRGBA = 0;
for(int i=0;i< currentWidth * currentHeight * 4;i+=4)
{
bufferRGBA[currentRGBA++] = bufferARGB[i+2];
bufferRGBA[currentRGBA++] = bufferARGB[i+1];
bufferRGBA[currentRGBA++] = bufferARGB[i];
bufferRGBA[currentRGBA++] = bufferARGB[i+3];
}
aSurface->DrawSetTextureRGBA( aTextureID, bufferRGBA, currentWidth,
currentHeight );
delete[] bufferRGBA;
More information about the cairo
mailing list