Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-dev] most performant way to paint a (platform-specific) pixel-array

Hi Nick,

currently I don't have any measures and just trying to collect some information. My use case is to integrate a software OpenGL render (jGL) and for that I need to store the rendered pixels somewhere and of course later I need to paint them.

I just wondering if I could short-circuit some of the steps (imagedata>image>gc) and maybe write directly inside some kind of direct-buffer.

For example if I look at for GTK there seem to happen some more action than simply keeping a reference to the image data, e.g. a scale factor is computed, copy of data is involved, color transformation and so on are performed.

Maybe as you mention it does not matter, on the other hand the faster the better here (maybe) this also is a bit depending on the effort to make this happen here of course but I'd like to investigate a bit if I should take some internals into account before starting to implement the actual thing.

Am 20.04.21 um 19:19 schrieb Nick Edgar:
Hi Christoph,

That approach is generally the recommended way to paint images <> in SWT. Painting of a pre-created Image should be as fast as the OS allows.
Have you measured the times involved? Which phase do you need to speed up:

 1. creating ImageData,
 2. creating Image from ImageData, or
 3. painting Image?

If 1, see if you can directly manipulate the ImageData’s data, or using setPixels <>. If 2, check which image format you’re using — it may not map directly to the native display, and thus be expensive to convert. If 3, I’d be surprised, but it would be good to know details and the times for 1,2,3.

Best, Nick
On Apr 19, 2021, 5:20 AM -0400, Christoph Läubrich <laeubi@xxxxxxxxxxxxxx>, wrote:
I have a pixel-buffer and like it o be painted in the most performant
way onto a SWT Canvas.

Current approach is to convert this into an ImageData, create an image
and then paint it inside PaintListener to the GC.

Is there a way to avoid this intermediate steps? I won't mind if I need
to provide platform-specific implementations if it is possible to gain
performance here.
platform-dev mailing list
To unsubscribe from this list, visit

platform-dev mailing list
To unsubscribe from this list, visit

Back to the top