cex100: Add an API to configure the GDL plane to use

Intel CE3100 and CE4100 have several planes (framebuffers) and a
hardware blender to blend the planes togeteher to produce the final
image.

clutter_cex100_set_plane() lets you configure which framebuffer clutter
will use for its rendering.
This commit is contained in:
Damien Lespiau 2010-08-28 10:43:39 +01:00
parent 70dc3ecbd6
commit 01fcd11efd
9 changed files with 114 additions and 1 deletions

1
.gitignore vendored
View File

@ -27,6 +27,7 @@ stamp-marshal
/clutter/cogl/cogl/driver/gles/cogl-defines.h
/clutter/cogl/cogl/driver/gles/cogl-fixed-vertex-shader.[ch]
/clutter/cogl/cogl/driver/gles/cogl-fixed-fragment-shader.[ch]
/clutter/egl/clutter-cex100.h
/clutter/x11/clutter-x11-enum-types.[ch]
/clutter/json/*.gir
/clutter/cally/cally*.pc

View File

@ -42,4 +42,5 @@ endif
if SUPPORT_CEX100
libclutter_egl_la_SOURCES += clutter-backend-cex100.c clutter-backend-cex100.h
libclutterinclude_HEADERS += clutter-cex100.h
endif

View File

@ -35,6 +35,7 @@
#include "clutter-main.h"
#include "clutter-backend-cex100.h"
#include "clutter-cex100.h"
static gdl_plane_id_t gdl_plane = GDL_PLANE_ID_UPP_C;
@ -42,6 +43,30 @@ G_DEFINE_TYPE (ClutterBackendCex100,
clutter_backend_cex100,
CLUTTER_TYPE_BACKEND_EGL)
#ifdef CLUTTER_ENABLE_DEBUG
static const gchar *
gdl_get_plane_name (gdl_plane_id_t plane)
{
switch (plane)
{
case GDL_PLANE_ID_UPP_A:
return "UPP_A";
case GDL_PLANE_ID_UPP_B:
return "UPP_B";
case GDL_PLANE_ID_UPP_C:
return "UPP_C";
case GDL_PLANE_ID_UPP_D:
return "UPP_D";
case GDL_PLANE_ID_UPP_E:
return "UPP_E";
default:
g_assert_not_reached ();
}
return NULL; /* never reached */
}
#endif
static gboolean
gdl_plane_init (gdl_display_id_t dpy,
gdl_plane_id_t plane,
@ -141,6 +166,8 @@ clutter_backend_cex100_create_context (ClutterBackend *backend,
if (backend_egl->egl_context != EGL_NO_CONTEXT)
return TRUE;
CLUTTER_NOTE (BACKEND, "Using the %s plane", gdl_get_plane_name (gdl_plane));
/* Start by initializing the GDL plane */
if (!gdl_plane_init (GDL_DISPLAY_ID_0, gdl_plane, GDL_PF_ARGB_32))
{
@ -330,3 +357,11 @@ _clutter_backend_impl_get_type (void)
{
return clutter_backend_cex100_get_type ();
}
void
clutter_cex100_set_plane (gdl_plane_id_t plane)
{
g_return_if_fail (plane >= GDL_PLANE_ID_UPP_A && plane <= GDL_PLANE_ID_UPP_E);
gdl_plane = plane;
}

View File

@ -0,0 +1,64 @@
/*
* Clutter.
*
* An OpenGL based 'interactive canvas' library.
*
* Copyright (C) 2010 Intel Corporation
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
* Authors:
* Damien Lespiau <damien.lespiau@intel.com>
*/
/**
* SECTION:clutter-cex100
* @short_description: Intel CE3100, CE4100 Specific API
*
* The CEX100 backend for Clutter provides some Intel CE3100/CE4100
* specific API
*
* You need to include
* <filename class="headerfile">&lt;clutter/egl/clutter-cex100.h&gt;</filename>
* to have access to the functions documented here.
*/
#ifndef __CLUTTER_CEX100_H__
#define __CLUTTER_CEX100_H__
#include <glib.h>
#include <@CLUTTER_CEX100_LIBGDL_PREFIX@libgdl.h>
G_BEGIN_DECLS
/**
* clutter_cex100_set_plane:
* @plane: a GDL plane
*
* Intel CE3100 and CE4100 have several planes (frame buffers) and a
* hardware blender to blend the planes togeteher and produce the final
* image.
*
* clutter_cex100_set_plane() let's you configure the GDL plane where
* the stage will be drawn. By default Clutter will pick UPP_C
* (GDL_PLANE_ID_UPP_C).
*
* <note>This function has to be called before clutter_init()</note>
*/
void clutter_cex100_set_plane (gdl_plane_id_t plane);
G_END_DECLS
#endif /* __CLUTTER_CEX100_H__ */

View File

@ -276,8 +276,10 @@ AS_CASE([$CLUTTER_FLAVOUR],
[
FLAVOUR_CFLAGS="-I/usr/include/CE4100"
found_gdl=yes
CLUTTER_CEX100_LIBGDL_PREFIX=CE4100/
])
)
AC_SUBST(CLUTTER_CEX100_LIBGDL_PREFIX)
AS_IF([test x"$found_gdl" = "xno"],
AC_MSG_ERROR([libgdl.h not found]))
@ -1113,6 +1115,7 @@ AC_CONFIG_FILES([
clutter/x11/clutter-x11.pc
clutter/glx/Makefile
clutter/egl/Makefile
clutter/egl/clutter-cex100.h
clutter/fruity/Makefile
clutter/osx/Makefile
clutter/win32/Makefile

View File

@ -53,6 +53,7 @@ HFILE_GLOB=$(top_srcdir)/clutter/*.h \
$(top_srcdir)/clutter/x11/clutter-x11-texture-pixmap.h \
$(top_srcdir)/clutter/glx/clutter-glx-texture-pixmap.h \
$(top_srcdir)/clutter/egl/clutter-egl.h \
$(top_srcdir)/clutter/egl/clutter-cex100.h \
$(top_srcdir)/clutter/win32/clutter-win32.h
CFILE_GLOB=$(top_srcdir)/clutter/*.c \
$(top_srcdir)/clutter/x11/*.c \
@ -96,6 +97,7 @@ EXTRA_HFILES=\
$(top_srcdir)/clutter/x11/clutter-x11-texture-pixmap.h \
$(top_srcdir)/clutter/glx/clutter-glx-texture-pixmap.h \
$(top_srcdir)/clutter/egl/clutter-egl.h \
$(top_srcdir)/clutter/egl/clutter-cex100.h \
$(top_srcdir)/clutter/win32/clutter-win32.h
# Images to copy into HTML directory.

View File

@ -141,7 +141,7 @@
</varlistentry>
<varlistentry>
<term>--with-flavour=[glx/eglx/eglnative/win32/osx/fruity]</term>
<term>--with-flavour=[glx/eglx/eglnative/win32/osx/fruity/cex100]</term>
<listitem>
<para>Select the Clutter backend; default=glx.
</para>

View File

@ -209,6 +209,7 @@
<xi:include href="xml/clutter-glx.xml"/>
<xi:include href="xml/clutter-win32.xml"/>
<xi:include href="xml/clutter-egl.xml"/>
<xi:include href="xml/clutter-cex100.xml"/>
</part>
<part id="additionaldocs">

View File

@ -1835,6 +1835,12 @@ clutter_egl_display
clutter_eglx_display
</SECTION>
<SECTION>
<TITLE>Intel CE3100, CE4100 Specific Support</TITLE>
<FILE>clutter-cex100</FILE>
clutter_cex100_set_plane
</SECTION>
<SECTION>
<TITLE>Stage Manager</TITLE>
<FILE>clutter-stage-manager</FILE>