1 /**************************************************************************
3 * Copyright 2009 VMware, Inc. All Rights Reserved.
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:
13 * The above copyright notice and this permission notice (including the
14 * next paragraph) shall be included in all copies or substantial portions
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.
25 **************************************************************************/
30 #include "vg_context.h"
32 #include "VG/openvg.h"
33 #include "pipe/p_state.h"
37 struct pipe_sampler_state
;
40 struct vg_paint
*paint_create(struct vg_context
*ctx
);
41 void paint_destroy(struct vg_paint
*paint
);
43 void paint_set_color(struct vg_paint
*paint
,
44 const VGfloat
*color
);
45 void paint_get_color(struct vg_paint
*paint
,
48 void paint_set_coloriv(struct vg_paint
*paint
,
50 void paint_get_coloriv(struct vg_paint
*paint
,
53 void paint_set_colori(struct vg_paint
*paint
,
56 VGuint
paint_colori(struct vg_paint
*paint
);
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
);
62 void paint_set_linear_gradient(struct vg_paint
*paint
,
63 const VGfloat
*coords
);
64 void paint_linear_gradient(struct vg_paint
*paint
,
66 void paint_set_linear_gradienti(struct vg_paint
*paint
,
68 void paint_linear_gradienti(struct vg_paint
*paint
,
72 void paint_set_radial_gradient(struct vg_paint
*paint
,
73 const VGfloat
*values
);
74 void paint_radial_gradient(struct vg_paint
*paint
,
76 void paint_set_radial_gradienti(struct vg_paint
*paint
,
78 void paint_radial_gradienti(struct vg_paint
*paint
,
82 void paint_set_ramp_stops(struct vg_paint
*paint
, const VGfloat
*stops
,
84 void paint_ramp_stops(struct vg_paint
*paint
, VGfloat
*stops
,
87 void paint_set_ramp_stopsi(struct vg_paint
*paint
, const VGint
*stops
,
89 void paint_ramp_stopsi(struct vg_paint
*paint
, VGint
*stops
,
92 int paint_num_ramp_stops(struct vg_paint
*paint
);
94 void paint_set_spread_mode(struct vg_paint
*paint
,
96 VGColorRampSpreadMode
paint_spread_mode(struct vg_paint
*paint
);
99 void paint_set_pattern(struct vg_paint
*paint
,
100 struct vg_image
*img
);
101 void paint_set_pattern_tiling(struct vg_paint
*paint
,
103 VGTilingMode
paint_pattern_tiling(struct vg_paint
*paint
);
105 void paint_set_color_ramp_premultiplied(struct vg_paint
*paint
,
107 VGboolean
paint_color_ramp_premultiplied(struct vg_paint
*paint
);
110 VGint
paint_bind_samplers(struct vg_paint
*paint
, struct pipe_sampler_state
**samplers
,
111 struct pipe_texture
**textures
);
113 VGint
paint_constant_buffer_size(struct vg_paint
*paint
);
114 void paint_fill_constant_buffer(struct vg_paint
*paint
,