Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
c3f8226e
Commit
c3f8226e
authored
Jan 24, 2005
by
Glenn Wurster
Committed by
Alexandre Julliard
Jan 24, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Split caching of antialiased and non-antialiased glyphs.
parent
c173f6a7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
126 additions
and
92 deletions
+126
-92
xrender.c
dlls/x11drv/xrender.c
+126
-92
No files found.
dlls/x11drv/xrender.c
View file @
c3f8226e
...
...
@@ -67,18 +67,23 @@ typedef struct
#define INITIAL_REALIZED_BUF_SIZE 128
typedef
enum
{
AA_None
,
AA_Grey
,
AA_RGB
,
AA_BGR
,
AA_VRGB
,
AA_VBGR
}
AA_Type
;
typedef
enum
{
AA_None
=
0
,
AA_Grey
,
AA_RGB
,
AA_BGR
,
AA_VRGB
,
AA_VBGR
,
AA_MAXVALUE
}
AA_Type
;
typedef
struct
{
LFANDSIZE
lfsz
;
AA_Type
aa
;
GlyphSet
glyphset
;
XRenderPictFormat
*
font_format
;
int
nrealized
;
BOOL
*
realized
;
void
**
bitmaps
;
XGlyphInfo
*
gis
;
}
gsCacheEntryFormat
;
typedef
struct
{
LFANDSIZE
lfsz
;
AA_Type
aa_default
;
gsCacheEntryFormat
*
format
[
AA_MAXVALUE
];
UINT
count
;
INT
next
;
}
gsCacheEntry
;
...
...
@@ -292,26 +297,39 @@ static int LookupEntry(LFANDSIZE *plfsz)
static
void
FreeEntry
(
int
entry
)
{
int
i
;
int
i
,
format
;
for
(
format
=
0
;
format
<
AA_MAXVALUE
;
format
++
)
{
gsCacheEntryFormat
*
formatEntry
;
if
(
glyphsetCache
[
entry
].
glyphset
)
{
wine_tsx11_lock
();
pXRenderFreeGlyphSet
(
gdi_display
,
glyphsetCache
[
entry
].
glyphset
);
wine_tsx11_unlock
();
glyphsetCache
[
entry
].
glyphset
=
0
;
}
if
(
glyphsetCache
[
entry
].
nrealized
)
{
HeapFree
(
GetProcessHeap
(),
0
,
glyphsetCache
[
entry
].
realized
);
glyphsetCache
[
entry
].
realized
=
NULL
;
if
(
glyphsetCache
[
entry
].
bitmaps
)
{
for
(
i
=
0
;
i
<
glyphsetCache
[
entry
].
nrealized
;
i
++
)
HeapFree
(
GetProcessHeap
(),
0
,
glyphsetCache
[
entry
].
bitmaps
[
i
]);
HeapFree
(
GetProcessHeap
(),
0
,
glyphsetCache
[
entry
].
bitmaps
);
glyphsetCache
[
entry
].
bitmaps
=
NULL
;
HeapFree
(
GetProcessHeap
(),
0
,
glyphsetCache
[
entry
].
gis
);
glyphsetCache
[
entry
].
gis
=
NULL
;
}
glyphsetCache
[
entry
].
nrealized
=
0
;
if
(
!
glyphsetCache
[
entry
].
format
[
format
]
)
continue
;
formatEntry
=
glyphsetCache
[
entry
].
format
[
format
];
if
(
formatEntry
->
glyphset
)
{
wine_tsx11_lock
();
pXRenderFreeGlyphSet
(
gdi_display
,
formatEntry
->
glyphset
);
wine_tsx11_unlock
();
formatEntry
->
glyphset
=
0
;
}
if
(
formatEntry
->
nrealized
)
{
HeapFree
(
GetProcessHeap
(),
0
,
formatEntry
->
realized
);
formatEntry
->
realized
=
NULL
;
if
(
formatEntry
->
bitmaps
)
{
for
(
i
=
0
;
i
<
formatEntry
->
nrealized
;
i
++
)
if
(
formatEntry
->
bitmaps
[
i
])
HeapFree
(
GetProcessHeap
(),
0
,
formatEntry
->
bitmaps
[
i
]);
HeapFree
(
GetProcessHeap
(),
0
,
formatEntry
->
bitmaps
);
formatEntry
->
bitmaps
=
NULL
;
HeapFree
(
GetProcessHeap
(),
0
,
formatEntry
->
gis
);
formatEntry
->
gis
=
NULL
;
}
formatEntry
->
nrealized
=
0
;
}
HeapFree
(
GetProcessHeap
(),
0
,
formatEntry
);
glyphsetCache
[
entry
].
format
[
format
]
=
NULL
;
}
}
...
...
@@ -385,6 +403,7 @@ static int AllocEntry(void)
static
int
GetCacheEntry
(
LFANDSIZE
*
plfsz
)
{
int
ret
;
int
format
;
gsCacheEntry
*
entry
;
if
((
ret
=
LookupEntry
(
plfsz
))
!=
-
1
)
return
ret
;
...
...
@@ -392,15 +411,15 @@ static int GetCacheEntry(LFANDSIZE *plfsz)
ret
=
AllocEntry
();
entry
=
glyphsetCache
+
ret
;
entry
->
lfsz
=
*
plfsz
;
assert
(
entry
->
nrealized
==
0
);
for
(
format
=
0
;
format
<
AA_MAXVALUE
;
format
++
)
{
assert
(
!
entry
->
format
[
format
]
);
}
if
(
antialias
)
entry
->
aa
=
AA_Grey
;
entry
->
aa
_default
=
AA_Grey
;
else
entry
->
aa
=
AA_None
;
entry
->
aa
_default
=
AA_None
;
entry
->
font_format
=
NULL
;
entry
->
glyphset
=
0
;
return
ret
;
}
...
...
@@ -527,7 +546,7 @@ void X11DRV_XRender_UpdateDrawable(X11DRV_PDEVICE *physDev)
*
* Helper to ExtTextOut. Must be called inside xrender_cs
*/
static
BOOL
UploadGlyph
(
X11DRV_PDEVICE
*
physDev
,
int
glyph
)
static
BOOL
UploadGlyph
(
X11DRV_PDEVICE
*
physDev
,
int
glyph
,
AA_Type
format
)
{
unsigned
int
buflen
;
char
*
buf
;
...
...
@@ -535,52 +554,61 @@ static BOOL UploadGlyph(X11DRV_PDEVICE *physDev, int glyph)
GLYPHMETRICS
gm
;
XGlyphInfo
gi
;
gsCacheEntry
*
entry
=
glyphsetCache
+
physDev
->
xrender
->
cache_index
;
gsCacheEntryFormat
*
formatEntry
;
UINT
ggo_format
=
GGO_GLYPH_INDEX
;
XRenderPictFormat
pf
;
if
(
entry
->
nrealized
<=
glyph
)
{
entry
->
nrealized
=
(
glyph
/
128
+
1
)
*
128
;
/* If there is nothing for the current type, we create the entry. */
if
(
!
entry
->
format
[
format
]
)
{
entry
->
format
[
format
]
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
gsCacheEntryFormat
));
}
formatEntry
=
entry
->
format
[
format
];
if
(
entry
->
realized
)
entry
->
realized
=
HeapReAlloc
(
GetProcessHeap
(),
if
(
formatEntry
->
nrealized
<=
glyph
)
{
formatEntry
->
nrealized
=
(
glyph
/
128
+
1
)
*
128
;
if
(
formatEntry
->
realized
)
formatEntry
->
realized
=
HeapReAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
e
ntry
->
realized
,
e
ntry
->
nrealized
*
sizeof
(
BOOL
));
formatE
ntry
->
realized
,
formatE
ntry
->
nrealized
*
sizeof
(
BOOL
));
else
e
ntry
->
realized
=
HeapAlloc
(
GetProcessHeap
(),
formatE
ntry
->
realized
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
e
ntry
->
nrealized
*
sizeof
(
BOOL
));
formatE
ntry
->
nrealized
*
sizeof
(
BOOL
));
if
(
!
X11DRV_XRender_Installed
)
{
if
(
e
ntry
->
bitmaps
)
e
ntry
->
bitmaps
=
HeapReAlloc
(
GetProcessHeap
(),
if
(
formatE
ntry
->
bitmaps
)
formatE
ntry
->
bitmaps
=
HeapReAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
e
ntry
->
bitmaps
,
entry
->
nrealized
*
sizeof
(
e
ntry
->
bitmaps
[
0
]));
formatE
ntry
->
bitmaps
,
formatEntry
->
nrealized
*
sizeof
(
formatE
ntry
->
bitmaps
[
0
]));
else
e
ntry
->
bitmaps
=
HeapAlloc
(
GetProcessHeap
(),
formatE
ntry
->
bitmaps
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
entry
->
nrealized
*
sizeof
(
e
ntry
->
bitmaps
[
0
]));
formatEntry
->
nrealized
*
sizeof
(
formatE
ntry
->
bitmaps
[
0
]));
if
(
e
ntry
->
gis
)
e
ntry
->
gis
=
HeapReAlloc
(
GetProcessHeap
(),
if
(
formatE
ntry
->
gis
)
formatE
ntry
->
gis
=
HeapReAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
e
ntry
->
gis
,
entry
->
nrealized
*
sizeof
(
e
ntry
->
gis
[
0
]));
formatE
ntry
->
gis
,
formatEntry
->
nrealized
*
sizeof
(
formatE
ntry
->
gis
[
0
]));
else
e
ntry
->
gis
=
HeapAlloc
(
GetProcessHeap
(),
formatE
ntry
->
gis
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
entry
->
nrealized
*
sizeof
(
e
ntry
->
gis
[
0
]));
formatEntry
->
nrealized
*
sizeof
(
formatE
ntry
->
gis
[
0
]));
}
}
switch
(
entry
->
aa
)
{
switch
(
format
)
{
case
AA_Grey
:
ggo_format
|=
WINE_GGO_GRAY16_BITMAP
;
break
;
default:
ERR
(
"aa = %d - not implemented
\n
"
,
entry
->
aa
);
ERR
(
"aa = %d - not implemented
\n
"
,
format
);
case
AA_None
:
ggo_format
|=
GGO_BITMAP
;
break
;
...
...
@@ -589,8 +617,9 @@ static BOOL UploadGlyph(X11DRV_PDEVICE *physDev, int glyph)
buflen
=
GetGlyphOutlineW
(
physDev
->
hdc
,
glyph
,
ggo_format
,
&
gm
,
0
,
NULL
,
NULL
);
if
(
buflen
==
GDI_ERROR
)
{
if
(
entry
->
aa
!=
AA_None
)
{
entry
->
aa
=
AA_None
;
if
(
format
!=
AA_None
)
{
format
=
AA_None
;
entry
->
aa_default
=
AA_None
;
ggo_format
&=
~
WINE_GGO_GRAY16_BITMAP
;
ggo_format
|=
GGO_BITMAP
;
buflen
=
GetGlyphOutlineW
(
physDev
->
hdc
,
glyph
,
ggo_format
,
&
gm
,
0
,
NULL
,
...
...
@@ -603,15 +632,15 @@ static BOOL UploadGlyph(X11DRV_PDEVICE *physDev, int glyph)
TRACE
(
"Turning off antialiasing for this monochrome font
\n
"
);
}
if
(
e
ntry
->
glyphset
==
0
&&
X11DRV_XRender_Installed
)
{
switch
(
entry
->
aa
)
{
if
(
formatE
ntry
->
glyphset
==
0
&&
X11DRV_XRender_Installed
)
{
switch
(
format
)
{
case
AA_Grey
:
pf
.
depth
=
8
;
pf
.
direct
.
alphaMask
=
0xff
;
break
;
default:
ERR
(
"aa = %d - not implemented
\n
"
,
entry
->
aa
);
ERR
(
"aa = %d - not implemented
\n
"
,
format
);
case
AA_None
:
pf
.
depth
=
1
;
pf
.
direct
.
alphaMask
=
1
;
...
...
@@ -622,21 +651,21 @@ static BOOL UploadGlyph(X11DRV_PDEVICE *physDev, int glyph)
pf
.
direct
.
alpha
=
0
;
wine_tsx11_lock
();
e
ntry
->
font_format
=
pXRenderFindFormat
(
gdi_display
,
formatE
ntry
->
font_format
=
pXRenderFindFormat
(
gdi_display
,
PictFormatType
|
PictFormatDepth
|
PictFormatAlpha
|
PictFormatAlphaMask
,
&
pf
,
0
);
entry
->
glyphset
=
pXRenderCreateGlyphSet
(
gdi_display
,
e
ntry
->
font_format
);
formatEntry
->
glyphset
=
pXRenderCreateGlyphSet
(
gdi_display
,
formatE
ntry
->
font_format
);
wine_tsx11_unlock
();
}
buf
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
buflen
);
GetGlyphOutlineW
(
physDev
->
hdc
,
glyph
,
ggo_format
,
&
gm
,
buflen
,
buf
,
NULL
);
e
ntry
->
realized
[
glyph
]
=
TRUE
;
formatE
ntry
->
realized
[
glyph
]
=
TRUE
;
TRACE
(
"buflen = %d. Got metrics: %dx%d adv=%d,%d origin=%ld,%ld
\n
"
,
buflen
,
...
...
@@ -655,7 +684,7 @@ static BOOL UploadGlyph(X11DRV_PDEVICE *physDev, int glyph)
char
output
[
300
];
unsigned
char
*
line
;
if
(
entry
->
aa
==
AA_None
)
{
if
(
format
==
AA_None
)
{
pitch
=
((
gi
.
width
+
31
)
/
32
)
*
4
;
for
(
i
=
0
;
i
<
gi
.
height
;
i
++
)
{
line
=
buf
+
i
*
pitch
;
...
...
@@ -685,8 +714,8 @@ static BOOL UploadGlyph(X11DRV_PDEVICE *physDev, int glyph)
}
}
if
(
e
ntry
->
glyphset
)
{
if
(
entry
->
aa
==
AA_None
&&
BitmapBitOrder
(
gdi_display
)
!=
MSBFirst
)
{
if
(
formatE
ntry
->
glyphset
)
{
if
(
format
==
AA_None
&&
BitmapBitOrder
(
gdi_display
)
!=
MSBFirst
)
{
unsigned
char
*
byte
=
buf
,
c
;
int
i
=
buflen
;
...
...
@@ -703,13 +732,13 @@ static BOOL UploadGlyph(X11DRV_PDEVICE *physDev, int glyph)
}
gid
=
glyph
;
wine_tsx11_lock
();
pXRenderAddGlyphs
(
gdi_display
,
e
ntry
->
glyphset
,
&
gid
,
&
gi
,
1
,
pXRenderAddGlyphs
(
gdi_display
,
formatE
ntry
->
glyphset
,
&
gid
,
&
gi
,
1
,
buf
,
buflen
);
wine_tsx11_unlock
();
HeapFree
(
GetProcessHeap
(),
0
,
buf
);
}
else
{
e
ntry
->
bitmaps
[
glyph
]
=
buf
;
memcpy
(
&
e
ntry
->
gis
[
glyph
],
&
gi
,
sizeof
(
gi
));
formatE
ntry
->
bitmaps
[
glyph
]
=
buf
;
memcpy
(
&
formatE
ntry
->
gis
[
glyph
],
&
gi
,
sizeof
(
gi
));
}
return
TRUE
;
}
...
...
@@ -977,6 +1006,7 @@ BOOL X11DRV_XRender_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flag
const
WORD
*
glyphs
;
POINT
pt
;
gsCacheEntry
*
entry
;
gsCacheEntryFormat
*
formatEntry
;
BOOL
retv
=
FALSE
;
HDC
hdc
=
physDev
->
hdc
;
int
textPixel
,
backgroundPixel
;
...
...
@@ -1277,13 +1307,17 @@ BOOL X11DRV_XRender_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flag
EnterCriticalSection
(
&
xrender_cs
);
entry
=
glyphsetCache
+
physDev
->
xrender
->
cache_index
;
formatEntry
=
entry
->
format
[
entry
->
aa_default
];
for
(
idx
=
0
;
idx
<
count
;
idx
++
)
{
if
(
glyphs
[
idx
]
>=
entry
->
nrealized
||
entry
->
realized
[
glyphs
[
idx
]]
==
FALSE
)
{
UploadGlyph
(
physDev
,
glyphs
[
idx
]);
if
(
!
formatEntry
)
{
UploadGlyph
(
physDev
,
glyphs
[
idx
],
entry
->
aa_default
);
formatEntry
=
entry
->
format
[
entry
->
aa_default
];
}
else
if
(
glyphs
[
idx
]
>=
formatEntry
->
nrealized
||
formatEntry
->
realized
[
glyphs
[
idx
]]
==
FALSE
)
{
UploadGlyph
(
physDev
,
glyphs
[
idx
],
entry
->
aa_default
);
}
}
assert
(
formatEntry
);
TRACE
(
"Writing %s at %ld,%ld
\n
"
,
debugstr_wn
(
wstr
,
count
),
physDev
->
org
.
x
+
x
,
physDev
->
org
.
y
+
y
);
...
...
@@ -1294,7 +1328,7 @@ BOOL X11DRV_XRender_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flag
pXRenderCompositeString16
(
gdi_display
,
render_op
,
physDev
->
xrender
->
tile_pict
,
physDev
->
xrender
->
pict
,
entry
->
font_format
,
e
ntry
->
glyphset
,
formatEntry
->
font_format
,
formatE
ntry
->
glyphset
,
0
,
0
,
physDev
->
org
.
x
+
x
,
physDev
->
org
.
y
+
y
,
glyphs
,
count
);
...
...
@@ -1304,7 +1338,7 @@ BOOL X11DRV_XRender_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flag
pXRenderCompositeString16
(
gdi_display
,
render_op
,
physDev
->
xrender
->
tile_pict
,
physDev
->
xrender
->
pict
,
entry
->
font_format
,
e
ntry
->
glyphset
,
formatEntry
->
font_format
,
formatE
ntry
->
glyphset
,
0
,
0
,
physDev
->
org
.
x
+
x
+
xoff
,
physDev
->
org
.
y
+
y
+
yoff
,
glyphs
+
idx
,
1
);
...
...
@@ -1320,36 +1354,36 @@ BOOL X11DRV_XRender_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flag
wine_tsx11_lock
();
XSetForeground
(
gdi_display
,
physDev
->
gc
,
textPixel
);
if
(
entry
->
aa
==
AA_None
)
{
if
(
entry
->
aa
_default
==
AA_None
)
{
for
(
idx
=
0
;
idx
<
count
;
idx
++
)
{
SharpGlyphMono
(
physDev
,
physDev
->
org
.
x
+
x
+
xoff
,
physDev
->
org
.
y
+
y
+
yoff
,
e
ntry
->
bitmaps
[
glyphs
[
idx
]],
&
e
ntry
->
gis
[
glyphs
[
idx
]]);
formatE
ntry
->
bitmaps
[
glyphs
[
idx
]],
&
formatE
ntry
->
gis
[
glyphs
[
idx
]]);
if
(
deltas
)
{
offset
+=
X11DRV_XWStoDS
(
physDev
,
deltas
[
idx
]);
xoff
=
offset
*
cosEsc
;
yoff
=
offset
*
-
sinEsc
;
}
else
{
xoff
+=
e
ntry
->
gis
[
glyphs
[
idx
]].
xOff
;
yoff
+=
e
ntry
->
gis
[
glyphs
[
idx
]].
yOff
;
xoff
+=
formatE
ntry
->
gis
[
glyphs
[
idx
]].
xOff
;
yoff
+=
formatE
ntry
->
gis
[
glyphs
[
idx
]].
yOff
;
}
}
}
else
if
(
physDev
->
depth
==
1
)
{
for
(
idx
=
0
;
idx
<
count
;
idx
++
)
{
SharpGlyphGray
(
physDev
,
physDev
->
org
.
x
+
x
+
xoff
,
physDev
->
org
.
y
+
y
+
yoff
,
e
ntry
->
bitmaps
[
glyphs
[
idx
]],
&
e
ntry
->
gis
[
glyphs
[
idx
]]);
formatE
ntry
->
bitmaps
[
glyphs
[
idx
]],
&
formatE
ntry
->
gis
[
glyphs
[
idx
]]);
if
(
deltas
)
{
offset
+=
X11DRV_XWStoDS
(
physDev
,
deltas
[
idx
]);
xoff
=
offset
*
cosEsc
;
yoff
=
offset
*
-
sinEsc
;
}
else
{
xoff
+=
e
ntry
->
gis
[
glyphs
[
idx
]].
xOff
;
yoff
+=
e
ntry
->
gis
[
glyphs
[
idx
]].
yOff
;
xoff
+=
formatE
ntry
->
gis
[
glyphs
[
idx
]].
xOff
;
yoff
+=
formatE
ntry
->
gis
[
glyphs
[
idx
]].
yOff
;
}
}
...
...
@@ -1368,21 +1402,21 @@ BOOL X11DRV_XRender_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flag
TRACE
(
"drawable %dx%d
\n
"
,
w
,
h
);
for
(
idx
=
0
;
idx
<
count
;
idx
++
)
{
if
(
extents
.
left
>
cur
.
x
-
e
ntry
->
gis
[
glyphs
[
idx
]].
x
)
extents
.
left
=
cur
.
x
-
e
ntry
->
gis
[
glyphs
[
idx
]].
x
;
if
(
extents
.
top
>
cur
.
y
-
e
ntry
->
gis
[
glyphs
[
idx
]].
y
)
extents
.
top
=
cur
.
y
-
e
ntry
->
gis
[
glyphs
[
idx
]].
y
;
if
(
extents
.
right
<
cur
.
x
-
entry
->
gis
[
glyphs
[
idx
]].
x
+
e
ntry
->
gis
[
glyphs
[
idx
]].
width
)
extents
.
right
=
cur
.
x
-
entry
->
gis
[
glyphs
[
idx
]].
x
+
e
ntry
->
gis
[
glyphs
[
idx
]].
width
;
if
(
extents
.
bottom
<
cur
.
y
-
entry
->
gis
[
glyphs
[
idx
]].
y
+
e
ntry
->
gis
[
glyphs
[
idx
]].
height
)
extents
.
bottom
=
cur
.
y
-
entry
->
gis
[
glyphs
[
idx
]].
y
+
e
ntry
->
gis
[
glyphs
[
idx
]].
height
;
if
(
extents
.
left
>
cur
.
x
-
formatE
ntry
->
gis
[
glyphs
[
idx
]].
x
)
extents
.
left
=
cur
.
x
-
formatE
ntry
->
gis
[
glyphs
[
idx
]].
x
;
if
(
extents
.
top
>
cur
.
y
-
formatE
ntry
->
gis
[
glyphs
[
idx
]].
y
)
extents
.
top
=
cur
.
y
-
formatE
ntry
->
gis
[
glyphs
[
idx
]].
y
;
if
(
extents
.
right
<
cur
.
x
-
formatEntry
->
gis
[
glyphs
[
idx
]].
x
+
formatE
ntry
->
gis
[
glyphs
[
idx
]].
width
)
extents
.
right
=
cur
.
x
-
formatEntry
->
gis
[
glyphs
[
idx
]].
x
+
formatE
ntry
->
gis
[
glyphs
[
idx
]].
width
;
if
(
extents
.
bottom
<
cur
.
y
-
formatEntry
->
gis
[
glyphs
[
idx
]].
y
+
formatE
ntry
->
gis
[
glyphs
[
idx
]].
height
)
extents
.
bottom
=
cur
.
y
-
formatEntry
->
gis
[
glyphs
[
idx
]].
y
+
formatE
ntry
->
gis
[
glyphs
[
idx
]].
height
;
if
(
deltas
)
{
offset
+=
X11DRV_XWStoDS
(
physDev
,
deltas
[
idx
]);
cur
.
x
=
offset
*
cosEsc
;
cur
.
y
=
offset
*
-
sinEsc
;
}
else
{
cur
.
x
+=
e
ntry
->
gis
[
glyphs
[
idx
]].
xOff
;
cur
.
y
+=
e
ntry
->
gis
[
glyphs
[
idx
]].
yOff
;
cur
.
x
+=
formatE
ntry
->
gis
[
glyphs
[
idx
]].
xOff
;
cur
.
y
+=
formatE
ntry
->
gis
[
glyphs
[
idx
]].
yOff
;
}
}
TRACE
(
"glyph extents %ld,%ld - %ld,%ld drawable x,y %ld,%ld
\n
"
,
extents
.
left
,
extents
.
top
,
...
...
@@ -1450,16 +1484,16 @@ BOOL X11DRV_XRender_ExtTextOut( X11DRV_PDEVICE *physDev, INT x, INT y, UINT flag
for
(
idx
=
0
;
idx
<
count
;
idx
++
)
{
SmoothGlyphGray
(
image
,
xoff
+
image_off_x
-
extents
.
left
,
yoff
+
image_off_y
-
extents
.
top
,
e
ntry
->
bitmaps
[
glyphs
[
idx
]],
&
e
ntry
->
gis
[
glyphs
[
idx
]],
formatE
ntry
->
bitmaps
[
glyphs
[
idx
]],
&
formatE
ntry
->
gis
[
glyphs
[
idx
]],
physDev
->
textPixel
);
if
(
deltas
)
{
offset
+=
X11DRV_XWStoDS
(
physDev
,
deltas
[
idx
]);
xoff
=
offset
*
cosEsc
;
yoff
=
offset
*
-
sinEsc
;
}
else
{
xoff
+=
e
ntry
->
gis
[
glyphs
[
idx
]].
xOff
;
yoff
+=
e
ntry
->
gis
[
glyphs
[
idx
]].
yOff
;
xoff
+=
formatE
ntry
->
gis
[
glyphs
[
idx
]].
xOff
;
yoff
+=
formatE
ntry
->
gis
[
glyphs
[
idx
]].
yOff
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment