How expensive are scaled blits?

Hi there!

I would be interrested how expensive scaled blits are, in my case I have some gradients that I render into images and I render these images to screen since its a lot faster than plain gradients.

However, for now I create a new image every time I need a new gradient, but I could it also implement with a scaled-blit. In overall I paint such an image 20-50 times, before I have to create a new.

How efficient are scaled blits handled in the traditional pipelines and are they more expensive than normal blits with the accerlated pipelines at all (ogl/d3d)?

Thank you in advance, lg Clemens Eisserer

Well, usually it’s pretty slow.

Under windows it’s quite fast if you set the sun.java2d.ddscale flag to true. It’s also (cheap) filtered then, which makes it unusalbe if you had a retro look in mind.

hmm, and do you know how it behaves under the new accerlated pipelines like OpenGL or the upcomming direct3d?
In this case blits should be exactly as cheap as scaled blits shoulnd’nt they (since 3D games do this all the time)?

lg Clemens

First, our software scaling loops are pretty fast (for supported formats, and most common image formats are supported), especially in Mustang - there were important performance fixes in this area. And in mustang they can do transformation and compositing at the same time w/o intermediate buffers.

What could be slow is reading from vram if you do a compositing blit/scale to a vram-based surface.

As for the hardware-accelerated loops (for both opengl and d3d pipelines), yes, they’re almost as fast as the hardware allows.

Thanks,
Dmitri
Java2D Team

BTW, you can use J2DBench to run some scaling benchmarks…
Any benchmarks, really.

Thanks!

So I’ll use much more scaled blits in future. Thanks for the suggestions!

lg Clemens Eisserer