Masking (CCMask) really slow

Masking (CCMask) really slow
0.0 0



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:

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 (0.6 KB)

Mask for Sprite

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 works perfectly, now masking run very smoothly. Great job !