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 629383 - [St] Use a base material for all shadow instances
[St] Use a base material for all shadow instances
Status: RESOLVED 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-09-11 21:53 UTC by drago01
Modified: 2010-09-13 16:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[St] Use a base material for all shadow instances (1.36 KB, patch)
2010-09-11 21:54 UTC, drago01
none Details | Review
st-shadows: Use a template material when creating shadows (2.18 KB, patch)
2010-09-11 22:06 UTC, Florian Müllner
committed Details | Review

Description drago01 2010-09-11 21:53:45 UTC
See patch.
Comment 1 drago01 2010-09-11 21:54:13 UTC
Created attachment 170045 [details] [review]
[St] Use a base material for all shadow instances

Use a base material for all shadows rather than recreating it for every
instance, this should allow Cogl to optimize the program generation.

Idea 'stolen' from:

http://git.clutter-project.org/clutter/commit/?id=7e56a98413817479d0501ce8af9fad3e6411104d
Comment 2 Florian Müllner 2010-09-11 22:06:10 UTC
Created attachment 170046 [details] [review]
st-shadows: Use a template material when creating shadows

To avoid recompiling shadows each time a new shadow is created,
use a copy of a static template material.

See http://bugzilla.clutter-project.org/show_bug.cgi?id=2280#c5.

Results that drago01 and me were working on the same patch - attaching mine as agreed on IRC, as it sets the combine function on the template rather than each copy.
Comment 3 Owen Taylor 2010-09-13 15:52:21 UTC
Review of attachment 170046 [details] [review]:

OK to commit with the fixes below (or without the fix below if there is a reason for the way it is currently)

::: src/st/st-private.c
@@ +6,3 @@
 
+/* template material for shadows */
+static CoglHandle global_shadow_material = COGL_INVALID_HANDLE;

Is there a reason this is a global static than a static within _st_create_shadow_material? Also I think this would be better called shadow_material_template than global_shadow_material - it seems more descriptive to me.
Comment 4 Florian Müllner 2010-09-13 16:13:04 UTC
Attachment 170046 [details] pushed as 1034798 - st-shadows: Use a template material when creating shadows

(In reply to comment #3)
> Is there a reason this is a global static than a static within
> _st_create_shadow_material?

No.

> Also I think this would be better called shadow_material_template than
> global_shadow_material - it seems more descriptive to me.

OK.