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 629350 - [mutter-shaped-texture] Use a base material for all instances
[mutter-shaped-texture] Use a base material for all instances
Status: RESOLVED FIXED
Product: mutter
Classification: Core
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2010-09-11 10:48 UTC by drago01
Modified: 2010-09-19 14:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
[mutter-shaped-texture] Use a base material for all instances (2.54 KB, patch)
2010-09-11 10:48 UTC, drago01
needs-work Details | Review
[mutter-shaped-texture] Use a base material for all instances (2.49 KB, patch)
2010-09-18 22:59 UTC, drago01
committed Details | Review

Description drago01 2010-09-11 10:48:11 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.
Comment 1 drago01 2010-09-11 10:48:53 UTC
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
Comment 2 Owen Taylor 2010-09-18 22:11:16 UTC
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)
Comment 3 drago01 2010-09-18 22:59:32 UTC
Created attachment 170565 [details] [review]
[mutter-shaped-texture] Use a base material for all instances
Comment 4 Owen Taylor 2010-09-19 13:38:37 UTC
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.
Comment 5 drago01 2010-09-19 14:18:18 UTC
Attachment 170565 [details] pushed as 3fed2ab - [mutter-shaped-texture] Use a base material for all instances