[cairo] Does Cairo have software-surfaces?

Adam Goode adam at evdebs.org
Tue Mar 29 07:00:19 PST 2005


On Mon, 2005-03-28 at 07:38 -0500, Carl Worth wrote:

> As for "accelerated in VRAM under some circumstances", I'm not sure
> exactly what you have in mind there. 

I think this is what the Java people call "Managed Images":

http://weblogs.java.net/blog/chet/archive/2003/08/bufferedimage_a_1.html

> This is where Managed Images come in (our new catch-phrase which,
> roughly translated, means "we will try our darnedest to accelerate
> this for you"). Here, you create an image however you need to, start
> working with it, and internally we will recognize that these copying
> operations can go much faster using an accelerated version, so we will
> just create that cached version for you. You don't need to manage the
> image and you don't need to know how these operations are happening;
> you just keep calling your rendering operations and let us take care
> of the pesky details.


It basically uses heuristics and timing to determine where an image
should be in memory. If you're blitting a bunch of static images over
and over, they may migrate into VRAM with accelerated blitting
available. If you're doing a lot of alpha drawing (which involves slow
reads from video memory), the system will detect it and move the image
back to (faster-reading) system RAM.

See: http://java.sun.com/products/java-media/2D/perf_graphics.html#63218


(There's also VolatileImage, which is Java's abstraction of the kind of
surface provided by DirectDraw in Windows. This surface is more
accelerateable, but the contents of the surface may be discarded by the
system at any time. I believe SDL_HWSURFACE is the same. I think they
are basically like backbuffers that can experience "damage".)


Adam





More information about the cairo mailing list