102f4aeb0Sopenharmony_ci<?xml version="1.0" encoding="UTF-8"?>
202f4aeb0Sopenharmony_ci<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook MathML Module V1.1b1//EN"
302f4aeb0Sopenharmony_ci                            "http://www.oasis-open.org/docbook/xml/mathml/1.1CR1/dbmathml.dtd">
402f4aeb0Sopenharmony_ci<refentry xml:base="" id="eglCreatePixmapSurface">
502f4aeb0Sopenharmony_ci    <refentryinfo>
602f4aeb0Sopenharmony_ci         <copyright>
702f4aeb0Sopenharmony_ci             <year>2003-2014</year>
802f4aeb0Sopenharmony_ci             <holder>The Khronos Group Inc.</holder>
902f4aeb0Sopenharmony_ci         </copyright>
1002f4aeb0Sopenharmony_ci    </refentryinfo>
1102f4aeb0Sopenharmony_ci    <refmeta>
1202f4aeb0Sopenharmony_ci        <refentrytitle>eglCreatePixmapSurface</refentrytitle>
1302f4aeb0Sopenharmony_ci        <manvolnum>3G</manvolnum>
1402f4aeb0Sopenharmony_ci    </refmeta>
1502f4aeb0Sopenharmony_ci    <refnamediv>
1602f4aeb0Sopenharmony_ci        <refname>eglCreatePixmapSurface</refname>
1702f4aeb0Sopenharmony_ci        <refpurpose>
1802f4aeb0Sopenharmony_ci            create a new <acronym>EGL</acronym> pixmap surface
1902f4aeb0Sopenharmony_ci        </refpurpose>
2002f4aeb0Sopenharmony_ci    </refnamediv>
2102f4aeb0Sopenharmony_ci    <refsynopsisdiv>
2202f4aeb0Sopenharmony_ci        <title>C Specification</title>
2302f4aeb0Sopenharmony_ci        <funcsynopsis>
2402f4aeb0Sopenharmony_ci            <funcprototype>
2502f4aeb0Sopenharmony_ci                <funcdef>EGLSurface <function>eglCreatePixmapSurface</function></funcdef>
2602f4aeb0Sopenharmony_ci                <paramdef>EGLDisplay <parameter>display</parameter></paramdef>
2702f4aeb0Sopenharmony_ci                <paramdef>EGLConfig <parameter>config</parameter></paramdef>
2802f4aeb0Sopenharmony_ci                <paramdef>NativePixmapType <parameter>native_pixmap</parameter></paramdef>
2902f4aeb0Sopenharmony_ci                <paramdef>EGLint const * <parameter>attrib_list</parameter></paramdef>
3002f4aeb0Sopenharmony_ci            </funcprototype>
3102f4aeb0Sopenharmony_ci        </funcsynopsis>
3202f4aeb0Sopenharmony_ci    </refsynopsisdiv>
3302f4aeb0Sopenharmony_ci    <refsect1 id="parameters"><title>Parameters</title>
3402f4aeb0Sopenharmony_ci        <variablelist>
3502f4aeb0Sopenharmony_ci            <varlistentry>
3602f4aeb0Sopenharmony_ci                <term><parameter>display</parameter></term>
3702f4aeb0Sopenharmony_ci                <listitem><para>Specifies the EGL display connection.</para></listitem>
3802f4aeb0Sopenharmony_ci            </varlistentry>
3902f4aeb0Sopenharmony_ci            <varlistentry>
4002f4aeb0Sopenharmony_ci                <term><parameter>config</parameter></term>
4102f4aeb0Sopenharmony_ci                <listitem><para>
4202f4aeb0Sopenharmony_ci                    Specifies the EGL frame buffer configuration that defines the
4302f4aeb0Sopenharmony_ci                    frame buffer resource available to the surface.</para>
4402f4aeb0Sopenharmony_ci                </listitem>
4502f4aeb0Sopenharmony_ci            </varlistentry>
4602f4aeb0Sopenharmony_ci            <varlistentry>
4702f4aeb0Sopenharmony_ci                <term><parameter>native_pixmap</parameter></term>
4802f4aeb0Sopenharmony_ci                <listitem><para>Specifies the native pixmap.</para></listitem>
4902f4aeb0Sopenharmony_ci            </varlistentry>
5002f4aeb0Sopenharmony_ci            <varlistentry>
5102f4aeb0Sopenharmony_ci                <term><parameter>attrib_list</parameter></term>
5202f4aeb0Sopenharmony_ci                <listitem><para>
5302f4aeb0Sopenharmony_ci                    Specifies pixmap surface attributes.
5402f4aeb0Sopenharmony_ci                    May be <constant>NULL</constant> or empty
5502f4aeb0Sopenharmony_ci                    (first attribute is <constant>EGL_NONE</constant>).
5602f4aeb0Sopenharmony_ci                </para></listitem>
5702f4aeb0Sopenharmony_ci            </varlistentry>
5802f4aeb0Sopenharmony_ci        </variablelist>
5902f4aeb0Sopenharmony_ci    </refsect1>
6002f4aeb0Sopenharmony_ci    <refsect1 id="description"><title>Description</title>
6102f4aeb0Sopenharmony_ci        <para>
6202f4aeb0Sopenharmony_ci            <function>eglCreatePixmapSurface</function> creates an
6302f4aeb0Sopenharmony_ci            off-screen <acronym>EGL</acronym> pixmap surface and returns
6402f4aeb0Sopenharmony_ci            its handle. If <function>eglCreatePixmapSurface</function>
6502f4aeb0Sopenharmony_ci            fails to create a pixmap surface,
6602f4aeb0Sopenharmony_ci            <constant>EGL_NO_SURFACE</constant> is returned.
6702f4aeb0Sopenharmony_ci        </para>
6802f4aeb0Sopenharmony_ci        <para>
6902f4aeb0Sopenharmony_ci            Surface attributes are specified as a list of
7002f4aeb0Sopenharmony_ci            attribute-value pairs, terminated with
7102f4aeb0Sopenharmony_ci            <constant>EGL_NONE</constant>. Accepted attributes
7202f4aeb0Sopenharmony_ci            are:
7302f4aeb0Sopenharmony_ci        </para>
7402f4aeb0Sopenharmony_ci        <variablelist>
7502f4aeb0Sopenharmony_ci            <varlistentry>
7602f4aeb0Sopenharmony_ci                <term><constant>EGL_VG_ALPHA_FORMAT</constant></term>
7702f4aeb0Sopenharmony_ci                <listitem>
7802f4aeb0Sopenharmony_ci                <para>
7902f4aeb0Sopenharmony_ci                    Specifies how alpha values are interpreted by OpenVG
8002f4aeb0Sopenharmony_ci                    when rendering to the surface. If its value is
8102f4aeb0Sopenharmony_ci                    <constant>EGL_VG_ALPHA_FORMAT_NONPRE</constant>,
8202f4aeb0Sopenharmony_ci                    then alpha values are not premultipled. If its value
8302f4aeb0Sopenharmony_ci                    is <constant>EGL_VG_ALPHA_FORMAT_PRE</constant>,
8402f4aeb0Sopenharmony_ci                    then alpha values are premultiplied. The default
8502f4aeb0Sopenharmony_ci                    value of <constant>EGL_VG_ALPHA_FORMAT</constant> is
8602f4aeb0Sopenharmony_ci                    <constant>EGL_VG_ALPHA_FORMAT_NONPRE</constant>.
8702f4aeb0Sopenharmony_ci                </para>
8802f4aeb0Sopenharmony_ci                </listitem>
8902f4aeb0Sopenharmony_ci            </varlistentry>
9002f4aeb0Sopenharmony_ci            <varlistentry>
9102f4aeb0Sopenharmony_ci                <term><constant>EGL_VG_COLORSPACE</constant></term>
9202f4aeb0Sopenharmony_ci                <listitem>
9302f4aeb0Sopenharmony_ci                <para>
9402f4aeb0Sopenharmony_ci                    Specifies the color space used by OpenVG when
9502f4aeb0Sopenharmony_ci                    rendering to the surface. If its value is
9602f4aeb0Sopenharmony_ci                    <constant>EGL_VG_COLORSPACE_sRGB</constant>, then a
9702f4aeb0Sopenharmony_ci                    non-linear, perceptually uniform color space is
9802f4aeb0Sopenharmony_ci                    assumed, with a corresponding
9902f4aeb0Sopenharmony_ci                    <type>VGImageFormat</type> of form
10002f4aeb0Sopenharmony_ci                    <constant>VG_s*</constant>. If its value is
10102f4aeb0Sopenharmony_ci                    <constant>EGL_VG_COLORSPACE_LINEAR</constant>, then
10202f4aeb0Sopenharmony_ci                    a linear color space is assumed, with a
10302f4aeb0Sopenharmony_ci                    corresponding <type>VGImageFormat</type> of form
10402f4aeb0Sopenharmony_ci                    <constant>VG_l*</constant>. The default value of
10502f4aeb0Sopenharmony_ci                    <constant>EGL_VG_COLORSPACE</constant> is
10602f4aeb0Sopenharmony_ci                    <constant>EGL_VG_COLORSPACE_sRGB</constant>.
10702f4aeb0Sopenharmony_ci                </para>
10802f4aeb0Sopenharmony_ci                </listitem>
10902f4aeb0Sopenharmony_ci            </varlistentry>
11002f4aeb0Sopenharmony_ci        </variablelist>
11102f4aeb0Sopenharmony_ci        <para>
11202f4aeb0Sopenharmony_ci            Any EGL rendering context that was created with respect to
11302f4aeb0Sopenharmony_ci            <parameter>config</parameter> can be used to render into the
11402f4aeb0Sopenharmony_ci            surface. Use
11502f4aeb0Sopenharmony_ci            <citerefentry><refentrytitle>eglMakeCurrent</refentrytitle></citerefentry>
11602f4aeb0Sopenharmony_ci            to attach an EGL rendering context to the surface.
11702f4aeb0Sopenharmony_ci        </para>
11802f4aeb0Sopenharmony_ci        <para>
11902f4aeb0Sopenharmony_ci            Use
12002f4aeb0Sopenharmony_ci            <citerefentry><refentrytitle>eglQuerySurface</refentrytitle></citerefentry>
12102f4aeb0Sopenharmony_ci            to retrieve the ID of <parameter>config</parameter>.
12202f4aeb0Sopenharmony_ci        </para>
12302f4aeb0Sopenharmony_ci        <para>
12402f4aeb0Sopenharmony_ci            Use <citerefentry><refentrytitle>eglDestroySurface</refentrytitle></citerefentry>
12502f4aeb0Sopenharmony_ci            to destroy the surface.
12602f4aeb0Sopenharmony_ci        </para>
12702f4aeb0Sopenharmony_ci    </refsect1>
12802f4aeb0Sopenharmony_ci    <refsect1 id="notes"><title>Notes</title>
12902f4aeb0Sopenharmony_ci        <para>
13002f4aeb0Sopenharmony_ci            The <constant>EGL_MATCH_NATIVE_PIXMAP</constant> attribute
13102f4aeb0Sopenharmony_ci            of
13202f4aeb0Sopenharmony_ci            <citerefentry><refentrytitle>eglChooseConfig</refentrytitle></citerefentry>
13302f4aeb0Sopenharmony_ci            can be used to select a frame buffer configuration matching
13402f4aeb0Sopenharmony_ci            a specified native pixmap.
13502f4aeb0Sopenharmony_ci        </para>
13602f4aeb0Sopenharmony_ci        <para>
13702f4aeb0Sopenharmony_ci            Attributes
13802f4aeb0Sopenharmony_ci            <constant>EGL_VG_ALPHA_FORMAT</constant> and
13902f4aeb0Sopenharmony_ci            <constant>EGL_VG_COLORSPACE</constant>, and the
14002f4aeb0Sopenharmony_ci            corresponding attribute values, are supported only if the
14102f4aeb0Sopenharmony_ci            EGL version is 1.2 or greater.
14202f4aeb0Sopenharmony_ci        </para>
14302f4aeb0Sopenharmony_ci        <!-- Might want to mention aliasing of EGL_VG_* -> EGL_* that occurred in EGL 1.3 -->
14402f4aeb0Sopenharmony_ci        <para>
14502f4aeb0Sopenharmony_ci            The <constant>EGL_VG_ALPHA_FORMAT</constant> and
14602f4aeb0Sopenharmony_ci            <constant>EGL_VG_COLORSPACE</constant> attributes are used
14702f4aeb0Sopenharmony_ci            only by OpenVG. EGL itself, and other client APIs such as
14802f4aeb0Sopenharmony_ci            OpenGL and OpenGL ES , do not distinguish multiple
14902f4aeb0Sopenharmony_ci            colorspace models. Refer to section 11.2 of the OpenVG 1.0
15002f4aeb0Sopenharmony_ci            specification for more information. The native window
15102f4aeb0Sopenharmony_ci            system's use and interpretation of alpha values is outside
15202f4aeb0Sopenharmony_ci            the scope of EGL, although the preferred behavior is for the
15302f4aeb0Sopenharmony_ci            window system to ignore the value of
15402f4aeb0Sopenharmony_ci            <constant>EGL_VG_ALPHA_FORMAT</constant>.
15502f4aeb0Sopenharmony_ci        </para>
15602f4aeb0Sopenharmony_ci    </refsect1>
15702f4aeb0Sopenharmony_ci    <refsect1 id="errors"><title>Errors</title>
15802f4aeb0Sopenharmony_ci        <para>
15902f4aeb0Sopenharmony_ci            <constant>EGL_NO_SURFACE</constant> is returned if creation of
16002f4aeb0Sopenharmony_ci            the context fails.
16102f4aeb0Sopenharmony_ci        </para>
16202f4aeb0Sopenharmony_ci        <para>
16302f4aeb0Sopenharmony_ci            <constant>EGL_BAD_DISPLAY</constant> is generated if
16402f4aeb0Sopenharmony_ci            <parameter>display</parameter> is not an EGL display connection.
16502f4aeb0Sopenharmony_ci        </para>
16602f4aeb0Sopenharmony_ci        <para>
16702f4aeb0Sopenharmony_ci            <constant>EGL_NOT_INITIALIZED</constant> is generated if
16802f4aeb0Sopenharmony_ci            <parameter>display</parameter> has not been initialized.
16902f4aeb0Sopenharmony_ci        </para>
17002f4aeb0Sopenharmony_ci        <para>
17102f4aeb0Sopenharmony_ci            <constant>EGL_BAD_CONFIG</constant> is generated if
17202f4aeb0Sopenharmony_ci            <parameter>config</parameter> is not an EGL config.
17302f4aeb0Sopenharmony_ci        </para>
17402f4aeb0Sopenharmony_ci        <para>
17502f4aeb0Sopenharmony_ci            <constant>EGL_BAD_NATIVE_PIXMAP</constant> may be generated if
17602f4aeb0Sopenharmony_ci            <parameter>native_pixmap</parameter> is not a valid native pixmap.
17702f4aeb0Sopenharmony_ci        </para>
17802f4aeb0Sopenharmony_ci        <para>
17902f4aeb0Sopenharmony_ci            <constant>EGL_BAD_ATTRIBUTE</constant> is generated if
18002f4aeb0Sopenharmony_ci            <parameter>attrib_list</parameter> contains an invalid pixmap attribute
18102f4aeb0Sopenharmony_ci            or if an attribute value is not recognized or out of range.
18202f4aeb0Sopenharmony_ci        </para>
18302f4aeb0Sopenharmony_ci        <para>
18402f4aeb0Sopenharmony_ci            <constant>EGL_BAD_ALLOC</constant> is generated if there are not
18502f4aeb0Sopenharmony_ci            enough resources to allocate the new surface.
18602f4aeb0Sopenharmony_ci        </para>
18702f4aeb0Sopenharmony_ci        <para>
18802f4aeb0Sopenharmony_ci            <constant>EGL_BAD_MATCH</constant> is generated if the attributes of
18902f4aeb0Sopenharmony_ci            <parameter>native_pixmap</parameter> do not correspond to
19002f4aeb0Sopenharmony_ci            <parameter>config</parameter> or if
19102f4aeb0Sopenharmony_ci            <parameter>config</parameter> does not support rendering to pixmaps
19202f4aeb0Sopenharmony_ci            (the <constant>EGL_SURFACE_TYPE</constant> attribute does not contain
19302f4aeb0Sopenharmony_ci            <constant>EGL_PIXMAP_BIT</constant>).
19402f4aeb0Sopenharmony_ci        </para>
19502f4aeb0Sopenharmony_ci        <para>
19602f4aeb0Sopenharmony_ci            <constant>EGL_BAD_MATCH</constant> is generated if
19702f4aeb0Sopenharmony_ci            <parameter>config</parameter> does not support the specified
19802f4aeb0Sopenharmony_ci            OpenVG alpha format attribute (the value of
19902f4aeb0Sopenharmony_ci            <constant>EGL_VG_ALPHA_FORMAT</constant> is
20002f4aeb0Sopenharmony_ci            <constant>EGL_VG_ALPHA_FORMAT_PRE</constant> and the
20102f4aeb0Sopenharmony_ci            <constant>EGL_VG_ALPHA_FORMAT_PRE_BIT</constant> is not set
20202f4aeb0Sopenharmony_ci            in the <constant>EGL_SURFACE_TYPE</constant> attribute of
20302f4aeb0Sopenharmony_ci            <parameter>config</parameter>) or colorspace attribute (the
20402f4aeb0Sopenharmony_ci            value of <constant>EGL_VG_COLORSPACE</constant> is
20502f4aeb0Sopenharmony_ci            <constant>EGL_VG_COLORSPACE_LINEAR</constant> and the
20602f4aeb0Sopenharmony_ci            <constant>EGL_VG_COLORSPACE_LINEAR_IT</constant> is not set
20702f4aeb0Sopenharmony_ci            in the <constant>EGL_SURFACE_TYPE</constant> attribute of
20802f4aeb0Sopenharmony_ci            <parameter>config</parameter>).
20902f4aeb0Sopenharmony_ci        </para>
21002f4aeb0Sopenharmony_ci    </refsect1>
21102f4aeb0Sopenharmony_ci    <refsect1 id="seealso"><title>See Also</title>
21202f4aeb0Sopenharmony_ci        <para>
21302f4aeb0Sopenharmony_ci            <citerefentry><refentrytitle>eglDestroySurface</refentrytitle></citerefentry>,
21402f4aeb0Sopenharmony_ci            <citerefentry><refentrytitle>eglChooseConfig</refentrytitle></citerefentry>,
21502f4aeb0Sopenharmony_ci            <citerefentry><refentrytitle>eglGetConfigs</refentrytitle></citerefentry>,
21602f4aeb0Sopenharmony_ci            <citerefentry><refentrytitle>eglMakeCurrent</refentrytitle></citerefentry>,
21702f4aeb0Sopenharmony_ci            <citerefentry><refentrytitle>eglQuerySurface</refentrytitle></citerefentry>
21802f4aeb0Sopenharmony_ci        </para>
21902f4aeb0Sopenharmony_ci    </refsect1>
22002f4aeb0Sopenharmony_ci    <refsect3 id="Copyright"><title></title>
22102f4aeb0Sopenharmony_ci        <!-- Content included from copyright.inc.xsl -->
22202f4aeb0Sopenharmony_ci        <imageobject>
22302f4aeb0Sopenharmony_ci                <imagedata fileref="KhronosLogo.jpg" format="jpg" />
22402f4aeb0Sopenharmony_ci        </imageobject>
22502f4aeb0Sopenharmony_ci        <para />
22602f4aeb0Sopenharmony_ci    </refsect3>
22702f4aeb0Sopenharmony_ci</refentry>
228