st-theme-node-drawing: Don't create lots of one-shot materials
A few places in st-theme-node-drawing create one-shot material, paint with it and then free it. This is suboptimal with current Cogl because it will end up compiling an ARBfp program just for that single paint and then it will throw it away when the material is destroyed. There is a new function in st-private.c called _st_create_texture_material. This creates a simple material for a texture based on a common parent material that points to a dummy texture. Any materials created with this function are likely to be able to share the same program unless the material is further modified to contain a different number of layers. It would be possible to use cogl_set_source_texture for this instead except that it's not possible to modify the material's color in that case so we couldn't render the texture with opacity. The corner textures are now stored as a handle to a material that references the texture rather than storing the texure directly. There is also a separate border_material member which always points to border_texture as the only layer. https://bugzilla.gnome.org/show_bug.cgi?id=633340
This commit is contained in:
@@ -78,7 +78,8 @@ struct _StThemeNode {
|
||||
CoglHandle border_shadow_material;
|
||||
CoglHandle background_texture;
|
||||
CoglHandle border_texture;
|
||||
CoglHandle corner_texture[4];
|
||||
CoglHandle border_material;
|
||||
CoglHandle corner_material[4];
|
||||
};
|
||||
|
||||
struct _StThemeNodeClass {
|
||||
|
Reference in New Issue
Block a user