[gnome-shell] StThemeNode: Fix the confusion between border and background
- From: Neil Roberts <nroberts src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] StThemeNode: Fix the confusion between border and background
- Date: Thu, 28 Oct 2010 21:32:58 +0000 (UTC)
commit 88729136656794dcb6c079d609afdfd37abd462c
Author: Neil Roberts <neil linux intel com>
Date: Thu Oct 28 21:51:13 2010 +0100
StThemeNode: Fix the confusion between border and background
In d66e7dd49 I got confused between border_texture and
background_texture. The background_texture was being created as normal
but in the one place that it gets drawn I accidentally made it use the
border_material instead. This patch makes it create a
background_material similar to the border_material and uses it to
paint.
src/st/st-theme-node-drawing.c | 8 +++++++-
src/st/st-theme-node-private.h | 1 +
2 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/src/st/st-theme-node-drawing.c b/src/st/st-theme-node-drawing.c
index d28f03e..8bc1915 100644
--- a/src/st/st-theme-node-drawing.c
+++ b/src/st/st-theme-node-drawing.c
@@ -509,6 +509,8 @@ _st_theme_node_free_drawing_state (StThemeNode *node)
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_texture != COGL_INVALID_HANDLE)
@@ -531,6 +533,7 @@ _st_theme_node_init_drawing_state (StThemeNode *node)
int corner_id;
node->background_texture = COGL_INVALID_HANDLE;
+ node->background_material = COGL_INVALID_HANDLE;
node->background_shadow_material = COGL_INVALID_HANDLE;
node->border_shadow_material = COGL_INVALID_HANDLE;
node->border_texture = COGL_INVALID_HANDLE;
@@ -632,6 +635,7 @@ st_theme_node_render_resources (StThemeNode *node,
{
node->background_texture = st_texture_cache_load_file_to_cogl_texture (texture_cache, background_image);
+ node->background_material = _st_create_texture_material (node->background_texture);
if (shadow_spec)
{
@@ -1120,7 +1124,7 @@ st_theme_node_paint (StThemeNode *node,
&background_box,
paint_opacity);
- paint_material_with_opacity (node->border_material, &background_box, paint_opacity);
+ paint_material_with_opacity (node->background_material, &background_box, paint_opacity);
}
}
@@ -1157,6 +1161,8 @@ st_theme_node_copy_cached_paint_state (StThemeNode *node,
node->border_shadow_material = cogl_handle_ref (other->border_shadow_material);
if (other->background_texture)
node->background_texture = cogl_handle_ref (other->background_texture);
+ if (other->background_material)
+ node->background_material = cogl_handle_ref (other->background_material);
if (other->border_texture)
node->border_texture = cogl_handle_ref (other->border_texture);
if (other->border_material)
diff --git a/src/st/st-theme-node-private.h b/src/st/st-theme-node-private.h
index c6078fc..a13df17 100644
--- a/src/st/st-theme-node-private.h
+++ b/src/st/st-theme-node-private.h
@@ -77,6 +77,7 @@ struct _StThemeNode {
CoglHandle background_shadow_material;
CoglHandle border_shadow_material;
CoglHandle background_texture;
+ CoglHandle background_material;
CoglHandle border_texture;
CoglHandle border_material;
CoglHandle corner_material[4];
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]