summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/vega/paint.c
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2011-09-21 10:48:21 +0800
committerChia-I Wu <[email protected]>2011-09-21 12:01:03 +0800
commitceb6d34906c7c03c102c7e78dd02f5b0ebab4ca9 (patch)
tree061792f65d8f8c0daffeabd24ee0be8531fba533 /src/gallium/state_trackers/vega/paint.c
parentbdddf1cc26541d730bac309bd63dfdcaf4aea513 (diff)
st/vega: fix vg_context_is_object_valid()
vg_context_is_object_valid() checks if a handle is valid by checking if the handle is a valid key of the object hash table. However, the keys of the object hash table were object pointers. Fix vg_context_add_object() to use the handles as the keys so that vg_context_is_object_valid() works. This bug was introduced by 99c67f27d35a4bbbbefada8117d5972c7583cf42.
Diffstat (limited to 'src/gallium/state_trackers/vega/paint.c')
-rw-r--r--src/gallium/state_trackers/vega/paint.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gallium/state_trackers/vega/paint.c b/src/gallium/state_trackers/vega/paint.c
index 6e5348a1ff2..ea551811fcd 100644
--- a/src/gallium/state_trackers/vega/paint.c
+++ b/src/gallium/state_trackers/vega/paint.c
@@ -199,7 +199,7 @@ struct vg_paint * paint_create(struct vg_context *ctx)
const VGfloat def_ling[] = {0.0f, 0.0f, 1.0f, 0.0f};
const VGfloat def_radg[] = {0.0f, 0.0f, 0.0f, 0.0f, 1.0f};
vg_init_object(&paint->base, ctx, VG_OBJECT_PAINT);
- vg_context_add_object(ctx, VG_OBJECT_PAINT, paint);
+ vg_context_add_object(ctx, &paint->base);
paint->type = VG_PAINT_TYPE_COLOR;
memcpy(paint->solid.color, default_color,
@@ -230,7 +230,7 @@ void paint_destroy(struct vg_paint *paint)
if (paint->pattern.sampler_view)
pipe_sampler_view_reference(&paint->pattern.sampler_view, NULL);
if (ctx)
- vg_context_remove_object(ctx, VG_OBJECT_PAINT, paint);
+ vg_context_remove_object(ctx, &paint->base);
free(paint->gradient.ramp_stopsi);
free(paint->gradient.ramp_stops);