VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/xorg-server-1.18.0/glamor_program.h

Last change on this file was 58634, checked in by vboxsync, 10 years ago

Additions/x11: added header files for building X.Org video driver against X.Org Server 1.18.

  • Property svn:eol-style set to native
File size: 5.6 KB
Line 
1/*
2 * Copyright © 2014 Keith Packard
3 *
4 * Permission to use, copy, modify, distribute, and sell this software and its
5 * documentation for any purpose is hereby granted without fee, provided that
6 * the above copyright notice appear in all copies and that both that copyright
7 * notice and this permission notice appear in supporting documentation, and
8 * that the name of the copyright holders not be used in advertising or
9 * publicity pertaining to distribution of the software without specific,
10 * written prior permission. The copyright holders make no representations
11 * about the suitability of this software for any purpose. It is provided "as
12 * is" without express or implied warranty.
13 *
14 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
15 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
16 * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
17 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
18 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
19 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
20 * OF THIS SOFTWARE.
21 */
22
23#ifndef _GLAMOR_PROGRAM_H_
24#define _GLAMOR_PROGRAM_H_
25
26typedef enum {
27 glamor_program_location_none = 0,
28 glamor_program_location_fg = 1,
29 glamor_program_location_bg = 2,
30 glamor_program_location_fillsamp = 4,
31 glamor_program_location_fillpos = 8,
32 glamor_program_location_font = 16,
33 glamor_program_location_bitplane = 32,
34 glamor_program_location_dash = 64,
35 glamor_program_location_atlas = 128,
36} glamor_program_location;
37
38typedef enum {
39 glamor_program_flag_none = 0,
40} glamor_program_flag;
41
42typedef enum {
43 glamor_program_alpha_normal,
44 glamor_program_alpha_ca_first,
45 glamor_program_alpha_ca_second,
46 glamor_program_alpha_count
47} glamor_program_alpha;
48
49typedef struct _glamor_program glamor_program;
50
51typedef Bool (*glamor_use) (PixmapPtr pixmap, GCPtr gc, glamor_program *prog, void *arg);
52
53typedef Bool (*glamor_use_render) (CARD8 op, PicturePtr src, PicturePtr dst, glamor_program *prog);
54
55typedef struct {
56 const char *name;
57 const int version;
58 char *vs_defines;
59 char *fs_defines;
60 const char *vs_vars;
61 const char *vs_exec;
62 const char *fs_vars;
63 const char *fs_exec;
64 const glamor_program_location locations;
65 const glamor_program_flag flags;
66 const char *source_name;
67 glamor_use use;
68 glamor_use_render use_render;
69} glamor_facet;
70
71struct _glamor_program {
72 GLint prog;
73 GLint failed;
74 GLint matrix_uniform;
75 GLint fg_uniform;
76 GLint bg_uniform;
77 GLint fill_size_inv_uniform;
78 GLint fill_offset_uniform;
79 GLint font_uniform;
80 GLint bitplane_uniform;
81 GLint bitmul_uniform;
82 GLint dash_uniform;
83 GLint dash_length_uniform;
84 GLint atlas_uniform;
85 glamor_program_location locations;
86 glamor_program_flag flags;
87 glamor_use prim_use;
88 glamor_use fill_use;
89 glamor_program_alpha alpha;
90 glamor_use_render prim_use_render;
91 glamor_use_render fill_use_render;
92};
93
94typedef struct {
95 glamor_program progs[4];
96} glamor_program_fill;
97
98extern const glamor_facet glamor_fill_solid;
99
100Bool
101glamor_build_program(ScreenPtr screen,
102 glamor_program *prog,
103 const glamor_facet *prim,
104 const glamor_facet *fill,
105 const char *combine,
106 const char *defines);
107
108Bool
109glamor_use_program(PixmapPtr pixmap,
110 GCPtr gc,
111 glamor_program *prog,
112 void *arg);
113
114glamor_program *
115glamor_use_program_fill(PixmapPtr pixmap,
116 GCPtr gc,
117 glamor_program_fill *program_fill,
118 const glamor_facet *prim);
119
120typedef enum {
121 glamor_program_source_solid,
122 glamor_program_source_picture,
123 glamor_program_source_1x1_picture,
124 glamor_program_source_count,
125} glamor_program_source;
126
127typedef struct {
128 glamor_program progs[glamor_program_source_count][glamor_program_alpha_count];
129} glamor_program_render;
130
131static inline Bool
132glamor_is_component_alpha(PicturePtr mask) {
133 if (mask && mask->componentAlpha && PICT_FORMAT_RGB(mask->format))
134 return TRUE;
135 return FALSE;
136}
137
138glamor_program *
139glamor_setup_program_render(CARD8 op,
140 PicturePtr src,
141 PicturePtr mask,
142 PicturePtr dst,
143 glamor_program_render *program_render,
144 const glamor_facet *prim,
145 const char *defines);
146
147Bool
148glamor_use_program_render(glamor_program *prog,
149 CARD8 op,
150 PicturePtr src,
151 PicturePtr dst);
152
153#endif /* _GLAMOR_PROGRAM_H_ */
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette