1 /**************************************************************************
3 * Copyright 2009 VMware, Inc. All Rights Reserved.
4 * Copyright 2010 LunarG, Inc. All Rights Reserved.
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:
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
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.
26 **************************************************************************/
31 #include "VG/openvg.h"
37 struct pipe_sampler_state
;
38 struct pipe_sampler_view
;
41 struct renderer
*renderer_create(struct vg_context
*owner
);
42 void renderer_destroy(struct renderer
*);
44 VGboolean
renderer_copy_begin(struct renderer
*renderer
,
45 struct pipe_surface
*dst
,
47 struct pipe_sampler_view
*src
);
49 void renderer_copy(struct renderer
*renderer
,
50 VGint x
, VGint y
, VGint w
, VGint h
,
51 VGint sx
, VGint sy
, VGint sw
, VGint sh
);
53 void renderer_copy_end(struct renderer
*renderer
);
55 VGboolean
renderer_drawtex_begin(struct renderer
*renderer
,
56 struct pipe_sampler_view
*src
);
58 void renderer_drawtex(struct renderer
*renderer
,
59 VGint x
, VGint y
, VGint w
, VGint h
,
60 VGint sx
, VGint sy
, VGint sw
, VGint sh
);
62 void renderer_drawtex_end(struct renderer
*renderer
);
64 VGboolean
renderer_scissor_begin(struct renderer
*renderer
,
65 VGboolean restore_dsa
);
67 void renderer_scissor(struct renderer
*renderer
,
68 VGint x
, VGint y
, VGint width
, VGint height
);
70 void renderer_scissor_end(struct renderer
*renderer
);
72 VGboolean
renderer_clear_begin(struct renderer
*renderer
);
74 void renderer_clear(struct renderer
*renderer
,
75 VGint x
, VGint y
, VGint width
, VGint height
,
76 const VGfloat color
[4]);
78 void renderer_clear_end(struct renderer
*renderer
);
80 VGboolean
renderer_filter_begin(struct renderer
*renderer
,
81 struct pipe_resource
*dst
,
83 VGbitfield channel_mask
,
84 const struct pipe_sampler_state
**samplers
,
85 struct pipe_sampler_view
**views
,
88 const void *const_buffer
,
89 VGint const_buffer_len
);
91 void renderer_filter(struct renderer
*renderer
,
92 VGint x
, VGint y
, VGint w
, VGint h
,
93 VGint sx
, VGint sy
, VGint sw
, VGint sh
);
95 void renderer_filter_end(struct renderer
*renderer
);
97 void renderer_draw_quad(struct renderer
*,
98 VGfloat x1
, VGfloat y1
,
99 VGfloat x2
, VGfloat y2
,
101 void renderer_draw_texture(struct renderer
*,
102 struct pipe_resource
*texture
,
103 VGfloat x1offset
, VGfloat y1offset
,
104 VGfloat x2offset
, VGfloat y2offset
,
105 VGfloat x1
, VGfloat y1
,
106 VGfloat x2
, VGfloat y2
);
107 void renderer_texture_quad(struct renderer
*,
108 struct pipe_resource
*texture
,
109 VGfloat x1offset
, VGfloat y1offset
,
110 VGfloat x2offset
, VGfloat y2offset
,
111 VGfloat x1
, VGfloat y1
,
112 VGfloat x2
, VGfloat y2
,
113 VGfloat x3
, VGfloat y3
,
114 VGfloat x4
, VGfloat y4
);
115 void renderer_copy_texture(struct renderer
*r
,
116 struct pipe_sampler_view
*src
,
117 VGfloat sx1
, VGfloat sy1
,
118 VGfloat sx2
, VGfloat sy2
,
119 struct pipe_resource
*dst
,
120 VGfloat dx1
, VGfloat dy1
,
121 VGfloat dx2
, VGfloat dy2
);
122 void renderer_copy_surface(struct renderer
*r
,
123 struct pipe_surface
*src
,
126 struct pipe_surface
*dst
,
129 float z
, unsigned filter
);