diff options
| -rw-r--r-- | meta/recipes-gnome/gtk+/gtk+3.inc | 7 | ||||
| -rw-r--r-- | meta/recipes-gnome/gtk+/gtk+3/0001-Add-disable-opengl-configure-option.patch | 965 | ||||
| -rw-r--r-- | meta/recipes-gnome/gtk+/gtk+3_3.18.8.bb | 1 |
3 files changed, 972 insertions, 1 deletions
diff --git a/meta/recipes-gnome/gtk+/gtk+3.inc b/meta/recipes-gnome/gtk+/gtk+3.inc index 12fcaba929..959fb441b2 100644 --- a/meta/recipes-gnome/gtk+/gtk+3.inc +++ b/meta/recipes-gnome/gtk+/gtk+3.inc | |||
| @@ -6,7 +6,7 @@ BUGTRACKER = "https://bugzilla.gnome.org/" | |||
| 6 | SECTION = "libs" | 6 | SECTION = "libs" |
| 7 | 7 | ||
| 8 | DEPENDS = "glib-2.0 cairo pango atk jpeg libpng gdk-pixbuf \ | 8 | DEPENDS = "glib-2.0 cairo pango atk jpeg libpng gdk-pixbuf \ |
| 9 | docbook-utils-native gdk-pixbuf-native libepoxy" | 9 | docbook-utils-native gdk-pixbuf-native" |
| 10 | 10 | ||
| 11 | LICENSE = "LGPLv2 & LGPLv2+ & LGPLv2.1+" | 11 | LICENSE = "LGPLv2 & LGPLv2+ & LGPLv2.1+" |
| 12 | 12 | ||
| @@ -21,6 +21,8 @@ do_configure_prepend() { | |||
| 21 | # Do this because the configure script is running ./libtool directly | 21 | # Do this because the configure script is running ./libtool directly |
| 22 | rm -f libtool | 22 | rm -f libtool |
| 23 | ln -s ${TARGET_PREFIX}libtool libtool | 23 | ln -s ${TARGET_PREFIX}libtool libtool |
| 24 | #delete a file that will get confused with generated one in ${B} | ||
| 25 | rm -f ${S}/gtk/gtktypefuncs.c | ||
| 24 | } | 26 | } |
| 25 | 27 | ||
| 26 | EXTRA_OECONF += " \ | 28 | EXTRA_OECONF += " \ |
| @@ -36,10 +38,13 @@ do_compile_prepend() { | |||
| 36 | } | 38 | } |
| 37 | 39 | ||
| 38 | PACKAGECONFIG ??= "${@bb.utils.contains("DISTRO_FEATURES", "x11", "x11", "", d)} \ | 40 | PACKAGECONFIG ??= "${@bb.utils.contains("DISTRO_FEATURES", "x11", "x11", "", d)} \ |
| 41 | ${@bb.utils.contains("DISTRO_FEATURES", "opengl", "opengl", "", d)} \ | ||
| 39 | ${@bb.utils.contains("DISTRO_FEATURES", "opengl x11", "glx", "", d)} \ | 42 | ${@bb.utils.contains("DISTRO_FEATURES", "opengl x11", "glx", "", d)} \ |
| 40 | ${@bb.utils.contains("DISTRO_FEATURES", "wayland", "wayland", "", d)}" | 43 | ${@bb.utils.contains("DISTRO_FEATURES", "wayland", "wayland", "", d)}" |
| 41 | 44 | ||
| 42 | PACKAGECONFIG[x11] = "--enable-x11-backend,--disable-x11-backend,at-spi2-atk fontconfig libx11 libxext libxcursor libxi libxdamage libxrandr libxrender libxcomposite libxfixes" | 45 | PACKAGECONFIG[x11] = "--enable-x11-backend,--disable-x11-backend,at-spi2-atk fontconfig libx11 libxext libxcursor libxi libxdamage libxrandr libxrender libxcomposite libxfixes" |
| 46 | # this is provided by oe-core patch that removes epoxy/gl dependency from a X11 build | ||
| 47 | PACKAGECONFIG[opengl] = "--enable-opengl,--disable-opengl,libepoxy" | ||
| 43 | PACKAGECONFIG[glx] = "--enable-glx,--disable-glx,,libgl" | 48 | PACKAGECONFIG[glx] = "--enable-glx,--disable-glx,,libgl" |
| 44 | PACKAGECONFIG[wayland] = "--enable-wayland-backend,--disable-wayland-backend,wayland libxkbcommon virtual/mesa wayland-native" | 49 | PACKAGECONFIG[wayland] = "--enable-wayland-backend,--disable-wayland-backend,wayland libxkbcommon virtual/mesa wayland-native" |
| 45 | 50 | ||
diff --git a/meta/recipes-gnome/gtk+/gtk+3/0001-Add-disable-opengl-configure-option.patch b/meta/recipes-gnome/gtk+/gtk+3/0001-Add-disable-opengl-configure-option.patch new file mode 100644 index 0000000000..a963334d94 --- /dev/null +++ b/meta/recipes-gnome/gtk+/gtk+3/0001-Add-disable-opengl-configure-option.patch | |||
| @@ -0,0 +1,965 @@ | |||
| 1 | From c77afa19881d955d759879aeae8bbd88613dd4fe Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Jussi Kukkonen <jussi.kukkonen@intel.com> | ||
| 3 | Date: Thu, 16 Jun 2016 15:11:34 +0300 | ||
| 4 | Subject: [PATCH] Add --disable-opengl configure option | ||
| 5 | |||
| 6 | --disable-opengl will remove the dependency on libepoxy and on the | ||
| 7 | OpenGL APIs. This is useful for those who want to keep using gtk+3 | ||
| 8 | without the "opengl" distro feature. | ||
| 9 | |||
| 10 | GtkGLArea is still part of the API (it just doesn't work) even when | ||
| 11 | OpenGL is disabled. GdkX11GLContext was removed from the Gtk API | ||
| 12 | completely: that object exposes GL API elements so it had to be at | ||
| 13 | the very least modified. | ||
| 14 | |||
| 15 | The patch is _not_ great from a maintenance point of view and | ||
| 16 | modifying the library API is also a fairly nasty thing to do. | ||
| 17 | Long-term it would be good to find an alternative solution to this | ||
| 18 | (maybe a no-op backend for libepoxy?) | ||
| 19 | |||
| 20 | Upstream-Status: Inappropriate [Evil eye expected from upstream] | ||
| 21 | Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> | ||
| 22 | --- | ||
| 23 | configure.ac | 13 +++++++-- | ||
| 24 | demos/gtk-demo/glarea.c | 13 +++++++++ | ||
| 25 | docs/tools/Makefile.am | 9 ++++-- | ||
| 26 | docs/tools/widgets.c | 4 ++- | ||
| 27 | gdk/gdkdisplay.c | 4 ++- | ||
| 28 | gdk/gdkgl.c | 10 +++++++ | ||
| 29 | gdk/gdkglcontext.c | 6 ++++ | ||
| 30 | gdk/gdkwindow.c | 14 +++++++++- | ||
| 31 | gdk/x11/Makefile.am | 28 ++++++++++++++++--- | ||
| 32 | gdk/x11/gdkdisplay-x11.c | 6 ++-- | ||
| 33 | gdk/x11/gdkscreen-x11.c | 5 ++++ | ||
| 34 | gdk/x11/gdkwindow-x11.c | 4 +++ | ||
| 35 | gdk/x11/gdkx-autocleanups.h | 2 ++ | ||
| 36 | gdk/x11/gdkx-with-gl-context.h | 59 +++++++++++++++++++++++++++++++++++++++ | ||
| 37 | gdk/x11/gdkx-without-gl-context.h | 58 ++++++++++++++++++++++++++++++++++++++ | ||
| 38 | gdk/x11/gdkx.h | 59 --------------------------------------- | ||
| 39 | gtk/Makefile.am | 3 +- | ||
| 40 | gtk/gtkglarea.c | 20 ++++++++++++- | ||
| 41 | gtk/inspector/general.c | 6 ++++ | ||
| 42 | tests/Makefile.am | 10 +++++-- | ||
| 43 | testsuite/gtk/objects-finalize.c | 2 ++ | ||
| 44 | 21 files changed, 257 insertions(+), 78 deletions(-) | ||
| 45 | create mode 100644 gdk/x11/gdkx-with-gl-context.h | ||
| 46 | create mode 100644 gdk/x11/gdkx-without-gl-context.h | ||
| 47 | delete mode 100644 gdk/x11/gdkx.h | ||
| 48 | |||
| 49 | diff --git a/configure.ac b/configure.ac | ||
| 50 | index c280543..32da151 100644 | ||
| 51 | --- a/configure.ac | ||
| 52 | +++ b/configure.ac | ||
| 53 | @@ -340,6 +340,15 @@ AC_ARG_ENABLE(mir-backend, | ||
| 54 | [enable the Mir gdk backend])], | ||
| 55 | [backend_set=yes]) | ||
| 56 | |||
| 57 | +AC_ARG_ENABLE(opengl, | ||
| 58 | + [AS_HELP_STRING([--enable-opengl], | ||
| 59 | + [When enabled, Gtk+ will use libepoxy and exposes GtkGLArea widget ])]) | ||
| 60 | +AS_IF([test "x$enable_opengl" != "xno"], [ | ||
| 61 | + AC_DEFINE([HAVE_OPENGL], [1], [libepoxy and opengl APIs are available at buildtime]) | ||
| 62 | + EPOXY_PACKAGES="epoxy >= epoxy_required_version" | ||
| 63 | +]) | ||
| 64 | +AM_CONDITIONAL([HAVE_OPENGL],[test "x$enable_opengl" != "xno"]) | ||
| 65 | + | ||
| 66 | AC_ARG_ENABLE(glx, | ||
| 67 | [AS_HELP_STRING([--enable-glx], | ||
| 68 | [When enabled Gdk will try to initialize GLX])]) | ||
| 69 | @@ -1330,7 +1339,7 @@ CFLAGS="$saved_cflags" | ||
| 70 | LDFLAGS="$saved_ldflags" | ||
| 71 | |||
| 72 | GDK_PACKAGES="$PANGO_PACKAGES gdk-pixbuf-2.0 >= gdk_pixbuf_required_version cairo >= cairo_required_version cairo-gobject >= cairo_required_version" | ||
| 73 | -GDK_PRIVATE_PACKAGES="$GDK_GIO_PACKAGE $X_PACKAGES $WAYLAND_PACKAGES $MIR_PACKAGES $cairo_backends epoxy >= epoxy_required_version" | ||
| 74 | +GDK_PRIVATE_PACKAGES="$GDK_GIO_PACKAGE $X_PACKAGES $WAYLAND_PACKAGES $MIR_PACKAGES $cairo_backends $EPOXY_PACKAGES" | ||
| 75 | |||
| 76 | PKG_CHECK_MODULES(GDK_DEP, $GDK_PACKAGES $GDK_PRIVATE_PACKAGES) | ||
| 77 | GDK_DEP_LIBS="$GDK_EXTRA_LIBS $GDK_DEP_LIBS $MATH_LIB" | ||
| 78 | @@ -1364,7 +1373,7 @@ fi | ||
| 79 | PKG_CHECK_MODULES(ATK, $ATK_PACKAGES) | ||
| 80 | |||
| 81 | GTK_PACKAGES="atk >= atk_required_version cairo >= cairo_required_version cairo-gobject >= cairo_required_version gdk-pixbuf-2.0 >= gdk_pixbuf_required_version gio-2.0 >= glib_required_version" | ||
| 82 | -GTK_PRIVATE_PACKAGES="$ATK_PACKAGES $WAYLAND_PACKAGES $MIR_PACKAGES epoxy >= epoxy_required_version" | ||
| 83 | +GTK_PRIVATE_PACKAGES="$ATK_PACKAGES $WAYLAND_PACKAGES $MIR_PACKAGES $EPOXY_PACKAGES" | ||
| 84 | if test "x$enable_x11_backend" = xyes -o "x$enable_wayland_backend" = xyes; then | ||
| 85 | GTK_PRIVATE_PACKAGES="$GTK_PRIVATE_PACKAGES pangoft2" | ||
| 86 | fi | ||
| 87 | diff --git a/demos/gtk-demo/glarea.c b/demos/gtk-demo/glarea.c | ||
| 88 | index c267706..b3bac86 100644 | ||
| 89 | --- a/demos/gtk-demo/glarea.c | ||
| 90 | +++ b/demos/gtk-demo/glarea.c | ||
| 91 | @@ -5,7 +5,9 @@ | ||
| 92 | |||
| 93 | #include <math.h> | ||
| 94 | #include <gtk/gtk.h> | ||
| 95 | +#if HAVE_OPENGL | ||
| 96 | #include <epoxy/gl.h> | ||
| 97 | +#endif | ||
| 98 | |||
| 99 | static GtkWidget *demo_window = NULL; | ||
| 100 | |||
| 101 | @@ -23,6 +25,8 @@ enum { | ||
| 102 | /* Rotation angles on each axis */ | ||
| 103 | static float rotation_angles[N_AXIS] = { 0.0 }; | ||
| 104 | |||
| 105 | +#ifdef HAVE_OPENGL | ||
| 106 | + | ||
| 107 | /* The object we are drawing */ | ||
| 108 | static const GLfloat vertex_data[] = { | ||
| 109 | 0.f, 0.5f, 0.f, 1.f, | ||
| 110 | @@ -213,6 +217,7 @@ compute_mvp (float *res, | ||
| 111 | static GLuint position_buffer; | ||
| 112 | static GLuint program; | ||
| 113 | static GLuint mvp_location; | ||
| 114 | +#endif | ||
| 115 | |||
| 116 | /* We need to set up our state when we realize the GtkGLArea widget */ | ||
| 117 | static void | ||
| 118 | @@ -223,8 +228,10 @@ realize (GtkWidget *widget) | ||
| 119 | if (gtk_gl_area_get_error (GTK_GL_AREA (widget)) != NULL) | ||
| 120 | return; | ||
| 121 | |||
| 122 | +#ifdef HAVE_OPENGL | ||
| 123 | init_buffers (&position_buffer, NULL); | ||
| 124 | init_shaders (&program, &mvp_location); | ||
| 125 | +#endif | ||
| 126 | } | ||
| 127 | |||
| 128 | /* We should tear down the state when unrealizing */ | ||
| 129 | @@ -236,10 +243,13 @@ unrealize (GtkWidget *widget) | ||
| 130 | if (gtk_gl_area_get_error (GTK_GL_AREA (widget)) != NULL) | ||
| 131 | return; | ||
| 132 | |||
| 133 | +#ifdef HAVE_OPENGL | ||
| 134 | glDeleteBuffers (1, &position_buffer); | ||
| 135 | glDeleteProgram (program); | ||
| 136 | +#endif | ||
| 137 | } | ||
| 138 | |||
| 139 | +#ifdef HAVE_OPENGL | ||
| 140 | static void | ||
| 141 | draw_triangle (void) | ||
| 142 | { | ||
| 143 | @@ -272,6 +282,7 @@ draw_triangle (void) | ||
| 144 | glBindBuffer (GL_ARRAY_BUFFER, 0); | ||
| 145 | glUseProgram (0); | ||
| 146 | } | ||
| 147 | +#endif | ||
| 148 | |||
| 149 | static gboolean | ||
| 150 | render (GtkGLArea *area, | ||
| 151 | @@ -280,6 +291,7 @@ render (GtkGLArea *area, | ||
| 152 | if (gtk_gl_area_get_error (area) != NULL) | ||
| 153 | return FALSE; | ||
| 154 | |||
| 155 | +#ifdef HAVE_OPENGL | ||
| 156 | /* Clear the viewport */ | ||
| 157 | glClearColor (0.5, 0.5, 0.5, 1.0); | ||
| 158 | glClear (GL_COLOR_BUFFER_BIT); | ||
| 159 | @@ -289,6 +301,7 @@ render (GtkGLArea *area, | ||
| 160 | |||
| 161 | /* Flush the contents of the pipeline */ | ||
| 162 | glFlush (); | ||
| 163 | +#endif | ||
| 164 | |||
| 165 | return TRUE; | ||
| 166 | } | ||
| 167 | diff --git a/docs/tools/Makefile.am b/docs/tools/Makefile.am | ||
| 168 | index 6a6d70f..5cdf312 100644 | ||
| 169 | --- a/docs/tools/Makefile.am | ||
| 170 | +++ b/docs/tools/Makefile.am | ||
| 171 | @@ -9,13 +9,18 @@ AM_CPPFLAGS = \ | ||
| 172 | $(GTK_DEBUG_FLAGS) \ | ||
| 173 | $(GTK_DEP_CFLAGS) | ||
| 174 | |||
| 175 | +if HAVE_OPENGL | ||
| 176 | +GEARS_LDADD = $(top_builddir)/tests/gtkgears.o | ||
| 177 | +endif | ||
| 178 | + | ||
| 179 | DEPS = \ | ||
| 180 | - $(top_builddir)/gtk/libgtk-3.la | ||
| 181 | + $(top_builddir)/gtk/libgtk-3.la \ | ||
| 182 | + $(GEARS_LDADD) | ||
| 183 | |||
| 184 | LDADDS = \ | ||
| 185 | $(top_builddir)/gtk/libgtk-3.la \ | ||
| 186 | $(top_builddir)/gdk/libgdk-3.la \ | ||
| 187 | - $(top_builddir)/tests/gtkgears.o \ | ||
| 188 | + $(GEARS_LDADD) \ | ||
| 189 | $(GTK_DEP_LIBS) \ | ||
| 190 | $(GDK_DEP_LIBS) \ | ||
| 191 | -lm | ||
| 192 | diff --git a/docs/tools/widgets.c b/docs/tools/widgets.c | ||
| 193 | index 932daf1..54239d6 100644 | ||
| 194 | --- a/docs/tools/widgets.c | ||
| 195 | +++ b/docs/tools/widgets.c | ||
| 196 | @@ -1526,9 +1526,11 @@ create_gl_area (void) | ||
| 197 | widget = gtk_frame_new (NULL); | ||
| 198 | gtk_frame_set_shadow_type (GTK_FRAME (widget), GTK_SHADOW_IN); | ||
| 199 | |||
| 200 | +#ifdef HAVE_OPENGL | ||
| 201 | gears = gtk_gears_new (); | ||
| 202 | gtk_container_add (GTK_CONTAINER (widget), gears); | ||
| 203 | - | ||
| 204 | +#endif | ||
| 205 | + | ||
| 206 | info = new_widget_info ("glarea", widget, MEDIUM); | ||
| 207 | |||
| 208 | return info; | ||
| 209 | diff --git a/gdk/gdkdisplay.c b/gdk/gdkdisplay.c | ||
| 210 | index 892d6a7..8323768 100644 | ||
| 211 | --- a/gdk/gdkdisplay.c | ||
| 212 | +++ b/gdk/gdkdisplay.c | ||
| 213 | @@ -2285,7 +2285,9 @@ gboolean | ||
| 214 | gdk_display_make_gl_context_current (GdkDisplay *display, | ||
| 215 | GdkGLContext *context) | ||
| 216 | { | ||
| 217 | - return GDK_DISPLAY_GET_CLASS (display)->make_gl_context_current (display, context); | ||
| 218 | + if (GDK_DISPLAY_GET_CLASS (display)->make_gl_context_current) | ||
| 219 | + return GDK_DISPLAY_GET_CLASS (display)->make_gl_context_current (display, context); | ||
| 220 | + return FALSE; | ||
| 221 | } | ||
| 222 | |||
| 223 | GdkRenderingMode | ||
| 224 | diff --git a/gdk/gdkgl.c b/gdk/gdkgl.c | ||
| 225 | index 85ce63d..d76e8dc 100644 | ||
| 226 | --- a/gdk/gdkgl.c | ||
| 227 | +++ b/gdk/gdkgl.c | ||
| 228 | @@ -22,7 +22,9 @@ | ||
| 229 | |||
| 230 | #include "gdkinternals.h" | ||
| 231 | |||
| 232 | +#ifdef HAVE_OPENGL | ||
| 233 | #include <epoxy/gl.h> | ||
| 234 | +#endif | ||
| 235 | #include <math.h> | ||
| 236 | #include <string.h> | ||
| 237 | |||
| 238 | @@ -36,6 +38,7 @@ gdk_cairo_surface_mark_as_direct (cairo_surface_t *surface, | ||
| 239 | g_object_ref (window), g_object_unref); | ||
| 240 | } | ||
| 241 | |||
| 242 | +#ifdef HAVE_OPENGL | ||
| 243 | static const char * | ||
| 244 | get_vertex_type_name (int type) | ||
| 245 | { | ||
| 246 | @@ -205,6 +208,7 @@ use_texture_rect_program (GdkGLContextPaintData *paint_data) | ||
| 247 | glUseProgram (paint_data->current_program->program); | ||
| 248 | } | ||
| 249 | } | ||
| 250 | +#endif | ||
| 251 | |||
| 252 | void | ||
| 253 | gdk_gl_texture_quads (GdkGLContext *paint_context, | ||
| 254 | @@ -212,6 +216,7 @@ gdk_gl_texture_quads (GdkGLContext *paint_context, | ||
| 255 | int n_quads, | ||
| 256 | GdkTexturedQuad *quads) | ||
| 257 | { | ||
| 258 | +#ifdef HAVE_OPENGL | ||
| 259 | GdkGLContextPaintData *paint_data = gdk_gl_context_get_paint_data (paint_context); | ||
| 260 | GdkGLContextProgram *program; | ||
| 261 | GdkWindow *window = gdk_gl_context_get_window (paint_context); | ||
| 262 | @@ -275,6 +280,7 @@ gdk_gl_texture_quads (GdkGLContext *paint_context, | ||
| 263 | |||
| 264 | glDisableVertexAttribArray (program->position_location); | ||
| 265 | glDisableVertexAttribArray (program->uv_location); | ||
| 266 | +#endif | ||
| 267 | } | ||
| 268 | |||
| 269 | /* x,y,width,height describes a rectangle in the gl render buffer | ||
| 270 | @@ -323,6 +329,7 @@ gdk_cairo_draw_from_gl (cairo_t *cr, | ||
| 271 | int width, | ||
| 272 | int height) | ||
| 273 | { | ||
| 274 | +#ifdef HAVE_OPENGL | ||
| 275 | GdkGLContext *paint_context; | ||
| 276 | cairo_surface_t *image; | ||
| 277 | cairo_matrix_t matrix; | ||
| 278 | @@ -643,6 +650,7 @@ gdk_cairo_draw_from_gl (cairo_t *cr, | ||
| 279 | if (clip_region) | ||
| 280 | cairo_region_destroy (clip_region); | ||
| 281 | |||
| 282 | +#endif | ||
| 283 | } | ||
| 284 | |||
| 285 | /* This is always called with the paint context current */ | ||
| 286 | @@ -650,6 +658,7 @@ void | ||
| 287 | gdk_gl_texture_from_surface (cairo_surface_t *surface, | ||
| 288 | cairo_region_t *region) | ||
| 289 | { | ||
| 290 | +#ifdef HAVE_OPENGL | ||
| 291 | GdkGLContext *paint_context; | ||
| 292 | cairo_surface_t *image; | ||
| 293 | double device_x_offset, device_y_offset; | ||
| 294 | @@ -750,4 +759,5 @@ gdk_gl_texture_from_surface (cairo_surface_t *surface, | ||
| 295 | |||
| 296 | glDisable (GL_SCISSOR_TEST); | ||
| 297 | glDeleteTextures (1, &texture_id); | ||
| 298 | +#endif | ||
| 299 | } | ||
| 300 | diff --git a/gdk/gdkglcontext.c b/gdk/gdkglcontext.c | ||
| 301 | index 4d71353..9bb55ef 100644 | ||
| 302 | --- a/gdk/gdkglcontext.c | ||
| 303 | +++ b/gdk/gdkglcontext.c | ||
| 304 | @@ -85,7 +85,9 @@ | ||
| 305 | #include "gdkintl.h" | ||
| 306 | #include "gdk-private.h" | ||
| 307 | |||
| 308 | +#ifdef HAVE_OPENGL | ||
| 309 | #include <epoxy/gl.h> | ||
| 310 | +#endif | ||
| 311 | |||
| 312 | typedef struct { | ||
| 313 | GdkDisplay *display; | ||
| 314 | @@ -238,6 +240,7 @@ gdk_gl_context_upload_texture (GdkGLContext *context, | ||
| 315 | int height, | ||
| 316 | guint texture_target) | ||
| 317 | { | ||
| 318 | +#ifdef HAVE_OPENGL | ||
| 319 | g_return_if_fail (GDK_IS_GL_CONTEXT (context)); | ||
| 320 | |||
| 321 | glPixelStorei (GL_UNPACK_ALIGNMENT, 4); | ||
| 322 | @@ -245,6 +248,7 @@ gdk_gl_context_upload_texture (GdkGLContext *context, | ||
| 323 | glTexImage2D (texture_target, 0, GL_RGBA, width, height, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, | ||
| 324 | cairo_image_surface_get_data (image_surface)); | ||
| 325 | glPixelStorei (GL_UNPACK_ROW_LENGTH, 0); | ||
| 326 | +#endif | ||
| 327 | } | ||
| 328 | |||
| 329 | static void | ||
| 330 | @@ -586,6 +590,7 @@ gdk_gl_context_realize (GdkGLContext *context, | ||
| 331 | static void | ||
| 332 | gdk_gl_context_check_extensions (GdkGLContext *context) | ||
| 333 | { | ||
| 334 | +#ifdef HAVE_OPENGL | ||
| 335 | GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context); | ||
| 336 | gboolean has_npot, has_texture_rectangle; | ||
| 337 | |||
| 338 | @@ -628,6 +633,7 @@ gdk_gl_context_check_extensions (GdkGLContext *context) | ||
| 339 | priv->use_texture_rectangle ? "yes" : "no")); | ||
| 340 | |||
| 341 | priv->extensions_checked = TRUE; | ||
| 342 | +#endif | ||
| 343 | } | ||
| 344 | |||
| 345 | /** | ||
| 346 | diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c | ||
| 347 | index c34c113..3025e96 100644 | ||
| 348 | --- a/gdk/gdkwindow.c | ||
| 349 | +++ b/gdk/gdkwindow.c | ||
| 350 | @@ -44,7 +44,9 @@ | ||
| 351 | |||
| 352 | #include <math.h> | ||
| 353 | |||
| 354 | +#ifdef HAVE_OPENGL | ||
| 355 | #include <epoxy/gl.h> | ||
| 356 | +#endif | ||
| 357 | |||
| 358 | /* for the use of round() */ | ||
| 359 | #include "fallback-c89.c" | ||
| 360 | @@ -1455,7 +1457,6 @@ gdk_window_new (GdkWindow *parent, | ||
| 361 | g_signal_connect (device_manager, "device-removed", | ||
| 362 | G_CALLBACK (device_removed_cb), window); | ||
| 363 | |||
| 364 | - | ||
| 365 | if ((_gdk_gl_flags & (GDK_GL_ALWAYS | GDK_GL_DISABLE)) == GDK_GL_ALWAYS) | ||
| 366 | { | ||
| 367 | GError *error = NULL; | ||
| 368 | @@ -2761,6 +2762,13 @@ gdk_window_get_paint_gl_context (GdkWindow *window, | ||
| 369 | { | ||
| 370 | GError *internal_error = NULL; | ||
| 371 | |||
| 372 | +#ifndef HAVE_OPENGL | ||
| 373 | + g_set_error_literal (error, GDK_GL_ERROR, | ||
| 374 | + GDK_GL_ERROR_NOT_AVAILABLE, | ||
| 375 | + _("GL support disabled with --disable-opengl")); | ||
| 376 | + return NULL; | ||
| 377 | +#endif | ||
| 378 | + | ||
| 379 | if (_gdk_gl_flags & GDK_GL_DISABLE) | ||
| 380 | { | ||
| 381 | g_set_error_literal (error, GDK_GL_ERROR, | ||
| 382 | @@ -2957,6 +2965,7 @@ gdk_window_begin_paint_region (GdkWindow *window, | ||
| 383 | } | ||
| 384 | else | ||
| 385 | { | ||
| 386 | +#ifdef HAVE_OPENGL | ||
| 387 | gdk_gl_context_make_current (context); | ||
| 388 | /* With gl we always need a surface to combine the gl | ||
| 389 | drawing with the native drawing. */ | ||
| 390 | @@ -2971,6 +2980,7 @@ gdk_window_begin_paint_region (GdkWindow *window, | ||
| 391 | glBlendFunc (GL_ONE, GL_ONE_MINUS_SRC_ALPHA); | ||
| 392 | |||
| 393 | glViewport (0, 0, ww, wh); | ||
| 394 | +#endif | ||
| 395 | } | ||
| 396 | } | ||
| 397 | |||
| 398 | @@ -3119,6 +3129,7 @@ gdk_window_end_paint (GdkWindow *window) | ||
| 399 | |||
| 400 | gdk_gl_context_make_current (window->gl_paint_context); | ||
| 401 | |||
| 402 | +#ifdef HAVE_OPENGL | ||
| 403 | if (!cairo_region_is_empty (opaque_region)) | ||
| 404 | gdk_gl_texture_from_surface (window->current_paint.surface, | ||
| 405 | opaque_region); | ||
| 406 | @@ -3129,6 +3140,7 @@ gdk_window_end_paint (GdkWindow *window) | ||
| 407 | window->current_paint.need_blend_region); | ||
| 408 | glDisable(GL_BLEND); | ||
| 409 | } | ||
| 410 | +#endif | ||
| 411 | |||
| 412 | cairo_region_destroy (opaque_region); | ||
| 413 | |||
| 414 | diff --git a/gdk/x11/Makefile.am b/gdk/x11/Makefile.am | ||
| 415 | index c488a31..d0aa7ce 100644 | ||
| 416 | --- a/gdk/x11/Makefile.am | ||
| 417 | +++ b/gdk/x11/Makefile.am | ||
| 418 | @@ -39,8 +39,6 @@ libgdk_x11_la_SOURCES = \ | ||
| 419 | gdkeventtranslator.c \ | ||
| 420 | gdkeventtranslator.h \ | ||
| 421 | gdkgeometry-x11.c \ | ||
| 422 | - gdkglcontext-x11.c \ | ||
| 423 | - gdkglcontext-x11.h \ | ||
| 424 | gdkkeys-x11.c \ | ||
| 425 | gdkmain-x11.c \ | ||
| 426 | gdkproperty-x11.c \ | ||
| 427 | @@ -53,14 +51,30 @@ libgdk_x11_la_SOURCES = \ | ||
| 428 | gdkwindow-x11.h \ | ||
| 429 | gdkxftdefaults.c \ | ||
| 430 | gdkxid.c \ | ||
| 431 | - gdkx.h \ | ||
| 432 | gdkprivate-x11.h \ | ||
| 433 | xsettings-client.h \ | ||
| 434 | xsettings-client.c | ||
| 435 | |||
| 436 | +if HAVE_OPENGL | ||
| 437 | +libgdk_x11_la_SOURCES += \ | ||
| 438 | + gdkglcontext-x11.c \ | ||
| 439 | + gdkglcontext-x11.h | ||
| 440 | +endif | ||
| 441 | + | ||
| 442 | libgdkinclude_HEADERS = \ | ||
| 443 | gdkx.h | ||
| 444 | |||
| 445 | +if HAVE_OPENGL | ||
| 446 | +GDKX_HEADER = gdkx-with-gl-context.h | ||
| 447 | +else | ||
| 448 | +GDKX_HEADER = gdkx-without-gl-context.h | ||
| 449 | +endif | ||
| 450 | + | ||
| 451 | +BUILT_SOURCES = gdkx.h | ||
| 452 | + | ||
| 453 | +gdkx.h: | ||
| 454 | + $(AM_V_GEN) cd $(srcdir) && cp $(GDKX_HEADER) gdkx.h | ||
| 455 | + | ||
| 456 | libgdkx11include_HEADERS = \ | ||
| 457 | gdkx-autocleanups.h \ | ||
| 458 | gdkx11applaunchcontext.h \ | ||
| 459 | @@ -74,7 +88,6 @@ libgdkx11include_HEADERS = \ | ||
| 460 | gdkx11display.h \ | ||
| 461 | gdkx11displaymanager.h \ | ||
| 462 | gdkx11dnd.h \ | ||
| 463 | - gdkx11glcontext.h \ | ||
| 464 | gdkx11keys.h \ | ||
| 465 | gdkx11property.h \ | ||
| 466 | gdkx11screen.h \ | ||
| 467 | @@ -83,9 +96,16 @@ libgdkx11include_HEADERS = \ | ||
| 468 | gdkx11visual.h \ | ||
| 469 | gdkx11window.h | ||
| 470 | |||
| 471 | +if HAVE_OPENGL | ||
| 472 | +libgdkx11include_HEADERS += gdkx11glcontext.h | ||
| 473 | +endif | ||
| 474 | + | ||
| 475 | # We need to include all these C files here since the conditionals | ||
| 476 | # don't seem to be correctly expanded for the dist files. | ||
| 477 | EXTRA_DIST += \ | ||
| 478 | + gdkx.h \ | ||
| 479 | gdksettings.c | ||
| 480 | |||
| 481 | +MAINTAINERCLEANFILES = gdkx.h | ||
| 482 | + | ||
| 483 | -include $(top_srcdir)/git.mk | ||
| 484 | diff --git a/gdk/x11/gdkdisplay-x11.c b/gdk/x11/gdkdisplay-x11.c | ||
| 485 | index 5816d18..5d2dae6 100644 | ||
| 486 | --- a/gdk/x11/gdkdisplay-x11.c | ||
| 487 | +++ b/gdk/x11/gdkdisplay-x11.c | ||
| 488 | @@ -37,7 +37,9 @@ | ||
| 489 | #include "gdkdisplay-x11.h" | ||
| 490 | #include "gdkprivate-x11.h" | ||
| 491 | #include "gdkscreen-x11.h" | ||
| 492 | +#ifdef HAVE_OPENGL | ||
| 493 | #include "gdkglcontext-x11.h" | ||
| 494 | +#endif | ||
| 495 | #include "gdk-private.h" | ||
| 496 | |||
| 497 | #include <glib.h> | ||
| 498 | @@ -2989,8 +2991,8 @@ gdk_x11_display_class_init (GdkX11DisplayClass * class) | ||
| 499 | display_class->convert_selection = _gdk_x11_display_convert_selection; | ||
| 500 | display_class->text_property_to_utf8_list = _gdk_x11_display_text_property_to_utf8_list; | ||
| 501 | display_class->utf8_to_string_target = _gdk_x11_display_utf8_to_string_target; | ||
| 502 | - | ||
| 503 | +#ifdef HAVE_OPENGL | ||
| 504 | display_class->make_gl_context_current = gdk_x11_display_make_gl_context_current; | ||
| 505 | - | ||
| 506 | +#endif | ||
| 507 | _gdk_x11_windowing_init (); | ||
| 508 | } | ||
| 509 | diff --git a/gdk/x11/gdkscreen-x11.c b/gdk/x11/gdkscreen-x11.c | ||
| 510 | index 2bd7f28..30032e0 100644 | ||
| 511 | --- a/gdk/x11/gdkscreen-x11.c | ||
| 512 | +++ b/gdk/x11/gdkscreen-x11.c | ||
| 513 | @@ -1968,3 +1968,8 @@ gdk_x11_screen_get_current_desktop (GdkScreen *screen) | ||
| 514 | { | ||
| 515 | return get_netwm_cardinal_property (screen, "_NET_CURRENT_DESKTOP"); | ||
| 516 | } | ||
| 517 | + | ||
| 518 | +#ifndef HAVE_OPENGL | ||
| 519 | +/* Function from in gdk/x11/gdkglcontext-x11.c */ | ||
| 520 | +void _gdk_x11_screen_update_visuals_for_gl (GdkScreen *screen) {} | ||
| 521 | +#endif | ||
| 522 | diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c | ||
| 523 | index d08cee0..d354628 100644 | ||
| 524 | --- a/gdk/x11/gdkwindow-x11.c | ||
| 525 | +++ b/gdk/x11/gdkwindow-x11.c | ||
| 526 | @@ -36,7 +36,9 @@ | ||
| 527 | #include "gdkasync.h" | ||
| 528 | #include "gdkeventsource.h" | ||
| 529 | #include "gdkdisplay-x11.h" | ||
| 530 | +#ifdef HAVE_OPENGL | ||
| 531 | #include "gdkglcontext-x11.h" | ||
| 532 | +#endif | ||
| 533 | #include "gdkprivate-x11.h" | ||
| 534 | #include "gdk-private.h" | ||
| 535 | |||
| 536 | @@ -5768,7 +5770,9 @@ gdk_window_impl_x11_class_init (GdkWindowImplX11Class *klass) | ||
| 537 | impl_class->set_opaque_region = gdk_x11_window_set_opaque_region; | ||
| 538 | impl_class->set_shadow_width = gdk_x11_window_set_shadow_width; | ||
| 539 | impl_class->show_window_menu = gdk_x11_window_show_window_menu; | ||
| 540 | +#ifdef HAVE_OPENGL | ||
| 541 | impl_class->create_gl_context = gdk_x11_window_create_gl_context; | ||
| 542 | impl_class->invalidate_for_new_frame = gdk_x11_window_invalidate_for_new_frame; | ||
| 543 | +#endif | ||
| 544 | impl_class->get_unscaled_size = gdk_x11_window_get_unscaled_size; | ||
| 545 | } | ||
| 546 | diff --git a/gdk/x11/gdkx-autocleanups.h b/gdk/x11/gdkx-autocleanups.h | ||
| 547 | index edb0ea7..a317d61 100644 | ||
| 548 | --- a/gdk/x11/gdkx-autocleanups.h | ||
| 549 | +++ b/gdk/x11/gdkx-autocleanups.h | ||
| 550 | @@ -30,7 +30,9 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkX11DeviceXI2, g_object_unref) | ||
| 551 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkX11Display, g_object_unref) | ||
| 552 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkX11DisplayManager, g_object_unref) | ||
| 553 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkX11DragContext, g_object_unref) | ||
| 554 | +#ifdef HAVE_OPENGL | ||
| 555 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkX11GLContext, g_object_unref) | ||
| 556 | +#endif | ||
| 557 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkX11Keymap, g_object_unref) | ||
| 558 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkX11Screen, g_object_unref) | ||
| 559 | G_DEFINE_AUTOPTR_CLEANUP_FUNC(GdkX11Visual, g_object_unref) | ||
| 560 | diff --git a/gdk/x11/gdkx-with-gl-context.h b/gdk/x11/gdkx-with-gl-context.h | ||
| 561 | new file mode 100644 | ||
| 562 | index 0000000..ae05fa6 | ||
| 563 | --- /dev/null | ||
| 564 | +++ b/gdk/x11/gdkx-with-gl-context.h | ||
| 565 | @@ -0,0 +1,59 @@ | ||
| 566 | +/* GDK - The GIMP Drawing Kit | ||
| 567 | + * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald | ||
| 568 | + * | ||
| 569 | + * This library is free software; you can redistribute it and/or | ||
| 570 | + * modify it under the terms of the GNU Lesser General Public | ||
| 571 | + * License as published by the Free Software Foundation; either | ||
| 572 | + * version 2 of the License, or (at your option) any later version. | ||
| 573 | + * | ||
| 574 | + * This library is distributed in the hope that it will be useful, | ||
| 575 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 576 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 577 | + * Lesser General Public License for more details. | ||
| 578 | + * | ||
| 579 | + * You should have received a copy of the GNU Lesser General Public | ||
| 580 | + * License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||
| 581 | + */ | ||
| 582 | + | ||
| 583 | +/* | ||
| 584 | + * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS | ||
| 585 | + * file for a list of people on the GTK+ Team. See the ChangeLog | ||
| 586 | + * files for a list of changes. These files are distributed with | ||
| 587 | + * GTK+ at ftp://ftp.gtk.org/pub/gtk/. | ||
| 588 | + */ | ||
| 589 | + | ||
| 590 | +#ifndef __GDK_X_H__ | ||
| 591 | +#define __GDK_X_H__ | ||
| 592 | + | ||
| 593 | +#include <gdk/gdk.h> | ||
| 594 | + | ||
| 595 | +#include <X11/Xlib.h> | ||
| 596 | +#include <X11/Xutil.h> | ||
| 597 | + | ||
| 598 | +#define __GDKX_H_INSIDE__ | ||
| 599 | + | ||
| 600 | +#include <gdk/x11/gdkx11applaunchcontext.h> | ||
| 601 | +#include <gdk/x11/gdkx11cursor.h> | ||
| 602 | +#include <gdk/x11/gdkx11device.h> | ||
| 603 | +#include <gdk/x11/gdkx11device-core.h> | ||
| 604 | +#include <gdk/x11/gdkx11device-xi2.h> | ||
| 605 | +#include <gdk/x11/gdkx11devicemanager.h> | ||
| 606 | +#include <gdk/x11/gdkx11devicemanager-core.h> | ||
| 607 | +#include <gdk/x11/gdkx11devicemanager-xi2.h> | ||
| 608 | +#include <gdk/x11/gdkx11display.h> | ||
| 609 | +#include <gdk/x11/gdkx11displaymanager.h> | ||
| 610 | +#include <gdk/x11/gdkx11dnd.h> | ||
| 611 | +#include <gdk/x11/gdkx11glcontext.h> | ||
| 612 | +#include <gdk/x11/gdkx11keys.h> | ||
| 613 | +#include <gdk/x11/gdkx11property.h> | ||
| 614 | +#include <gdk/x11/gdkx11screen.h> | ||
| 615 | +#include <gdk/x11/gdkx11selection.h> | ||
| 616 | +#include <gdk/x11/gdkx11utils.h> | ||
| 617 | +#include <gdk/x11/gdkx11visual.h> | ||
| 618 | +#include <gdk/x11/gdkx11window.h> | ||
| 619 | + | ||
| 620 | +#include <gdk/x11/gdkx-autocleanups.h> | ||
| 621 | + | ||
| 622 | +#undef __GDKX_H_INSIDE__ | ||
| 623 | + | ||
| 624 | +#endif /* __GDK_X_H__ */ | ||
| 625 | diff --git a/gdk/x11/gdkx-without-gl-context.h b/gdk/x11/gdkx-without-gl-context.h | ||
| 626 | new file mode 100644 | ||
| 627 | index 0000000..c9e2617 | ||
| 628 | --- /dev/null | ||
| 629 | +++ b/gdk/x11/gdkx-without-gl-context.h | ||
| 630 | @@ -0,0 +1,58 @@ | ||
| 631 | +/* GDK - The GIMP Drawing Kit | ||
| 632 | + * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald | ||
| 633 | + * | ||
| 634 | + * This library is free software; you can redistribute it and/or | ||
| 635 | + * modify it under the terms of the GNU Lesser General Public | ||
| 636 | + * License as published by the Free Software Foundation; either | ||
| 637 | + * version 2 of the License, or (at your option) any later version. | ||
| 638 | + * | ||
| 639 | + * This library is distributed in the hope that it will be useful, | ||
| 640 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 641 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 642 | + * Lesser General Public License for more details. | ||
| 643 | + * | ||
| 644 | + * You should have received a copy of the GNU Lesser General Public | ||
| 645 | + * License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||
| 646 | + */ | ||
| 647 | + | ||
| 648 | +/* | ||
| 649 | + * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS | ||
| 650 | + * file for a list of people on the GTK+ Team. See the ChangeLog | ||
| 651 | + * files for a list of changes. These files are distributed with | ||
| 652 | + * GTK+ at ftp://ftp.gtk.org/pub/gtk/. | ||
| 653 | + */ | ||
| 654 | + | ||
| 655 | +#ifndef __GDK_X_H__ | ||
| 656 | +#define __GDK_X_H__ | ||
| 657 | + | ||
| 658 | +#include <gdk/gdk.h> | ||
| 659 | + | ||
| 660 | +#include <X11/Xlib.h> | ||
| 661 | +#include <X11/Xutil.h> | ||
| 662 | + | ||
| 663 | +#define __GDKX_H_INSIDE__ | ||
| 664 | + | ||
| 665 | +#include <gdk/x11/gdkx11applaunchcontext.h> | ||
| 666 | +#include <gdk/x11/gdkx11cursor.h> | ||
| 667 | +#include <gdk/x11/gdkx11device.h> | ||
| 668 | +#include <gdk/x11/gdkx11device-core.h> | ||
| 669 | +#include <gdk/x11/gdkx11device-xi2.h> | ||
| 670 | +#include <gdk/x11/gdkx11devicemanager.h> | ||
| 671 | +#include <gdk/x11/gdkx11devicemanager-core.h> | ||
| 672 | +#include <gdk/x11/gdkx11devicemanager-xi2.h> | ||
| 673 | +#include <gdk/x11/gdkx11display.h> | ||
| 674 | +#include <gdk/x11/gdkx11displaymanager.h> | ||
| 675 | +#include <gdk/x11/gdkx11dnd.h> | ||
| 676 | +#include <gdk/x11/gdkx11keys.h> | ||
| 677 | +#include <gdk/x11/gdkx11property.h> | ||
| 678 | +#include <gdk/x11/gdkx11screen.h> | ||
| 679 | +#include <gdk/x11/gdkx11selection.h> | ||
| 680 | +#include <gdk/x11/gdkx11utils.h> | ||
| 681 | +#include <gdk/x11/gdkx11visual.h> | ||
| 682 | +#include <gdk/x11/gdkx11window.h> | ||
| 683 | + | ||
| 684 | +#include <gdk/x11/gdkx-autocleanups.h> | ||
| 685 | + | ||
| 686 | +#undef __GDKX_H_INSIDE__ | ||
| 687 | + | ||
| 688 | +#endif /* __GDK_X_H__ */ | ||
| 689 | diff --git a/gdk/x11/gdkx.h b/gdk/x11/gdkx.h | ||
| 690 | deleted file mode 100644 | ||
| 691 | index ae05fa6..0000000 | ||
| 692 | --- a/gdk/x11/gdkx.h | ||
| 693 | +++ /dev/null | ||
| 694 | @@ -1,59 +0,0 @@ | ||
| 695 | -/* GDK - The GIMP Drawing Kit | ||
| 696 | - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald | ||
| 697 | - * | ||
| 698 | - * This library is free software; you can redistribute it and/or | ||
| 699 | - * modify it under the terms of the GNU Lesser General Public | ||
| 700 | - * License as published by the Free Software Foundation; either | ||
| 701 | - * version 2 of the License, or (at your option) any later version. | ||
| 702 | - * | ||
| 703 | - * This library is distributed in the hope that it will be useful, | ||
| 704 | - * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 705 | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
| 706 | - * Lesser General Public License for more details. | ||
| 707 | - * | ||
| 708 | - * You should have received a copy of the GNU Lesser General Public | ||
| 709 | - * License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||
| 710 | - */ | ||
| 711 | - | ||
| 712 | -/* | ||
| 713 | - * Modified by the GTK+ Team and others 1997-2000. See the AUTHORS | ||
| 714 | - * file for a list of people on the GTK+ Team. See the ChangeLog | ||
| 715 | - * files for a list of changes. These files are distributed with | ||
| 716 | - * GTK+ at ftp://ftp.gtk.org/pub/gtk/. | ||
| 717 | - */ | ||
| 718 | - | ||
| 719 | -#ifndef __GDK_X_H__ | ||
| 720 | -#define __GDK_X_H__ | ||
| 721 | - | ||
| 722 | -#include <gdk/gdk.h> | ||
| 723 | - | ||
| 724 | -#include <X11/Xlib.h> | ||
| 725 | -#include <X11/Xutil.h> | ||
| 726 | - | ||
| 727 | -#define __GDKX_H_INSIDE__ | ||
| 728 | - | ||
| 729 | -#include <gdk/x11/gdkx11applaunchcontext.h> | ||
| 730 | -#include <gdk/x11/gdkx11cursor.h> | ||
| 731 | -#include <gdk/x11/gdkx11device.h> | ||
| 732 | -#include <gdk/x11/gdkx11device-core.h> | ||
| 733 | -#include <gdk/x11/gdkx11device-xi2.h> | ||
| 734 | -#include <gdk/x11/gdkx11devicemanager.h> | ||
| 735 | -#include <gdk/x11/gdkx11devicemanager-core.h> | ||
| 736 | -#include <gdk/x11/gdkx11devicemanager-xi2.h> | ||
| 737 | -#include <gdk/x11/gdkx11display.h> | ||
| 738 | -#include <gdk/x11/gdkx11displaymanager.h> | ||
| 739 | -#include <gdk/x11/gdkx11dnd.h> | ||
| 740 | -#include <gdk/x11/gdkx11glcontext.h> | ||
| 741 | -#include <gdk/x11/gdkx11keys.h> | ||
| 742 | -#include <gdk/x11/gdkx11property.h> | ||
| 743 | -#include <gdk/x11/gdkx11screen.h> | ||
| 744 | -#include <gdk/x11/gdkx11selection.h> | ||
| 745 | -#include <gdk/x11/gdkx11utils.h> | ||
| 746 | -#include <gdk/x11/gdkx11visual.h> | ||
| 747 | -#include <gdk/x11/gdkx11window.h> | ||
| 748 | - | ||
| 749 | -#include <gdk/x11/gdkx-autocleanups.h> | ||
| 750 | - | ||
| 751 | -#undef __GDKX_H_INSIDE__ | ||
| 752 | - | ||
| 753 | -#endif /* __GDK_X_H__ */ | ||
| 754 | diff --git a/gtk/Makefile.am b/gtk/Makefile.am | ||
| 755 | index 801c3a5..2d8839d 100644 | ||
| 756 | --- a/gtk/Makefile.am | ||
| 757 | +++ b/gtk/Makefile.am | ||
| 758 | @@ -1246,14 +1246,13 @@ gtkprivatetypebuiltins.c: $(gtk_private_type_h_sources) gtkprivatetypebuiltins. | ||
| 759 | && cp xgen-gptbc gtkprivatetypebuiltins.c \ | ||
| 760 | && rm -f xgen-gptbc | ||
| 761 | |||
| 762 | - | ||
| 763 | gtktypefuncs.c: stamp-gtktypebuiltins.h stamp-gtkprivatetypebuiltins.h $(top_srcdir)/gtk/*.h $(top_srcdir)/gtk/a11y/*.h $(top_srcdir)/gtk/deprecated/*.h $(top_srcdir)/gdk/*.h Makefile | ||
| 764 | $(AM_V_GEN) (echo '#undef GTK_COMPILATION' && echo '#include <gtk/gtkx.h>') > xgen-gtfsrc.c && \ | ||
| 765 | echo 'G_GNUC_BEGIN_IGNORE_DEPRECATIONS' > xgen-gtf && \ | ||
| 766 | ${CPP} $(DEFS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) xgen-gtfsrc.c | \ | ||
| 767 | $(GREP) -o '\bg[td]k_[a-zA-Z0-9_]*_get_type\b' | \ | ||
| 768 | sort | uniq | \ | ||
| 769 | - $(SED) '{ s/^/*tp++ = /; s/$$/();/; s/^.*\(gdk_x11\|gtk_plug_\|gtk_socket_\).*$$/#ifdef GDK_WINDOWING_X11\n&\n#endif/; }' >> xgen-gtf \ | ||
| 770 | + $(SED) '{ s/^/*tp++ = /; s/$$/();/; s/^.*\(gdk_x11\|gtk_plug_\|gtk_socket_\).*$$/#ifdef GDK_WINDOWING_X11\n&\n#endif/; s/^.*gdk_x11_gl.*$$/#ifdef HAVE_OPENGL\n&\n#endif/; }' >> xgen-gtf \ | ||
| 771 | && cp xgen-gtf $@ && rm -f xgen-gtf | ||
| 772 | gtktestutils.c: gtktypefuncs.c | ||
| 773 | |||
| 774 | diff --git a/gtk/gtkglarea.c b/gtk/gtkglarea.c | ||
| 775 | index 4098409..45fa1d1 100644 | ||
| 776 | --- a/gtk/gtkglarea.c | ||
| 777 | +++ b/gtk/gtkglarea.c | ||
| 778 | @@ -28,7 +28,9 @@ | ||
| 779 | #include "gtkprivate.h" | ||
| 780 | #include "gtkrender.h" | ||
| 781 | |||
| 782 | +#ifdef HAVE_OPENGL | ||
| 783 | #include <epoxy/gl.h> | ||
| 784 | +#endif | ||
| 785 | |||
| 786 | /** | ||
| 787 | * SECTION:gtkglarea | ||
| 788 | @@ -357,9 +359,12 @@ gtk_gl_area_real_create_context (GtkGLArea *area) | ||
| 789 | static void | ||
| 790 | gtk_gl_area_resize (GtkGLArea *area, int width, int height) | ||
| 791 | { | ||
| 792 | +#ifdef HAVE_OPENGL | ||
| 793 | glViewport (0, 0, width, height); | ||
| 794 | +#endif | ||
| 795 | } | ||
| 796 | |||
| 797 | +#ifdef HAVE_OPENGL | ||
| 798 | /* | ||
| 799 | * Creates all the buffer objects needed for rendering the scene | ||
| 800 | */ | ||
| 801 | @@ -467,6 +472,7 @@ gtk_gl_area_allocate_buffers (GtkGLArea *area) | ||
| 802 | |||
| 803 | priv->needs_render = TRUE; | ||
| 804 | } | ||
| 805 | +#endif | ||
| 806 | |||
| 807 | /** | ||
| 808 | * gtk_gl_area_attach_buffers: | ||
| 809 | @@ -485,6 +491,7 @@ gtk_gl_area_allocate_buffers (GtkGLArea *area) | ||
| 810 | void | ||
| 811 | gtk_gl_area_attach_buffers (GtkGLArea *area) | ||
| 812 | { | ||
| 813 | +#ifdef HAVE_OPENGL | ||
| 814 | GtkGLAreaPrivate *priv = gtk_gl_area_get_instance_private (area); | ||
| 815 | |||
| 816 | g_return_if_fail (GTK_IS_GL_AREA (area)); | ||
| 817 | @@ -517,11 +524,13 @@ gtk_gl_area_attach_buffers (GtkGLArea *area) | ||
| 818 | glFramebufferRenderbufferEXT (GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT, | ||
| 819 | GL_RENDERBUFFER_EXT, priv->depth_stencil_buffer); | ||
| 820 | } | ||
| 821 | +#endif | ||
| 822 | } | ||
| 823 | |||
| 824 | static void | ||
| 825 | gtk_gl_area_delete_buffers (GtkGLArea *area) | ||
| 826 | { | ||
| 827 | +#ifdef HAVE_OPENGL | ||
| 828 | GtkGLAreaPrivate *priv = gtk_gl_area_get_instance_private (area); | ||
| 829 | |||
| 830 | if (priv->context == NULL) | ||
| 831 | @@ -553,6 +562,7 @@ gtk_gl_area_delete_buffers (GtkGLArea *area) | ||
| 832 | glDeleteFramebuffersEXT (1, &priv->frame_buffer); | ||
| 833 | priv->frame_buffer = 0; | ||
| 834 | } | ||
| 835 | +#endif | ||
| 836 | } | ||
| 837 | |||
| 838 | static void | ||
| 839 | @@ -663,6 +673,7 @@ gtk_gl_area_draw (GtkWidget *widget, | ||
| 840 | GtkGLArea *area = GTK_GL_AREA (widget); | ||
| 841 | GtkGLAreaPrivate *priv = gtk_gl_area_get_instance_private (area); | ||
| 842 | gboolean unused; | ||
| 843 | +#ifdef HAVE_OPENGL | ||
| 844 | int w, h, scale; | ||
| 845 | GLenum status; | ||
| 846 | |||
| 847 | @@ -674,7 +685,6 @@ gtk_gl_area_draw (GtkWidget *widget, | ||
| 848 | gtk_widget_get_allocated_height (widget)); | ||
| 849 | return FALSE; | ||
| 850 | } | ||
| 851 | - | ||
| 852 | if (priv->context == NULL) | ||
| 853 | return FALSE; | ||
| 854 | |||
| 855 | @@ -720,6 +730,14 @@ gtk_gl_area_draw (GtkWidget *widget, | ||
| 856 | } | ||
| 857 | |||
| 858 | return TRUE; | ||
| 859 | +#else | ||
| 860 | + if (priv->error != NULL) | ||
| 861 | + gtk_gl_area_draw_error_screen (area, | ||
| 862 | + cr, | ||
| 863 | + gtk_widget_get_allocated_width (widget), | ||
| 864 | + gtk_widget_get_allocated_height (widget)); | ||
| 865 | + return FALSE; | ||
| 866 | +#endif | ||
| 867 | } | ||
| 868 | |||
| 869 | static gboolean | ||
| 870 | diff --git a/gtk/inspector/general.c b/gtk/inspector/general.c | ||
| 871 | index 0611373..4499a29 100644 | ||
| 872 | --- a/gtk/inspector/general.c | ||
| 873 | +++ b/gtk/inspector/general.c | ||
| 874 | @@ -33,8 +33,10 @@ | ||
| 875 | |||
| 876 | #ifdef GDK_WINDOWING_X11 | ||
| 877 | #include "x11/gdkx.h" | ||
| 878 | +#ifdef HAVE_OPENGL | ||
| 879 | #include <epoxy/glx.h> | ||
| 880 | #endif | ||
| 881 | +#endif | ||
| 882 | |||
| 883 | #ifdef GDK_WINDOWING_WIN32 | ||
| 884 | #include "win32/gdkwin32.h" | ||
| 885 | @@ -146,6 +148,7 @@ append_extension_row (GtkInspectorGeneral *gen, | ||
| 886 | gtk_size_group_add_widget (GTK_SIZE_GROUP (gen->priv->labels), label); | ||
| 887 | } | ||
| 888 | |||
| 889 | +#ifdef HAVE_OPENGL | ||
| 890 | #ifdef GDK_WINDOWING_X11 | ||
| 891 | static void | ||
| 892 | append_glx_extension_row (GtkInspectorGeneral *gen, | ||
| 893 | @@ -155,6 +158,7 @@ append_glx_extension_row (GtkInspectorGeneral *gen, | ||
| 894 | append_extension_row (gen, ext, epoxy_has_glx_extension (dpy, 0, ext)); | ||
| 895 | } | ||
| 896 | #endif | ||
| 897 | +#endif | ||
| 898 | |||
| 899 | #ifdef GDK_WINDOWING_WAYLAND | ||
| 900 | static void | ||
| 901 | @@ -174,6 +178,7 @@ init_gl (GtkInspectorGeneral *gen) | ||
| 902 | |||
| 903 | display = gdk_display_get_default (); | ||
| 904 | |||
| 905 | +#ifdef HAVE_OPENGL | ||
| 906 | #ifdef GDK_WINDOWING_X11 | ||
| 907 | if (GDK_IS_X11_DISPLAY (display)) | ||
| 908 | { | ||
| 909 | @@ -199,6 +204,7 @@ init_gl (GtkInspectorGeneral *gen) | ||
| 910 | } | ||
| 911 | else | ||
| 912 | #endif | ||
| 913 | +#endif | ||
| 914 | #ifdef GDK_WINDOWING_WAYLAND | ||
| 915 | if (GDK_IS_WAYLAND_DISPLAY (display)) | ||
| 916 | { | ||
| 917 | diff --git a/tests/Makefile.am b/tests/Makefile.am | ||
| 918 | index 50f2986..3b39169 100644 | ||
| 919 | --- a/tests/Makefile.am | ||
| 920 | +++ b/tests/Makefile.am | ||
| 921 | @@ -78,8 +78,6 @@ noinst_PROGRAMS = $(TEST_PROGS) \ | ||
| 922 | testfullscreen \ | ||
| 923 | testgeometry \ | ||
| 924 | testgiconpixbuf \ | ||
| 925 | - testglarea \ | ||
| 926 | - testglblending \ | ||
| 927 | testgrid \ | ||
| 928 | testgtk \ | ||
| 929 | testheaderbar \ | ||
| 930 | @@ -166,10 +164,16 @@ noinst_PROGRAMS = $(TEST_PROGS) \ | ||
| 931 | testactionbar \ | ||
| 932 | testwindowsize \ | ||
| 933 | testpopover \ | ||
| 934 | - gdkgears \ | ||
| 935 | listmodel \ | ||
| 936 | $(NULL) | ||
| 937 | |||
| 938 | +if HAVE_OPENGL | ||
| 939 | +noinst_PROGRAMS += | ||
| 940 | + testglarea \ | ||
| 941 | + testglblending \ | ||
| 942 | + gdkgears | ||
| 943 | +endif | ||
| 944 | + | ||
| 945 | if USE_X11 | ||
| 946 | noinst_PROGRAMS += testerrors | ||
| 947 | endif | ||
| 948 | diff --git a/testsuite/gtk/objects-finalize.c b/testsuite/gtk/objects-finalize.c | ||
| 949 | index 3568505..682ea10 100644 | ||
| 950 | --- a/testsuite/gtk/objects-finalize.c | ||
| 951 | +++ b/testsuite/gtk/objects-finalize.c | ||
| 952 | @@ -114,8 +114,10 @@ main (int argc, char **argv) | ||
| 953 | all_types[i] != GDK_TYPE_X11_DISPLAY && | ||
| 954 | all_types[i] != GDK_TYPE_X11_DEVICE_MANAGER_XI2 && | ||
| 955 | all_types[i] != GDK_TYPE_X11_DISPLAY_MANAGER && | ||
| 956 | +#ifdef HAVE_OPENGL | ||
| 957 | all_types[i] != GDK_TYPE_X11_GL_CONTEXT && | ||
| 958 | #endif | ||
| 959 | +#endif | ||
| 960 | /* Not allowed to finalize a GdkPixbufLoader without calling gdk_pixbuf_loader_close() */ | ||
| 961 | all_types[i] != GDK_TYPE_PIXBUF_LOADER && | ||
| 962 | all_types[i] != gdk_pixbuf_simple_anim_iter_get_type()) | ||
| 963 | -- | ||
| 964 | 2.8.1 | ||
| 965 | |||
diff --git a/meta/recipes-gnome/gtk+/gtk+3_3.18.8.bb b/meta/recipes-gnome/gtk+/gtk+3_3.18.8.bb index b76c0cc1ce..d776b6d40e 100644 --- a/meta/recipes-gnome/gtk+/gtk+3_3.18.8.bb +++ b/meta/recipes-gnome/gtk+/gtk+3_3.18.8.bb | |||
| @@ -6,6 +6,7 @@ SRC_URI = "http://ftp.gnome.org/pub/gnome/sources/gtk+/${MAJ_VER}/gtk+-${PV}.tar | |||
| 6 | file://hardcoded_libtool.patch \ | 6 | file://hardcoded_libtool.patch \ |
| 7 | file://Dont-force-csd.patch \ | 7 | file://Dont-force-csd.patch \ |
| 8 | file://Do-not-try-to-initialize-GL-without-libGL.patch \ | 8 | file://Do-not-try-to-initialize-GL-without-libGL.patch \ |
| 9 | file://0001-Add-disable-opengl-configure-option.patch \ | ||
| 9 | " | 10 | " |
| 10 | 11 | ||
| 11 | SRC_URI[md5sum] = "9671acb41dc13561d19233f1a75cf184" | 12 | SRC_URI[md5sum] = "9671acb41dc13561d19233f1a75cf184" |
