Masking (CCMask) really slow

Hi,

I’m porting an app to cocos2d-x and I’m using the CCMask class to create a circular view hole. It works fine on iOS but on Android it’s really slow.

The code originated here: http://www.cocos2d-iphone.org/forum/topic/15890/page/2#post-109368

I’ve attached the 2d-x version to this message. mask() is called every update tick using CCScheduler.

Anyone know why this is so slow? It drops the framerate down to about 4-5 fps on my HTC Sensation.

Thanks


CCMask.h.zip (0.6 KB)

And here’s the .cpp

Same problem here, but haven’t found any solution yet.

Have you tried the latest codes?
Now we don’t cache data in CCRenderTexture on Android, i think it can improve the performance.

You mean v2.0 branch ?
I used cocos2d-x-1.0.1 v 0.12 on my project, and switching to cocos2D-x 2.0 might be a too big change. Or can this change also be used on OpenGL ES 1 ?

Got it, this patch http://cocos2d-x.org/projects/native/repository/revisions/0fc4196c788ac0fbb5c3deec9d9c4772db73f4c0 works perfectly, now masking run very smoothly. Great job !