GNOME Bugzilla – Bug 629383
[St] Use a base material for all shadow instances
Last modified: 2010-09-13 16:13:13 UTC
See patch.
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
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.
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.
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.