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_view
;
40 struct renderer
*renderer_create(struct vg_context
*owner
);
41 void renderer_destroy(struct renderer
*);
43 VGboolean
renderer_copy_begin(struct renderer
*renderer
,
44 struct pipe_surface
*dst
,
46 struct pipe_sampler_view
*src
);
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
);
52 void renderer_copy_end(struct renderer
*renderer
);
54 VGboolean
renderer_drawtex_begin(struct renderer
*renderer
,
55 struct pipe_sampler_view
*src
);
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
);
61 void renderer_drawtex_end(struct renderer
*renderer
);
63 VGboolean
renderer_scissor_begin(struct renderer
*renderer
,
64 VGboolean restore_dsa
);
66 void renderer_scissor(struct renderer
*renderer
,
67 VGint x
, VGint y
, VGint width
, VGint height
);
69 void renderer_scissor_end(struct renderer
*renderer
);
71 void renderer_draw_quad(struct renderer
*,
72 VGfloat x1
, VGfloat y1
,
73 VGfloat x2
, VGfloat y2
,
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
,
100 struct pipe_surface
*dst
,
103 float z
, unsigned filter
);