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 754890 - Fix Mesa warning when unrealizing/rerealizing foreign stage windows
Fix Mesa warning when unrealizing/rerealizing foreign stage windows
Status: RESOLVED FIXED
Product: clutter
Classification: Platform
Component: gdk
unspecified
Other All
: Normal normal
: ---
Assigned To: clutter-maint
clutter-maint
Depends on:
Blocks:
 
 
Reported: 2015-09-11 15:50 UTC by Lionel Landwerlin
Modified: 2015-09-11 22:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gdk: stage window: reset framebuffer on foreign window unrealize (4.31 KB, patch)
2015-09-11 15:50 UTC, Lionel Landwerlin
none Details | Review
gdk: stage window: reset framebuffer on foreign window unrealize (4.91 KB, patch)
2015-09-11 22:32 UTC, Lionel Landwerlin
committed Details | Review

Description Lionel Landwerlin 2015-09-11 15:50:29 UTC
We get a "failed to create drawable" warning for Mesa when rerealizing
a stage with the same foreign window. It turns out that Cogl keeps a
reference on the current frame buffer set using cogl_set_framebuffer().
Comment 1 Lionel Landwerlin 2015-09-11 15:50:35 UTC
Created attachment 311161 [details] [review]
gdk: stage window: reset framebuffer on foreign window unrealize
Comment 2 Emmanuele Bassi (:ebassi) 2015-09-11 16:27:01 UTC
Review of attachment 311161 [details] [review]:

::: clutter/gdk/clutter-stage-gdk.c
@@ +194,3 @@
+           * rendered to. In the case of foreign window, we want to
+           * avoid this, as we don't know what's going to happen to
+

This comment should be the Git commit message. :-)
Comment 3 Lionel Landwerlin 2015-09-11 22:32:28 UTC
Created attachment 311187 [details] [review]
gdk: stage window: reset framebuffer on foreign window unrealize

Clutter still uses part of the deprecated stateful API of Cogl (in
particulart cogl_set_framebuffer). It means Cogl can keep an internal
reference to the onscreen object we rendered to. In the case of
foreign window, we want to avoid this, as we don't know what's going
to happen to that window.

This change sets the current Cogl framebuffer to a dummy 1x1
framebuffer if the current Cogl framebuffer is the one we're
unrealizing.
Comment 4 Lionel Landwerlin 2015-09-11 22:38:20 UTC
Review of attachment 311161 [details] [review]:

::: clutter/gdk/clutter-stage-gdk.c
@@ +194,3 @@
+           * rendered to. In the case of foreign window, we want to
+           * avoid this, as we don't know what's going to happen to
+

Done.

@@ +200,3 @@
+           * foreign window.
+           */
+           * can keep an internal reference to the onscreen object we

Actually missed a small condition here.
Comment 5 Lionel Landwerlin 2015-09-11 22:42:29 UTC
Review of attachment 311187 [details] [review]:

Pushed to master.