Max Clarke Masking (CCMask) really slow
Posts 5
Added by Max Clarke about 1 year ago

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 (1 kB)

Max Clarke RE: Masking (CCMask) really slow
Posts 5
Added by Max Clarke about 1 year ago

And here's the .cpp

CCMask.cpp (3 kB)

Toma To RE: Masking (CCMask) really slow
Posts 12
Added by Toma To 11 months ago

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

Minggo Zhang RE: Masking (CCMask) really slow
Posts 1641
Added by Minggo Zhang 11 months ago

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

Toma To RE: Masking (CCMask) really slow
Posts 12
Added by Toma To 11 months ago

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 ?

Toma To RE: Masking (CCMask) really slow
Posts 12
Added by Toma To 11 months ago

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


(1-5/5)