st/xorg: unify vertex buffer handling
[mesa.git] / src / gallium / state_trackers / xorg / xorg_renderer.h
1 #ifndef XORG_RENDERER_H
2 #define XORG_RENDERER_H
3
4 #include "pipe/p_context.h"
5 #include "pipe/p_state.h"
6
7 struct xorg_shaders;
8 struct exa_pixmap_priv;
9
10 struct xorg_renderer {
11 struct pipe_context *pipe;
12
13 struct cso_context *cso;
14 struct xorg_shaders *shaders;
15
16 struct pipe_constant_buffer vs_const_buffer;
17 struct pipe_constant_buffer fs_const_buffer;
18
19 float vertices[4*3*4];
20 };
21
22 struct xorg_renderer *renderer_create(struct pipe_context *pipe);
23 void renderer_destroy(struct xorg_renderer *renderer);
24
25 void renderer_bind_framebuffer(struct xorg_renderer *r,
26 struct exa_pixmap_priv *priv);
27 void renderer_bind_viewport(struct xorg_renderer *r,
28 struct exa_pixmap_priv *dst);
29 void renderer_bind_rasterizer(struct xorg_renderer *r);
30 void renderer_set_constants(struct xorg_renderer *r,
31 int shader_type,
32 const float *buffer,
33 int size);
34 void renderer_copy_pixmap(struct xorg_renderer *r,
35 struct exa_pixmap_priv *dst_priv, int dx, int dy,
36 struct exa_pixmap_priv *src_priv, int sx, int sy,
37 int width, int height);
38
39 void renderer_draw_solid_rect(struct xorg_renderer *r,
40 int x0, int y0,
41 int x1, int y1,
42 float *color);
43
44 void renderer_draw_textures(struct xorg_renderer *r,
45 int *pos,
46 int width, int height,
47 struct pipe_texture **textures,
48 int num_textures,
49 float *src_matrix,
50 float *mask_matrix);
51
52 void renderer_draw_yuv(struct xorg_renderer *r,
53 int src_x, int src_y, int src_w, int src_h,
54 int dst_x, int dst_y, int dst_w, int dst_h,
55 struct pipe_texture **textures);
56
57
58 #endif