summaryrefslogtreecommitdiff
path: root/src/gallium/state_trackers/vega/vg_context.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2011-01-23 11:47:03 -0700
committerBrian Paul <brianp@vmware.com>2011-01-24 18:12:49 -0700
commitd41e694cf78ada8c9258f96995115c9da8437894 (patch)
treeb818c672d45a672b2ccdabf55668317afdc243e7 /src/gallium/state_trackers/vega/vg_context.c
parent4324d6fdfbba17e66b476cf008713d26cac83ad1 (diff)
vega: replace casts with pointer/handle conversion functions
Per the spec, all OpenVG handles are 32-bit. We can't just cast them to/from integers on 64-bit systems. Start fixing that mess by introducing a set of handle/pointer conversion functions in handle.h. The next step is to implement a handle/pointer hash table...
Diffstat (limited to 'src/gallium/state_trackers/vega/vg_context.c')
-rw-r--r--src/gallium/state_trackers/vega/vg_context.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gallium/state_trackers/vega/vg_context.c b/src/gallium/state_trackers/vega/vg_context.c
index f36f55d6c8..a573577fa2 100644
--- a/src/gallium/state_trackers/vega/vg_context.c
+++ b/src/gallium/state_trackers/vega/vg_context.c
@@ -33,6 +33,7 @@
#include "vg_manager.h"
#include "api.h"
#include "mask.h"
+#include "handle.h"
#include "pipe/p_context.h"
#include "util/u_inlines.h"
@@ -186,13 +187,13 @@ void vg_init_object(struct vg_object *obj, struct vg_context *ctx, enum vg_objec
VGboolean vg_context_is_object_valid(struct vg_context *ctx,
enum vg_object_type type,
- void *ptr)
+ VGHandle object)
{
if (ctx) {
struct cso_hash *hash = ctx->owned_objects[type];
if (!hash)
return VG_FALSE;
- return cso_hash_contains(hash, (unsigned)(long)ptr);
+ return cso_hash_contains(hash, (unsigned)(long)object);
}
return VG_FALSE;
}
@@ -412,10 +413,10 @@ void vg_validate_state(struct vg_context *ctx)
shader_set_color_transform(ctx->shader, ctx->state.vg.color_transform);
}
-VGboolean vg_object_is_valid(void *ptr, enum vg_object_type type)
+VGboolean vg_object_is_valid(VGHandle object, enum vg_object_type type)
{
- struct vg_object *obj = ptr;
- if (ptr && is_aligned(obj) && obj->type == type)
+ struct vg_object *obj = handle_to_object(object);
+ if (object && is_aligned(obj) && obj->type == type)
return VG_TRUE;
else
return VG_FALSE;