Merge remote branch 'origin/mesa_7_6_branch'
[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 /* we should combine these two */
20 float vertices2[4][2][4];
21 float vertices3[4][3][4];
22 };
23
24 struct xorg_renderer *renderer_create(struct pipe_context *pipe);
25 void renderer_destroy(struct xorg_renderer *renderer);
26
27 void renderer_bind_framebuffer(struct xorg_renderer *r,
28 struct exa_pixmap_priv *priv);
29 void renderer_bind_viewport(struct xorg_renderer *r,
30 struct exa_pixmap_priv *dst);
31 void renderer_bind_rasterizer(struct xorg_renderer *r);
32 void renderer_set_constants(struct xorg_renderer *r,
33 int shader_type,
34 const float *buffer,
35 int size);
36 void renderer_copy_pixmap(struct xorg_renderer *r,
37 struct exa_pixmap_priv *dst_priv, int dx, int dy,
38 struct exa_pixmap_priv *src_priv, int sx, int sy,
39 int width, int height);
40
41 void renderer_draw_solid_rect(struct xorg_renderer *r,
42 int x0, int y0,
43 int x1, int y1,
44 float *color);
45
46 void renderer_draw_textures(struct xorg_renderer *r,
47 int *pos,
48 int width, int height,
49 struct pipe_texture **textures,
50 int num_textures,
51 float *src_matrix,
52 float *mask_matrix);
53
54
55 #endif