Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From 14a5bac617e9b29bf4b48b0f877fb6053140b1cf Mon Sep 17 00:00:00 2001
- From: Neil Roberts <neil@linux.intel.com>
- Date: Wed, 9 Jun 2010 13:53:34 +0100
- Subject: [PATCH] cogl-material: Fix the function which sets the enable blend flag
- This function had two problems. Firstly it would clear the enable
- blend flag before calling pre_change_notify so that if blending was
- previously enabled the journal would end up being flushed while the
- flag was still cleared. Secondly it would call the pre change notify
- whenever blending is needed regardless of whether it was already
- needed previously.
- This was causing problems in test-depth.
- ---
- clutter/cogl/cogl/cogl-material.c | 12 +++++++++---
- 1 files changed, 9 insertions(+), 3 deletions(-)
- diff --git a/clutter/cogl/cogl/cogl-material.c b/clutter/cogl/cogl/cogl-material.c
- index fce8543..51adcb0 100644
- --- a/clutter/cogl/cogl/cogl-material.c
- +++ b/clutter/cogl/cogl/cogl-material.c
- @@ -359,14 +359,20 @@ _cogl_material_pre_change_notify (CoglMaterial *material,
- static void
- handle_automatic_blend_enable (CoglMaterial *material)
- {
- - material->flags &= ~COGL_MATERIAL_FLAG_ENABLE_BLEND;
- + gboolean needs_blending_enabled =
- + _cogl_material_needs_blending_enabled (material, NULL);
- - if (_cogl_material_needs_blending_enabled (material, NULL))
- + if (needs_blending_enabled !=
- + !!(material->flags & COGL_MATERIAL_FLAG_ENABLE_BLEND))
- {
- _cogl_material_pre_change_notify (material,
- COGL_MATERIAL_CHANGE_ENABLE_BLEND,
- NULL);
- - material->flags |= COGL_MATERIAL_FLAG_ENABLE_BLEND;
- +
- + if (needs_blending_enabled)
- + material->flags |= COGL_MATERIAL_FLAG_ENABLE_BLEND;
- + else
- + material->flags &= ~COGL_MATERIAL_FLAG_ENABLE_BLEND;
- }
- }
- --
- 1.7.1.87.g94e70
Add Comment
Please, Sign In to add comment