st/vega: Add SCISSOR renderer state.
[mesa.git] / src / gallium / state_trackers / vega / renderer.h
1 /**************************************************************************
2 *
3 * Copyright 2009 VMware, Inc. All Rights Reserved.
4 * Copyright 2010 LunarG, Inc. All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
13 *
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
16 * of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 *
26 **************************************************************************/
27
28 #ifndef RENDERER_H
29 #define RENDERER_H
30
31 #include "VG/openvg.h"
32
33 struct renderer;
34
35 struct vg_context;
36 struct pipe_resource;
37 struct pipe_sampler_view;
38 struct pipe_surface;
39
40 struct renderer *renderer_create(struct vg_context *owner);
41 void renderer_destroy(struct renderer *);
42
43 VGboolean renderer_copy_begin(struct renderer *renderer,
44 struct pipe_surface *dst,
45 VGboolean y0_top,
46 struct pipe_sampler_view *src);
47
48 void renderer_copy(struct renderer *renderer,
49 VGint x, VGint y, VGint w, VGint h,
50 VGint sx, VGint sy, VGint sw, VGint sh);
51
52 void renderer_copy_end(struct renderer *renderer);
53
54 VGboolean renderer_drawtex_begin(struct renderer *renderer,
55 struct pipe_sampler_view *src);
56
57 void renderer_drawtex(struct renderer *renderer,
58 VGint x, VGint y, VGint w, VGint h,
59 VGint sx, VGint sy, VGint sw, VGint sh);
60
61 void renderer_drawtex_end(struct renderer *renderer);
62
63 VGboolean renderer_scissor_begin(struct renderer *renderer,
64 VGboolean restore_dsa);
65
66 void renderer_scissor(struct renderer *renderer,
67 VGint x, VGint y, VGint width, VGint height);
68
69 void renderer_scissor_end(struct renderer *renderer);
70
71 void renderer_draw_quad(struct renderer *,
72 VGfloat x1, VGfloat y1,
73 VGfloat x2, VGfloat y2,
74 VGfloat depth);
75 void renderer_draw_texture(struct renderer *,
76 struct pipe_resource *texture,
77 VGfloat x1offset, VGfloat y1offset,
78 VGfloat x2offset, VGfloat y2offset,
79 VGfloat x1, VGfloat y1,
80 VGfloat x2, VGfloat y2);
81 void renderer_texture_quad(struct renderer *,
82 struct pipe_resource *texture,
83 VGfloat x1offset, VGfloat y1offset,
84 VGfloat x2offset, VGfloat y2offset,
85 VGfloat x1, VGfloat y1,
86 VGfloat x2, VGfloat y2,
87 VGfloat x3, VGfloat y3,
88 VGfloat x4, VGfloat y4);
89 void renderer_copy_texture(struct renderer *r,
90 struct pipe_sampler_view *src,
91 VGfloat sx1, VGfloat sy1,
92 VGfloat sx2, VGfloat sy2,
93 struct pipe_resource *dst,
94 VGfloat dx1, VGfloat dy1,
95 VGfloat dx2, VGfloat dy2);
96 void renderer_copy_surface(struct renderer *r,
97 struct pipe_surface *src,
98 int sx1, int sy1,
99 int sx2, int sy2,
100 struct pipe_surface *dst,
101 int dx1, int dy1,
102 int dx2, int dy2,
103 float z, unsigned filter);
104
105
106 #endif