<?xml version='1.0' encoding='UTF-8'?> 
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
                "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
<!ENTITY version SYSTEM "version.xml">
]>
<refentry id="cairo-xlib-xrender-surface">
<refmeta>
<refentrytitle role="top_of_page" id="cairo-xlib-xrender-surface.top_of_page">XLib/XRender Backend</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>CAIRO Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>XLib/XRender Backend</refname>
<refpurpose>X Window System rendering using XLib and the X Render extension</refpurpose>
</refnamediv>

<refsynopsisdiv id="cairo-xlib-xrender-surface.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>
#define             <link linkend="CAIRO-HAS-XLIB-XRENDER-SURFACE--CAPS">CAIRO_HAS_XLIB_XRENDER_SURFACE</link>
<link linkend="cairo-surface-t">cairo_surface_t</link> *   <link linkend="cairo-xlib-surface-create-with-xrender-format">cairo_xlib_surface_create_with_xrender_format</link>
                                                        (<link linkend="Display">Display</link> *dpy,
                                                         <link linkend="Drawable">Drawable</link> drawable,
                                                         <link linkend="Screen">Screen</link> *screen,
                                                         <link linkend="XRenderPictFormat">XRenderPictFormat</link> *format,
                                                         <link linkend="int">int</link> width,
                                                         <link linkend="int">int</link> height);
<link linkend="XRenderPictFormat">XRenderPictFormat</link> * <link linkend="cairo-xlib-surface-get-xrender-format">cairo_xlib_surface_get_xrender_format</link>
                                                        (<link linkend="cairo-surface-t">cairo_surface_t</link> *surface);
</synopsis>
</refsynopsisdiv>









<refsect1 id="cairo-xlib-xrender-surface.description" role="desc">
<title role="desc.title">Description</title>
<para>
The XLib surface is used to render cairo graphics to X Window System
windows and pixmaps using the XLib and Xrender libraries.
</para>
<para>
Note that the XLib surface automatically takes advantage of X Render extension
if it is available.
</para>
</refsect1>

<refsect1 id="cairo-xlib-xrender-surface.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="CAIRO-HAS-XLIB-XRENDER-SURFACE--CAPS" role="macro">
<title>CAIRO_HAS_XLIB_XRENDER_SURFACE</title>
<indexterm zone="CAIRO-HAS-XLIB-XRENDER-SURFACE--CAPS"><primary sortas="CAIRO_HAS_XLIB_XRENDER_SURFACE">CAIRO_HAS_XLIB_XRENDER_SURFACE</primary></indexterm><programlisting>#define CAIRO_HAS_XLIB_XRENDER_SURFACE 1
</programlisting>
<para>
Defined if the XLib/XRender surface functions are available.
This macro can be used to conditionally compile backend-specific code.
</para></refsect2>
<refsect2 id="cairo-xlib-surface-create-with-xrender-format" role="function">
<title>cairo_xlib_surface_create_with_xrender_format ()</title>
<indexterm zone="cairo-xlib-surface-create-with-xrender-format"><primary sortas="cairo_xlib_surface_create_with_xrender_format">cairo_xlib_surface_create_with_xrender_format</primary></indexterm><programlisting><link linkend="cairo-surface-t">cairo_surface_t</link> *   cairo_xlib_surface_create_with_xrender_format
                                                        (<link linkend="Display">Display</link> *dpy,
                                                         <link linkend="Drawable">Drawable</link> drawable,
                                                         <link linkend="Screen">Screen</link> *screen,
                                                         <link linkend="XRenderPictFormat">XRenderPictFormat</link> *format,
                                                         <link linkend="int">int</link> width,
                                                         <link linkend="int">int</link> height);</programlisting>
<para>
Creates an Xlib surface that draws to the given drawable.
The way that colors are represented in the drawable is specified
by the provided picture format.
</para>
<para>
Note: If <parameter>drawable</parameter> is a Window, then the function
<link linkend="cairo-xlib-surface-set-size"><function>cairo_xlib_surface_set_size()</function></link> must be called whenever the size of the
window changes.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>dpy</parameter>&#160;:</term>
<listitem><simpara> an X Display
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>drawable</parameter>&#160;:</term>
<listitem><simpara> an X Drawable, (a Pixmap or a Window)
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>screen</parameter>&#160;:</term>
<listitem><simpara> the X Screen associated with <parameter>drawable</parameter>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>format</parameter>&#160;:</term>
<listitem><simpara> the picture format to use for drawing to <parameter>drawable</parameter>. The depth
         of <parameter>format</parameter> must match the depth of the drawable.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>width</parameter>&#160;:</term>
<listitem><simpara> the current width of <parameter>drawable</parameter>.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>height</parameter>&#160;:</term>
<listitem><simpara> the current height of <parameter>drawable</parameter>.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the newly created surface
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="cairo-xlib-surface-get-xrender-format" role="function" condition="since:1.6">
<title>cairo_xlib_surface_get_xrender_format ()</title>
<indexterm zone="cairo-xlib-surface-get-xrender-format" role="1.6"><primary sortas="cairo_xlib_surface_get_xrender_format">cairo_xlib_surface_get_xrender_format</primary></indexterm><programlisting><link linkend="XRenderPictFormat">XRenderPictFormat</link> * cairo_xlib_surface_get_xrender_format
                                                        (<link linkend="cairo-surface-t">cairo_surface_t</link> *surface);</programlisting>
<para>
Gets the X Render picture format that <parameter>surface</parameter> uses for rendering with the
X Render extension. If the surface was created by
<link linkend="cairo-xlib-surface-create-with-xrender-format"><function>cairo_xlib_surface_create_with_xrender_format()</function></link> originally, the return
value is the format passed to that constructor.</para>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>surface</parameter>&#160;:</term>
<listitem><simpara> an xlib surface
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara> the XRenderPictFormat* associated with <parameter>surface</parameter>,
or <link linkend="NULL--CAPS"><literal>NULL</literal></link> if the surface is not an xlib surface
or if the X Render extension is not available.

</simpara></listitem></varlistentry>
</variablelist><para role="since">Since 1.6</para></refsect2>

</refsect1>



<refsect1 id="cairo-xlib-xrender-surface.see-also">
<title>See Also</title>
<para>
<itemizedlist>
<listitem><link linkend="cairo-surface-t"><type>cairo_surface_t</type></link></listitem>
</itemizedlist>
</para>
</refsect1>

</refentry>
