2 * Copyright © 2004 David Reveman
4 * Permission to use, copy, modify, distribute, and sell this software
5 * and its documentation for any purpose is hereby granted without
6 * fee, provided that the above copyright notice appear in all copies
7 * and that both that copyright notice and this permission notice
8 * appear in supporting documentation, and that the name of
9 * David Reveman not be used in advertising or publicity pertaining to
10 * distribution of the software without specific, written prior permission.
11 * David Reveman makes no representations about the suitability of this
12 * software for any purpose. It is provided "as is" without express or
15 * DAVID REVEMAN DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
16 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
17 * NO EVENT SHALL DAVID REVEMAN BE LIABLE FOR ANY SPECIAL, INDIRECT OR
18 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
19 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
20 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
21 * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
23 * Author: David Reveman <davidr@novell.com>
28 #include <X11/fonts/fontstruct.h>
29 #include "dixfontstr.h"
32 xglSolid (DrawablePtr pDrawable
,
34 glitz_surface_t
*solid
,
35 xglGeometryPtr pGeometry
,
43 glitz_surface_t
*surface
;
49 if (!xglPrepareTarget (pDrawable
))
52 XGL_GET_DRAWABLE (pDrawable
, surface
, xOff
, yOff
);
56 glitz_surface_set_clip_region (surface
, xOff
, yOff
,
57 (glitz_box_t
*) pBox
, nBox
);
61 pGeometry
= xglGetScratchVertexGeometry (pDrawable
->pScreen
, 4 * nBox
);
62 GEOMETRY_ADD_BOX (pDrawable
->pScreen
, pGeometry
, pBox
, nBox
);
65 GEOMETRY_TRANSLATE (pGeometry
, xOff
, yOff
);
67 if (!GEOMETRY_ENABLE (pGeometry
, surface
))
78 glitz_surface_set_clip_region (surface
, 0, 0, NULL
, 0);
80 if (glitz_surface_get_status (surface
))
87 xglSolidGlyph (DrawablePtr pDrawable
,
95 xglGeometryRec geometry
;
97 int yBack
, heightBack
;
104 GEOMETRY_INIT (pDrawable
->pScreen
, &geometry
,
105 GLITZ_GEOMETRY_TYPE_BITMAP
,
106 GEOMETRY_USAGE_SYSMEM
, 0);
108 GEOMETRY_FOR_GLYPH (pDrawable
->pScreen
,
114 GEOMETRY_TRANSLATE (&geometry
, x
, y
);
118 widthBack
+= (*ppci
++)->metrics
.characterWidth
;
124 widthBack
= -widthBack
;
126 yBack
= y
- FONTASCENT (pGC
->font
);
127 heightBack
= FONTASCENT (pGC
->font
) + FONTDESCENT (pGC
->font
);
129 if (xglSolid (pDrawable
,
137 REGION_RECTS (pGC
->pCompositeClip
),
138 REGION_NUM_RECTS (pGC
->pCompositeClip
)))
140 if (xglSolid (pDrawable
,
148 REGION_RECTS (pGC
->pCompositeClip
),
149 REGION_NUM_RECTS (pGC
->pCompositeClip
)))
151 GEOMETRY_UNINIT (&geometry
);
152 xglAddCurrentBitDamage (pDrawable
);
157 GEOMETRY_UNINIT (&geometry
);