After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 672361 - Remove cairo-gl dependency from wayland backend
Remove cairo-gl dependency from wayland backend
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Wayland
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2012-03-18 20:23 UTC by Darxus
Modified: 2012-04-17 20:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Make cairo-gl optional (10.13 KB, patch)
2012-04-10 14:49 UTC, Rob Bradford
none Details | Review
Updated patch (1.78 KB, patch)
2012-04-16 14:42 UTC, Rob Bradford
reviewed Details | Review

Description Darxus 2012-03-18 20:23:36 UTC
When cairo-gl is not available, fall back to software, as the demo wayland clients do.

There is a problem between cairo-gl and Nvidia proprietary drivers resulting in an inability to enable cairo-gl, which means inability to enable the wayland backend of gtk+.

More info:
https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers/+bug/725434
https://bugs.launchpad.net/ubuntu/+source/gtk+3.0/+bug/954352/
Comment 1 Rob Bradford 2012-04-10 13:02:50 UTC
I have a branch here: https://github.com/rbradford/gtk/tree/wip/wayland-render-changes

That allows you avoid using cairo-gl and instead the image backend. I had been waiting until after 3.4 was branched to merge it into master - however it is pretty self contained.

The only non gdk/wayland/ specific thing it adds is a configure parameter to enable cairo-gl.

The feedback i've received is that it works well and that it would be nice to get in for 3.4.1.
Comment 2 Matthias Clasen 2012-04-10 13:41:43 UTC
Care to attach patches here ? I hate the github ui
Comment 3 Rob Bradford 2012-04-10 14:49:58 UTC
Created attachment 211745 [details] [review]
Make cairo-gl optional

Matthias, this is the most significant of the patches on the branch - the others are solely inside the Wayland code.

The main thing to look at here is the naming and implementation of the enable flag.
Comment 4 Rob Bradford 2012-04-13 16:20:36 UTC
I'm going to land a version of this change that disables cairo-gl without adding an enable flag to add it back. We can then review the patch to add the enable flag back at a later date.
Comment 5 Rob Bradford 2012-04-16 14:42:19 UTC
Created attachment 212147 [details] [review]
Updated patch

A commit without the corresponding enable flag is now in master. This patch has been rebased wrt. to that and simply adds a configure flag (--enable-wayland-cairo-gl) that enables the ifdef'ed functionality in the backend.

The naming is similar to the other backend specific toggle "--enable-quart-relocation".

The default is to use SHM with Cairo image since that is much more reliable.
Comment 6 Emmanuele Bassi (:ebassi) 2012-04-16 14:54:59 UTC
Review of attachment 212147 [details] [review]:

you probably want to change the commit message to use SHM instead of SGM.

other than that and minor style nitpicks, looks good to me.

::: configure.ac
@@ +319,3 @@
+AC_ARG_ENABLE(wayland-cairo-gl,
+              AS_HELP_STRING([--enable-wayland-cairo-gl],
+                             [enable the use of Cairo GL in the Wayland

no need to split the lines

@@ +390,3 @@
+    # Wayland can use cairo-gl
+    cairo_backends="$cairo_backends cairo-gl"
+    AC_DEFINE(GDK_WAYLAND_USE_EGL, true,

[1], not true
Comment 7 Rob Bradford 2012-04-16 15:13:18 UTC
Thanks ebassi - fixes integrated and merged.
Comment 8 Darxus 2012-04-17 20:19:02 UTC
Relevant commits to master:


commit ba81a3a14c6f6d58d08632c4a10c3f21fd3d1b73
Author:     Rob Bradford <rob@linux.intel.com>
AuthorDate: Mon Apr 16 15:29:44 2012 +0100
Commit:     Rob Bradford <rob@linux.intel.com>
CommitDate: Mon Apr 16 16:05:51 2012 +0100

    build: Add an enable flag to allow enabling Cairo GL backend
    
    This change adds --enable-wayland-cairo-gl which turns on the define used in
    the Wayland backend to determine whether to use EGL surfaces with Cairo GL or
    whether to use the Cairo image backend with an SHM surface (the default).
    
    Part of the fix for: https://bugzilla.gnome.org/show_bug.cgi?id=672361

commit 71ca53993eb3953222fb8c3f22c544e5ee89ca7a
Author:     Rob Bradford <rob@linux.intel.com>
AuthorDate: Thu Apr 12 12:11:04 2012 +0100
Commit:     Rob Bradford <rob@linux.intel.com>
CommitDate: Mon Apr 16 15:09:14 2012 +0100

    wayland: Use an ARGB buffer for the Cairo and SHM surface

commit cddfcf1418f2983890895e5d3e072ad12d19d525
Author:     Rob Bradford <rob@linux.intel.com>
AuthorDate: Thu Jan 19 11:51:50 2012 +0000
Commit:     Rob Bradford <rob@linux.intel.com>
CommitDate: Mon Apr 16 15:09:14 2012 +0100

    wayland: Force an expose for the whole area when scrolling

commit cdf5c2af628a1ca202cd8c6a8d3529b46718183b
Author:     Rob Bradford <rob@linux.intel.com>
AuthorDate: Wed Apr 4 17:20:13 2012 +0100
Commit:     Rob Bradford <rob@linux.intel.com>
CommitDate: Mon Apr 16 15:09:14 2012 +0100

    wayland: Add support for rendering into an SHM buffer with Cairo image backend
    
    The first version of this change included a bug that meant that if you don't
    compile for any other backend then it wouldn't search for cairo. Credit for
    identifying the bug goes to darxus@chaosreigns.com.
    
    Fixes: https://bugzilla.gnome.org/show_bug.cgi?id=672361

commit 6977ea0bd1aa91e757a08d2d6a8fcc2adb08588c
Author:     Rob Bradford <rob@linux.intel.com>
AuthorDate: Wed Apr 4 14:05:57 2012 +0100
Commit:     Rob Bradford <rob@linux.intel.com>
CommitDate: Mon Apr 16 14:12:51 2012 +0100

    wayland: Move the buffer creation to the cairo surface creation

commit d9ca1a86363f6f0409460912a810b544c9c00ce1
Author:     Rob Bradford <rob@linux.intel.com>
AuthorDate: Wed Apr 4 14:05:27 2012 +0100
Commit:     Rob Bradford <rob@linux.intel.com>
CommitDate: Mon Apr 16 14:12:51 2012 +0100

    wayland: Move the finalize function to allow a clear logical block of code

commit a8d03c9970334c3bdbebfede9bca010f607fa4af
Author:     Rob Bradford <rob@linux.intel.com>
AuthorDate: Wed Apr 4 11:40:52 2012 +0100
Commit:     Rob Bradford <rob@linux.intel.com>
CommitDate: Mon Apr 16 14:12:51 2012 +0100

    wayland: Remove unused member from struct