st-theme-node: Move some allocation-independent textures back to the theme node
The background image, background image shadow and border image are allocation-indepedent, so we can keep these in the node. Given that these are are likely cached in the StTextureCache, the slight increase in code complexity may not be worth caching these textures and materials -- we might be better off just computing when we need to paint. https://bugzilla.gnome.org/show_bug.cgi?id=697274
This commit is contained in:
@ -49,6 +49,11 @@ static void
|
||||
st_theme_node_init (StThemeNode *node)
|
||||
{
|
||||
node->transition_duration = -1;
|
||||
node->background_texture = COGL_INVALID_HANDLE;
|
||||
node->background_material = COGL_INVALID_HANDLE;
|
||||
node->background_shadow_material = COGL_INVALID_HANDLE;
|
||||
node->border_slices_texture = COGL_INVALID_HANDLE;
|
||||
node->border_slices_material = COGL_INVALID_HANDLE;
|
||||
}
|
||||
|
||||
static void
|
||||
@ -151,6 +156,17 @@ st_theme_node_finalize (GObject *object)
|
||||
if (node->background_image)
|
||||
g_free (node->background_image);
|
||||
|
||||
if (node->background_texture != COGL_INVALID_HANDLE)
|
||||
cogl_handle_unref (node->background_texture);
|
||||
if (node->background_material != COGL_INVALID_HANDLE)
|
||||
cogl_handle_unref (node->background_material);
|
||||
if (node->background_shadow_material != COGL_INVALID_HANDLE)
|
||||
cogl_handle_unref (node->background_shadow_material);
|
||||
if (node->border_slices_texture != COGL_INVALID_HANDLE)
|
||||
cogl_handle_unref (node->border_slices_texture);
|
||||
if (node->border_slices_material != COGL_INVALID_HANDLE)
|
||||
cogl_handle_unref (node->border_slices_material);
|
||||
|
||||
G_OBJECT_CLASS (st_theme_node_parent_class)->finalize (object);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user