[cairo] question on cairo, opengl and x-window

Guo Tang guo.tang at sonoartis.com
Fri May 11 12:04:17 PDT 2012


Hi,

We have a software that uses cairo and X window system. The old design is
using several X windows, several of them are transparent. We use Cairo to
draw
image, curves and text annotation.

The design with several X windows causes us some problems when we move to a
newer version of Linux. It also has lots of trouble with Xming X window
manager.
We are thinking about a new design with just one X window. The image
display part is already moved to OpenGL (for better performance reason). I
am thinking about
still keep our old cairo codes for text annotation, but avoiding a separate
X window.

The old logic:

from X window, create_cairo_context.
from a transparent png file, create a surface.
set the surface to cairo context
then draw things on cairo context

If I want to just use one X window (this window already has OpenGL context
in it). Is the solution this way?

new logic:
create a cairo context without any X window (?).
png file to surface.
set the surface to cairo context
then draw things on cairo context
get the drawing result back to memory.
then use OpenGL to render it to hardware.


I am wondering whether new logic is possible? Will all the cairo rendering
all done in software without hardware acceleration, versus old logic has?
If without HW acceleration, I will only
be able to keep cairo for non real time drawing.
Any better way to link OpenGL and cairo together? Like user still uses
cairo API to draw, but it is actually drawing using hardware (openGL), in a
specify depth, and
with the opacity setting that I can control?

Your advise is appreciated.

Thanks,
Guo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cairographics.org/archives/cairo/attachments/20120511/6371cd8e/attachment.htm>


More information about the cairo mailing list