I have very simple 1024x768 sized png images that are 7KB in size at an average. I apply the same size masks which are only 3-4KB, but the masking process takes 1500ms of time. As I have 5-15 pics in each scene this is not acceptable. The weird thing is that when I do the same thing with an onTouch function it only takes 2ms. Below is the code:
[lua]
for i=1,totalParts do
local t1 = system.getTimer()
background[i] = display.newRect(0, 0, display.contentWidth, display.contentHeight)
background[i]:setFillColor(255, 255, 255)
local mask = graphics.newMask( “mask.png” )
background[i]:setMask( mask )
mainScreen:insert(background[i])
local t2 = system.getTimer()
print(“time passed=”, t2-t1)
end
[/lua]
When I run the above code “time passed” prints around 1500ms. Am I doing something wrong?