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 634362 - Window close button in overview takes seconds to appear (Intel card)
Window close button in overview takes seconds to appear (Intel card)
Status: VERIFIED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2010-11-08 21:13 UTC by Milan Bouchet-Valat
Modified: 2010-11-24 16:52 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Milan Bouchet-Valat 2010-11-08 21:13:05 UTC
The cross image that allows closing windows in the overview takes one or two seconds to appear on my machine. But this only happens when it's the first time you hover on a specific window after entering the overview. Moving the pointer back to a window you already hovered on makes the close button appear instantly; and going out and back to the overview brings back the delay.

I've noticed the button image projects shadow on the window, so the problem may come from there. That's the only cause I can think of, since it seems to require computing for each separate window.

This is with an Intel 915GM card, with drivers from git.
Comment 1 Andreas Proschofsky 2010-11-08 22:41:50 UTC
Same here with i965, might add that the close sign also has the same delay before it disappears when you move the mouse pointer away.
Comment 2 Owen Taylor 2010-11-09 21:04:18 UTC
In some profiling that Dave Arlie was doing, it turned up that shadowing the 22x22 button image ends up doing a glGetTexImage() on the entire atlas texture, which for me is 2048x2048. On the r300g driver this ended up going through a floating point code path, but it's a pretty bad thing to do even with good code paths, and is almost certainly the problem here.

Some ideas for fixing:

 * Fix Cogl to map the full texture as a fbo and use glReadPixels() to read the region we need from it.
 * When converting a GdkPixbuf to a cogl texture, keep the GdkPixbuf around and attach it to the cogl texture (unfortunately, there's no user data facility on CoglTexture/CoglHandle at the moment. Can use GDataSet, which involves a global mutex and hash table, but is vastly better than reading 16megs of data from vram to get a 22x22 image.)
Comment 3 Milan Bouchet-Valat 2010-11-09 21:10:24 UTC
As a side note, I've just understood this small bug makes it very painful to drag and drop windows, since while the close button is being "drawn", the current position of the pointer isn't taken into account.

This means the window you'll end up dragging is the one that's under the pointer at the moment the drawing of the button completes - most often, you're already at the destination point, and the result is not what you intended at all.
Comment 4 Florian Müllner 2010-11-09 21:29:47 UTC
(In reply to comment #2)
> Some ideas for fixing:
> 
>  * Fix Cogl to map the full texture as a fbo and use glReadPixels() to read the
> region we need from it.
>  * When converting a GdkPixbuf to a cogl texture, keep the GdkPixbuf around and
> attach it to the cogl texture (unfortunately, there's no user data facility on
> CoglTexture/CoglHandle at the moment. Can use GDataSet, which involves a global
> mutex and hash table, but is vastly better than reading 16megs of data from
> vram to get a 22x22 image.)

Another option could be to pass COGL_TEXTURE_NO_ATLAS to cogl_texture_new() if the theme node has a shadow. Passing it unconditionally makes the close buttons appear instantly here, doing it conditionally would require quite a few modifications in StTextureCache though ...
Comment 5 Andreas Proschofsky 2010-11-10 20:33:49 UTC
(In reply to comment #3)
> As a side note, I've just understood this small bug makes it very painful to
> drag and drop windows, since while the close button is being "drawn", the
> current position of the pointer isn't taken into account.
> 
> This means the window you'll end up dragging is the one that's under the
> pointer at the moment the drawing of the button completes - most often, you're
> already at the destination point, and the result is not what you intended at
> all.

That's what I've filed as bug #633389
Comment 6 Owen Taylor 2010-11-12 16:26:09 UTC
http://bugzilla.clutter-project.org/show_bug.cgi?id=2414 has the fix for Cogl to use glReadPixels. While reading data back from VRAM is never a cheap operation, it seems to pretty much fully solve this bottleneck.
Comment 7 Andreas Proschofsky 2010-11-13 10:48:44 UTC
On my machine the clutter patch makes a pretty big difference, gnome-shell gets a lot faster for me with no visible problems. Even the overview-relayout branch is now usable. Grabbing a window immediately after dragging another one is still not possible, but the delay before being able to do this is way shorter. App highlighting in the app well is still kinda slow (guess that's related to this bug) when you move the mouse pointer over the apps.

Great work!
Comment 8 Neil Roberts 2010-11-24 16:17:43 UTC
I've pushed those into Clutter. Thanks for the great work Owen.
Comment 9 Milan Bouchet-Valat 2010-11-24 16:52:05 UTC
I confirm the fix is very good, the button appears instantly now.