GNOME Bugzilla – Bug 629350
[mutter-shaped-texture] Use a base material for all instances
Last modified: 2010-09-19 14:18:21 UTC
See patch for details, basically apply the logic from this clutter commit: http://git.clutter-project.org/clutter/commit/?id=7e56a98413817479d0501ce8af9fad3e6411104d to mutter-shaped-texture.
Created attachment 170020 [details] [review] [mutter-shaped-texture] Use a base material for all instances Use a base material for all textures 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
Review of attachment 170020 [details] [review]: Basically looks good, some details ::: src/compositor/mutter-shaped-texture.c @@ +63,3 @@ +static CoglHandle global_material = COGL_INVALID_HANDLE; +static CoglHandle global_material_unshaped = COGL_INVALID_HANDLE; A) These can be local statics within the functions that create and use them B) I prefer _template to global_ @@ +348,3 @@ + global_material_unshaped = cogl_material_new (); + } + priv->material_unshaped = cogl_material_copy (global_material_unshaped); Screwy indentation (and {} aren't needed for single line if)
Created attachment 170565 [details] [review] [mutter-shaped-texture] Use a base material for all instances
Review of attachment 170565 [details] [review]: Looks good, OK to commit with one minor change. ::: src/compositor/mutter-shaped-texture.c @@ +300,3 @@ + + static CoglHandle material_template = COGL_INVALID_HANDLE; + static CoglHandle material_template_unshaped = COGL_INVALID_HANDLE; Think 'material_unshaped_template' is better.
Attachment 170565 [details] pushed as 3fed2ab - [mutter-shaped-texture] Use a base material for all instances