PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

CGapiSurface used as a mask Question

CGapiSurface* mask = new CGapiSurface();
mask->CreateSurface(NULL,width,height);

mask->FillSurface
(NULL,RGB(0,alpha,0),NULL,NULL);


MyQuestion:
How much memory will be allocated for the mask?
size of (RGB)*width*height or
sizeof(G)*widht*height?
(the R and B component are 0)

Note that keeping memory only the G component of the surface is enough ...
[/code]
My understanding is all surfaces are 16-bit surfaces in GapiDraw and as such all surfaces would be equated as Height X Width X 2 bytes (16 bits).
Well it is ... but the issue is whether it could be optimized to keep 2/3 less memory for the mask ...
Basically it could.. But all mask operations would have to be modified. It also would mean very little performance gain.
So, shall we see it in the next version of GapiDraw?

I think that is worth to implement ...
or maybe implement a new CGapiMaskSurface class that would be memory optimized and some drawing methods using it ...
I prefer the first option
Of course, as you said, there would be other thing that would need touch ...