cancel
Showing results for 
Search instead for 
Did you mean: 

How to use smaller memory to draw line?

Breeze1
Associate III

I am using touchgfx to draw a sine line.I have two questions.

0690X00000AQwZQQA1.pngThis is what I drawed using touchgfx simulator.

First question:

It looks like somewhere of the line is in light color, I don't konw why? Can it be fixed?

0690X00000AQwa4QAD.png

This is the drawing using memeory . The CWR using memory is keeping growing.

I set the canvas buffer size 32767 which is the largest number.It still is not enough.

If I draw some complext line ,it will be a disaster...

So the second question:

How can I draw line with smallest memory?

Best regards for answering. Thanks...

1 ACCEPTED SOLUTION

Accepted Solutions
Martin KJELDSEN
Chief III

It's not actually using this memory size. The console says "requires" which means it's recommended for optimal performance. We do not allocate dynamically in touchgfx. Maybe the description could be improved a bit since you find it confusing =)

If you get this sort of output it just means we'll do more passes at the cost of performance because your "canvas buffer" is too small for the best performance, but performance may still be acceptable to you.

In essence: Set the size of the buffer you're happy with or can afford. Evaluate the performance of the graph. If it's a happy m@rriage then you're done.

/Martin

View solution in original post

2 REPLIES 2
Martin KJELDSEN
Chief III

It's not actually using this memory size. The console says "requires" which means it's recommended for optimal performance. We do not allocate dynamically in touchgfx. Maybe the description could be improved a bit since you find it confusing =)

If you get this sort of output it just means we'll do more passes at the cost of performance because your "canvas buffer" is too small for the best performance, but performance may still be acceptable to you.

In essence: Set the size of the buffer you're happy with or can afford. Evaluate the performance of the graph. If it's a happy m@rriage then you're done.

/Martin

Breeze1
Associate III

Thanks for your reply. You are completely right. I tried smaller canvas buffer, it can still work. But it will take a longger time to draw.

I also found out why it is in light color. Because it is using Rasterizer to draw , which is based on "The Lightweight Rasterizer" .

If someone use it should be careful.