[clutter/clutter-1.18] eglnative: Add clutter-stage-window implementation



commit e4497baaf02cbcc0acf345ad97795831f947de53
Author: Adel Gadllah <adel gadllah gmail com>
Date:   Fri Mar 14 14:18:33 2014 +0100

    eglnative: Add clutter-stage-window implementation
    
    Add a ClutterStageEglNative implemennation that implements
    can_clip_redraws so that clipped redraws can work
    on eglnative.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=726341

 clutter/Makefile.am                     |    4 +-
 clutter/egl/clutter-backend-eglnative.c |    4 +-
 clutter/egl/clutter-stage-eglnative.c   |   70 +++++++++++++++++++++++++++++++
 clutter/egl/clutter-stage-eglnative.h   |   59 ++++++++++++++++++++++++++
 4 files changed, 134 insertions(+), 3 deletions(-)
---
diff --git a/clutter/Makefile.am b/clutter/Makefile.am
index a045be3..fbea892 100644
--- a/clutter/Makefile.am
+++ b/clutter/Makefile.am
@@ -644,8 +644,8 @@ egl_source_h = \
        $(srcdir)/egl/clutter-egl.h             \
        $(NULL)
 
-egl_source_h_priv = $(srcdir)/egl/clutter-backend-eglnative.h
-egl_source_c = $(srcdir)/egl/clutter-backend-eglnative.c
+egl_source_h_priv = $(srcdir)/egl/clutter-backend-eglnative.h $(srcdir)/egl/clutter-stage-eglnative.h
+egl_source_c = $(srcdir)/egl/clutter-backend-eglnative.c $(srcdir)/egl/clutter-stage-eglnative.c
 
 # Wayland backend rules
 if SUPPORT_WAYLAND
diff --git a/clutter/egl/clutter-backend-eglnative.c b/clutter/egl/clutter-backend-eglnative.c
index a99d374..1c0aee8 100644
--- a/clutter/egl/clutter-backend-eglnative.c
+++ b/clutter/egl/clutter-backend-eglnative.c
@@ -53,6 +53,8 @@
 #include "clutter-egl.h"
 #endif
 
+#include "clutter-stage-eglnative.h"
+
 #define clutter_backend_egl_native_get_type     _clutter_backend_egl_native_get_type
 
 G_DEFINE_TYPE (ClutterBackendEglNative, clutter_backend_egl_native, CLUTTER_TYPE_BACKEND);
@@ -79,7 +81,7 @@ clutter_backend_egl_native_class_init (ClutterBackendEglNativeClass *klass)
 
   gobject_class->dispose = clutter_backend_egl_native_dispose;
 
-  backend_class->stage_window_type = CLUTTER_TYPE_STAGE_COGL;
+  backend_class->stage_window_type = CLUTTER_TYPE_STAGE_EGL_NATIVE;
 }
 
 static void
diff --git a/clutter/egl/clutter-stage-eglnative.c b/clutter/egl/clutter-stage-eglnative.c
new file mode 100644
index 0000000..d7484bb
--- /dev/null
+++ b/clutter/egl/clutter-stage-eglnative.c
@@ -0,0 +1,70 @@
+/*
+ * 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:
+ *  Adel Gadllah
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <glib.h>
+
+#include "clutter-stage-window.h"
+#include "clutter-stage-private.h"
+#include "clutter-stage-eglnative.h"
+#include <cogl/cogl.h>
+
+static ClutterStageWindowIface *clutter_stage_window_parent_iface = NULL;
+
+static void clutter_stage_window_iface_init (ClutterStageWindowIface *iface);
+
+#define clutter_stage_eglnative_get_type _clutter_stage_eglnative_get_type
+
+G_DEFINE_TYPE_WITH_CODE (ClutterStageEglNative,
+                         clutter_stage_eglnative,
+                         CLUTTER_TYPE_STAGE_COGL,
+                         G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_STAGE_WINDOW,
+                                                clutter_stage_window_iface_init));
+
+static gboolean
+clutter_stage_eglnative_can_clip_redraws (ClutterStageWindow *stage_window)
+{
+  return TRUE;
+}
+
+static void
+clutter_stage_eglnative_class_init (ClutterStageEglNativeClass *klass)
+{
+}
+
+static void
+clutter_stage_eglnative_init (ClutterStageEglNative *stage_eglnative)
+{
+}
+
+static void
+clutter_stage_window_iface_init (ClutterStageWindowIface *iface)
+{
+  clutter_stage_window_parent_iface = g_type_interface_peek_parent (iface);
+
+  iface->can_clip_redraws = clutter_stage_eglnative_can_clip_redraws;
+}
diff --git a/clutter/egl/clutter-stage-eglnative.h b/clutter/egl/clutter-stage-eglnative.h
new file mode 100644
index 0000000..cc64390
--- /dev/null
+++ b/clutter/egl/clutter-stage-eglnative.h
@@ -0,0 +1,59 @@
+/*
+ * Clutter.
+ *
+ * An OpenGL based 'interactive canvas' library.
+ *
+ * Copyright (C) 2010,2011  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:
+ *  Adel Gadllah
+ */
+
+#ifndef __CLUTTER_STAGE_EGL_NATIVE_H__
+#define __CLUTTER_STAGE_EGL_NATIVE_H__
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <glib-object.h>
+#include <clutter/clutter-stage.h>
+
+#include "cogl/clutter-stage-cogl.h"
+
+#define CLUTTER_TYPE_STAGE_EGL_NATIVE                  (_clutter_stage_eglnative_get_type ())
+#define CLUTTER_STAGE_EGL_NATIVE(obj)                  (G_TYPE_CHECK_INSTANCE_CAST ((obj), 
CLUTTER_TYPE_STAGE_EGL_NATIVE, ClutterStageEglNative))
+#define CLUTTER_IS_STAGE_EGL_NATIVE(obj)               (G_TYPE_CHECK_INSTANCE_TYPE ((obj), 
CLUTTER_TYPE_STAGE_EGL_NATIVE))
+#define CLUTTER_STAGE_EGL_NATIVE_CLASS(klass)          (G_TYPE_CHECK_CLASS_CAST ((klass), 
CLUTTER_TYPE_STAGE_EGL_NATIVE, ClutterStageEglNativeClass))
+#define CLUTTER_IS_STAGE_EGL_NATIVE_CLASS(klass)       (G_TYPE_CHECK_CLASS_TYPE ((klass), 
CLUTTER_TYPE_STAGE_EGL_NATIVE))
+#define CLUTTER_STAGE_EGL_NATIVE_GET_CLASS(obj)        (G_TYPE_INSTANCE_GET_CLASS ((obj), 
CLUTTER_TYPE_STAGE_EGL_NATIVE, ClutterStageEglNativeClass))
+
+typedef struct _ClutterStageEglNative         ClutterStageEglNative;
+typedef struct _ClutterStageEglNativeClass    ClutterStageEglNativeClass;
+
+struct _ClutterStageEglNative
+{
+  ClutterStageCogl parent_instance;
+};
+
+struct _ClutterStageEglNativeClass
+{
+  ClutterStageCoglClass parent_class;
+};
+
+GType _clutter_stage_eglnative_get_type (void) G_GNUC_CONST;
+
+#endif /* __CLUTTER_STAGE_EGL_NATIVE_H__ */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]