Canvas elements recreation performance.
Hi!
I am planning to use NoesisGui for an application which includes 2d shapes editing. For it I will probably use Canvas and put elements on it. Now it is important for me to know whether there would be a big overhead if I recreate all Children of canvas on every update. Speaking numbers, I expect to have a Canvas with no more than 1000 elements (mostly texts and paths with solid and possibly some gradient colors).
So three questions are:
Is Canvas suitable for such task?
Is there a chance that recreating all children will be performing quickly enough on tablets?
If not, then would it help if I only update shapes that actually change?
Thanks!
I am planning to use NoesisGui for an application which includes 2d shapes editing. For it I will probably use Canvas and put elements on it. Now it is important for me to know whether there would be a big overhead if I recreate all Children of canvas on every update. Speaking numbers, I expect to have a Canvas with no more than 1000 elements (mostly texts and paths with solid and possibly some gradient colors).
So three questions are:
Is Canvas suitable for such task?
Is there a chance that recreating all children will be performing quickly enough on tablets?
If not, then would it help if I only update shapes that actually change?
Thanks!
-
-
sfernandez
Site Admin
- Posts: 2065
- Joined:
Re: Canvas elements recreation performance.
Canvas is only the container of elements. It determines the position of its children using their Canvas.Left/Right and Canvas.Top/Bottom properties. Children size does not depend on Canvas size, so you have to set the dimensions of the children manually.Is Canvas suitable for such task?
Whenever is possible, you should only modify the properties that need to change, using the same objects and resources. Otherwise, lots of new objects would be created each frame, and you will lose everything that gets cached in the render tree.Is there a chance that recreating all children will be performing quickly enough on tablets?
If not, then would it help if I only update shapes that actually change?
Who is online
Users browsing this forum: No registered users and 1 guest