[gnome-shell] st-theme-node: Add method to invalidate drawing state



commit c4c470c1f39bc6bf0500d80676e21161d4da146d
Author: Florian MÃllner <fmuellner gnome org>
Date:   Thu Sep 20 21:44:21 2012 +0200

    st-theme-node: Add method to invalidate drawing state
    
    StThemeNode caches its resources aggressively to keep the required
    work on paint to a minimum - right now, resources are only recreated
    on allocation changes.
    In order to update the background-image property correctly when the
    underlying file changes, resources need to be recreated without a
    size change, so add an explicit method for that.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=679268

 src/st/st-theme-node-drawing.c |    7 +++++++
 src/st/st-theme-node.h         |    1 +
 2 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/st/st-theme-node-drawing.c b/src/st/st-theme-node-drawing.c
index 8e58141..c3424f9 100644
--- a/src/st/st-theme-node-drawing.c
+++ b/src/st/st-theme-node-drawing.c
@@ -2088,3 +2088,10 @@ st_theme_node_copy_cached_paint_state (StThemeNode *node,
     if (other->corner_material[corner_id])
       node->corner_material[corner_id] = cogl_handle_ref (other->corner_material[corner_id]);
 }
+
+void
+st_theme_node_invalidate_paint_state (StThemeNode *node)
+{
+  node->alloc_width = 0;
+  node->alloc_height = 0;
+}
diff --git a/src/st/st-theme-node.h b/src/st/st-theme-node.h
index 795f875..2c672eb 100644
--- a/src/st/st-theme-node.h
+++ b/src/st/st-theme-node.h
@@ -244,6 +244,7 @@ void st_theme_node_paint (StThemeNode            *node,
 
 void st_theme_node_copy_cached_paint_state (StThemeNode *node,
                                             StThemeNode *other);
+void st_theme_node_invalidate_paint_state  (StThemeNode *node);
 
 G_END_DECLS
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]