Merge branch 'mesa_7_5_branch' into mesa_7_6_branch
[mesa.git] / src / gallium / state_trackers / vega / paint.h
1 /**************************************************************************
2 *
3 * Copyright 2009 VMware, Inc. All Rights Reserved.
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the
7 * "Software"), to deal in the Software without restriction, including
8 * without limitation the rights to use, copy, modify, merge, publish,
9 * distribute, sub license, and/or sell copies of the Software, and to
10 * permit persons to whom the Software is furnished to do so, subject to
11 * the following conditions:
12 *
13 * The above copyright notice and this permission notice (including the
14 * next paragraph) shall be included in all copies or substantial portions
15 * of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
20 * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
21 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 *
25 **************************************************************************/
26
27 #ifndef PAINT_H
28 #define PAINT_H
29
30 #include "vg_context.h"
31
32 #include "VG/openvg.h"
33 #include "pipe/p_state.h"
34
35 struct vg_paint;
36 struct vg_image;
37 struct pipe_sampler_state;
38 struct pipe_texture;
39
40 struct vg_paint *paint_create(struct vg_context *ctx);
41 void paint_destroy(struct vg_paint *paint);
42
43 void paint_set_color(struct vg_paint *paint,
44 const VGfloat *color);
45 void paint_get_color(struct vg_paint *paint,
46 VGfloat *color);
47
48 void paint_set_coloriv(struct vg_paint *paint,
49 const VGint *color);
50 void paint_get_coloriv(struct vg_paint *paint,
51 VGint *color);
52
53 void paint_set_colori(struct vg_paint *paint,
54 VGuint rgba);
55
56 VGuint paint_colori(struct vg_paint *paint);
57
58 void paint_set_type(struct vg_paint *paint, VGPaintType type);
59 VGPaintType paint_type(struct vg_paint *paint);
60 void paint_resolve_type(struct vg_paint *paint);
61
62 void paint_set_linear_gradient(struct vg_paint *paint,
63 const VGfloat *coords);
64 void paint_linear_gradient(struct vg_paint *paint,
65 VGfloat *coords);
66 void paint_set_linear_gradienti(struct vg_paint *paint,
67 const VGint *coords);
68 void paint_linear_gradienti(struct vg_paint *paint,
69 VGint *coords);
70
71
72 void paint_set_radial_gradient(struct vg_paint *paint,
73 const VGfloat *values);
74 void paint_radial_gradient(struct vg_paint *paint,
75 VGfloat *coords);
76 void paint_set_radial_gradienti(struct vg_paint *paint,
77 const VGint *values);
78 void paint_radial_gradienti(struct vg_paint *paint,
79 VGint *coords);
80
81
82 void paint_set_ramp_stops(struct vg_paint *paint, const VGfloat *stops,
83 int num);
84 void paint_ramp_stops(struct vg_paint *paint, VGfloat *stops,
85 int num);
86
87 void paint_set_ramp_stopsi(struct vg_paint *paint, const VGint *stops,
88 int num);
89 void paint_ramp_stopsi(struct vg_paint *paint, VGint *stops,
90 int num);
91
92 int paint_num_ramp_stops(struct vg_paint *paint);
93
94 void paint_set_spread_mode(struct vg_paint *paint,
95 VGint mode);
96 VGColorRampSpreadMode paint_spread_mode(struct vg_paint *paint);
97
98
99 void paint_set_pattern(struct vg_paint *paint,
100 struct vg_image *img);
101 void paint_set_pattern_tiling(struct vg_paint *paint,
102 VGTilingMode mode);
103 VGTilingMode paint_pattern_tiling(struct vg_paint *paint);
104
105 void paint_set_color_ramp_premultiplied(struct vg_paint *paint,
106 VGboolean set);
107 VGboolean paint_color_ramp_premultiplied(struct vg_paint *paint);
108
109
110 VGint paint_bind_samplers(struct vg_paint *paint, struct pipe_sampler_state **samplers,
111 struct pipe_texture **textures);
112
113 VGint paint_constant_buffer_size(struct vg_paint *paint);
114 void paint_fill_constant_buffer(struct vg_paint *paint,
115 void *buffer);
116
117
118 #endif