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/openvg.h"
31 #include "api_consts.h"
38 void (*begin
)(struct stroker
*stroker
);
39 void (*process_subpath
)(struct stroker
*stroker
);
40 void (*end
)(struct stroker
*stroker
);
42 struct array
*segments
;
43 struct array
*control_points
;
46 VGfloat back1_x
, back1_y
;
47 VGfloat back2_x
, back2_y
;
52 VGJoinStyle join_style
;
54 VGPathCommand last_cmd
;
60 struct stroker stroker
;
62 VGfloat dash_pattern
[VEGA_MAX_DASH_COUNT
];
63 VGint dash_pattern_num
;
65 VGboolean dash_phase_reset
;
68 void stroker_init(struct stroker
*stroker
,
69 struct vg_state
*state
);
70 void dash_stroker_init(struct stroker
*stroker
,
71 struct vg_state
*state
);
72 void dash_stroker_cleanup(struct dash_stroker
*stroker
);
73 void stroker_cleanup(struct stroker
*stroker
);
75 void stroker_begin(struct stroker
*stroker
);
76 void stroker_move_to(struct stroker
*stroker
, VGfloat x
, VGfloat y
);
77 void stroker_line_to(struct stroker
*stroker
, VGfloat x
, VGfloat y
);
78 void stroker_curve_to(struct stroker
*stroker
, VGfloat px1
, VGfloat py1
,
79 VGfloat px2
, VGfloat py2
,
80 VGfloat x
, VGfloat y
);
81 void stroker_end(struct stroker
*stroker
);
83 void stroker_emit_move_to(struct stroker
*stroker
, VGfloat x
, VGfloat y
);
84 void stroker_emit_line_to(struct stroker
*stroker
, VGfloat x
, VGfloat y
);
85 void stroker_emit_curve_to(struct stroker
*stroker
, VGfloat px1
, VGfloat py1
,
86 VGfloat px2
, VGfloat py2
,
87 VGfloat x
, VGfloat y
);