ilo: replace a boolean by bool
[mesa.git] / src / gallium / state_trackers / vega / vg_context.h
index 07f3ca76beba52b25856091cf8babdc6a3214bf2..d61c7cfeff15ce1334ed8166db512fde29276565 100644 (file)
@@ -56,7 +56,7 @@ struct st_framebuffer {
    struct st_renderbuffer *strb;
    struct st_renderbuffer *dsrb;
 
-   struct pipe_sampler_view *alpha_mask_view;
+   struct pipe_sampler_view *surface_mask_view;
 
    struct pipe_sampler_view *blend_texture_view;
 
@@ -65,6 +65,8 @@ struct st_framebuffer {
    enum st_attachment_type strb_att;
 
    void *privateData;
+   int32_t stamp;
+   int32_t iface_stamp;
 };
 
 enum vg_object_type {
@@ -78,14 +80,15 @@ enum vg_object_type {
    VG_OBJECT_LAST
 };
 enum dirty_state {
-   NONE_DIRTY          = 0<<0,
-   BLEND_DIRTY         = 1<<1,
-   RASTERIZER_DIRTY    = 1<<2,
-   FRAMEBUFFER_DIRTY   = 1<<3,
-   VS_DIRTY            = 1<<4,
-   DEPTH_STENCIL_DIRTY = 1<<5,
-   ALL_DIRTY           = BLEND_DIRTY | RASTERIZER_DIRTY |
-   FRAMEBUFFER_DIRTY | VS_DIRTY | DEPTH_STENCIL_DIRTY
+   BLEND_DIRTY         = 1 << 0,
+   FRAMEBUFFER_DIRTY   = 1 << 1,
+   DEPTH_STENCIL_DIRTY = 1 << 2,
+   PAINT_DIRTY         = 1 << 3,
+
+   ALL_DIRTY           = BLEND_DIRTY |
+                         FRAMEBUFFER_DIRTY |
+                         DEPTH_STENCIL_DIRTY |
+                         PAINT_DIRTY
 };
 
 struct vg_context
@@ -104,7 +107,6 @@ struct vg_context
    VGErrorCode _error;
 
    struct st_framebuffer *draw_buffer;
-   int32_t draw_buffer_invalid;
 
    struct cso_hash *owned_objects[VG_OBJECT_LAST];
 
@@ -128,14 +130,25 @@ struct vg_context
    struct vg_paint *default_paint;
 
    struct blit_state *blit;
+
+   int32_t draw_stamp;
 };
 
+
+/**
+ *  Base class for VG objects like paths, images, fonts.
+ */
 struct vg_object {
    enum vg_object_type type;
+   VGHandle handle;
    struct vg_context *ctx;
 };
+
+
 void vg_init_object(struct vg_object *obj, struct vg_context *ctx, enum vg_object_type type);
-VGboolean vg_object_is_valid(void *ptr, enum vg_object_type type);
+void vg_free_object(struct vg_object *obj);
+
+VGboolean vg_object_is_valid(VGHandle object, enum vg_object_type type);
 
 struct vg_context *vg_create_context(struct pipe_context *pipe,
                                      const void *visual,
@@ -146,22 +159,26 @@ void vg_set_current_context(struct vg_context *ctx);
 
 VGboolean vg_context_is_object_valid(struct vg_context *ctx,
                                      enum vg_object_type type,
-                                     void *ptr);
+                                     VGHandle object);
 void vg_context_add_object(struct vg_context *ctx,
-                           enum vg_object_type type,
-                           void *ptr);
+                           struct vg_object *obj);
 void vg_context_remove_object(struct vg_context *ctx,
-                              enum vg_object_type type,
-                              void *ptr);
+                              struct vg_object *obj);
 
 void vg_validate_state(struct vg_context *ctx);
 
 void vg_set_error(struct vg_context *ctx,
                   VGErrorCode code);
 
-void vg_prepare_blend_surface(struct vg_context *ctx);
-void vg_prepare_blend_surface_from_mask(struct vg_context *ctx);
+struct pipe_sampler_view *vg_prepare_blend_surface(struct vg_context *ctx);
+struct pipe_sampler_view *vg_prepare_blend_surface_from_mask(struct vg_context *ctx);
+
+struct pipe_sampler_view *vg_get_surface_mask(struct vg_context *ctx);
 
+VGboolean vg_get_paint_matrix(struct vg_context *ctx,
+                              const struct matrix *paint_to_user,
+                              const struct matrix *user_to_surface,
+                              struct matrix *mat);
 
 static INLINE VGboolean is_aligned_to(const void *ptr, VGbyte alignment)
 {