Polygon fill rate... I have some figures... might be of interest.

I have created a library that makes the drawFilledPath in the blackberry Graphics object to fill polygons.

I used polygons of 8 summits with a mixture of convex and concave vertices.

I just call the function with a null value for the pointtype and offsets (which means a path and the lines connecting the edges).

He painted 10000 polygons in 5 seconds. I just made an invalid so it was drawn in the bottom, but not visible until the end.

So, that's a rate of about 2000 complex polygons per second.

Now, if you use squares or triangles I suppose that the rate is considerably higher. I would love to have access to the blackberry for this function JNI code, as I have an algorithm very fast to determine whether a point is inside a triangle. This is normally used in the algorithms of triangulation, which is what would have been used and the GPU has a triangle block at the hardware level, so that the speed of the CPU would be linked to the triangulation algorithm.

Anyway, this isn't a bad rate for a phone :-)

If you have used squares/triangles, you would probably get a much higher rate in the order of perhaps as high as 10000 triangles per second. (I didn't have the time to do this test).

I hope it's useful to someone.

BTW, I used a screen with a button to do various tests and a less than BitmapField containing a bitmap which I had extracted the graphics context that I used for all drawing. He also took care of clipping of the polygons that ran outside the region of the BitmapField. I also discovered that it would be nice if the area had its own invalidate the function I call, I could always call the display invalidate the function and use of the scope to only redraw the bitmap image area (something to note).

Since this is just a tip, I'll just mark it as resolved.

-Donald

Info only - solved.

Tags: BlackBerry Developers

Similar Questions

Maybe you are looking for