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"
32 #include "api_consts.h"
43 VGMatrixMode matrix_mode
;
45 VGImageQuality image_quality
;
46 VGRenderingQuality rendering_quality
;
47 VGBlendMode blend_mode
;
48 VGImageMode image_mode
;
50 /* Scissoring rectangles */
51 struct vg_value scissor_rects
[32*4];
52 VGint scissor_rects_num
;
54 /* Color Transformation */
55 VGboolean color_transform
;
56 VGfloat color_transform_values
[8];
58 /* Stroke parameters */
60 struct vg_value line_width
;
62 VGJoinStyle join_style
;
63 struct vg_value miter_limit
;
64 struct vg_value dash_pattern
[VEGA_MAX_DASH_COUNT
];
65 VGint dash_pattern_num
;
66 struct vg_value dash_phase
;
67 VGboolean dash_phase_reset
;
70 /* Edge fill color for VG_TILE_FILL tiling mode */
71 VGfloat tile_fill_color
[4];
72 VGint tile_fill_colori
[4];
74 /* Color for vgClear */
75 VGfloat clear_color
[4];
76 VGint clear_colori
[4];
79 struct vg_value glyph_origin
[2];
81 /* Enable/disable alpha masking and scissoring */
85 /* Pixel layout information */
86 VGPixelLayout pixel_layout
;
87 VGPixelLayout screen_layout
;
89 /* Source format selection for image filters */
90 VGboolean filter_format_linear
;
91 VGboolean filter_format_premultiplied
;
93 /* Destination write enable mask for image filters */
94 VGbitfield filter_channel_mask
;
96 struct matrix path_user_to_surface_matrix
;
97 struct matrix image_user_to_surface_matrix
;
98 struct matrix fill_paint_to_user_matrix
;
99 struct matrix stroke_paint_to_user_matrix
;
100 struct matrix glyph_user_to_surface_matrix
;
102 struct vg_paint
*stroke_paint
;
103 struct vg_paint
*fill_paint
;
106 void vg_init_state(struct vg_state
*state
);
107 struct matrix
* vg_state_matrix(struct vg_state
*state
);