VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/xorg-server-1.9.0/renderedge.h@ 38889

Last change on this file since 38889 was 32163, checked in by vboxsync, 14 years ago

Additions/x11/x11include: additional headers for building drivers for X.Org Server 1.9

  • Property svn:eol-style set to native
File size: 3.2 KB
Line 
1/*
2 * Copyright © 2004 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
7 * copyright notice and this permission notice appear in supporting
8 * documentation, and that the name of Keith Packard not be used in
9 * advertising or publicity pertaining to distribution of the software without
10 * specific, written prior permission. Keith Packard makes no
11 * representations about the suitability of this software for any purpose. It
12 * is provided "as is" without express or implied warranty.
13 *
14 * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
15 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
16 * EVENT SHALL KEITH PACKARD 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
20 * PERFORMANCE OF THIS SOFTWARE.
21 */
22
23#ifndef _RENDEREDGE_H_
24#define _RENDEREDGE_H_
25
26#include "picturestr.h"
27
28#define MAX_ALPHA(n) ((1 << (n)) - 1)
29#define N_Y_FRAC(n) ((n) == 1 ? 1 : (1 << ((n)/2)) - 1)
30#define N_X_FRAC(n) ((1 << ((n)/2)) + 1)
31
32#define STEP_Y_SMALL(n) (xFixed1 / N_Y_FRAC(n))
33#define STEP_Y_BIG(n) (xFixed1 - (N_Y_FRAC(n) - 1) * STEP_Y_SMALL(n))
34
35#define Y_FRAC_FIRST(n) (STEP_Y_SMALL(n) / 2)
36#define Y_FRAC_LAST(n) (Y_FRAC_FIRST(n) + (N_Y_FRAC(n) - 1) * STEP_Y_SMALL(n))
37
38#define STEP_X_SMALL(n) (xFixed1 / N_X_FRAC(n))
39#define STEP_X_BIG(n) (xFixed1 - (N_X_FRAC(n) - 1) * STEP_X_SMALL(n))
40
41#define X_FRAC_FIRST(n) (STEP_X_SMALL(n) / 2)
42#define X_FRAC_LAST(n) (X_FRAC_FIRST(n) + (N_X_FRAC(n) - 1) * STEP_X_SMALL(n))
43
44#define RenderSamplesX(x,n) ((n) == 1 ? 0 : (xFixedFrac (x) + X_FRAC_FIRST(n)) / STEP_X_SMALL(n))
45
46/*
47 * An edge structure. This represents a single polygon edge
48 * and can be quickly stepped across small or large gaps in the
49 * sample grid
50 */
51typedef pixman_edge_t RenderEdge;
52
53/*
54 * Step across a small sample grid gap
55 */
56#define RenderEdgeStepSmall(edge) { \
57 edge->x += edge->stepx_small; \
58 edge->e += edge->dx_small; \
59 if (edge->e > 0) \
60 { \
61 edge->e -= edge->dy; \
62 edge->x += edge->signdx; \
63 } \
64}
65
66/*
67 * Step across a large sample grid gap
68 */
69#define RenderEdgeStepBig(edge) { \
70 edge->x += edge->stepx_big; \
71 edge->e += edge->dx_big; \
72 if (edge->e > 0) \
73 { \
74 edge->e -= edge->dy; \
75 edge->x += edge->signdx; \
76 } \
77}
78
79extern _X_EXPORT xFixed
80RenderSampleCeilY (xFixed y, int bpp);
81
82extern _X_EXPORT xFixed
83RenderSampleFloorY (xFixed y, int bpp);
84
85extern _X_EXPORT void
86RenderEdgeStep (RenderEdge *e, int n);
87
88extern _X_EXPORT void
89RenderEdgeInit (RenderEdge *e,
90 int bpp,
91 xFixed y_start,
92 xFixed x_top,
93 xFixed y_top,
94 xFixed x_bot,
95 xFixed y_bot);
96
97extern _X_EXPORT void
98RenderLineFixedEdgeInit (RenderEdge *e,
99 int bpp,
100 xFixed y,
101 xLineFixed *line,
102 int x_off,
103 int y_off);
104
105#endif /* _RENDEREDGE_H_ */
Note: See TracBrowser for help on using the repository browser.

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