Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
e33f622b
Commit
e33f622b
authored
Sep 12, 2005
by
Huw Davies
Committed by
Alexandre Julliard
Sep 12, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use the gasp table to check whether we should trigger antialiasing.
parent
dc420fe6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
3 deletions
+62
-3
xrender.c
dlls/x11drv/xrender.c
+62
-3
No files found.
dlls/x11drv/xrender.c
View file @
e33f622b
...
...
@@ -33,6 +33,7 @@
#include "wownt32.h"
#include "x11drv.h"
#include "gdi.h"
#include "winternl.h"
#include "wine/library.h"
#include "wine/unicode.h"
#include "wine/debug.h"
...
...
@@ -141,6 +142,22 @@ static CRITICAL_SECTION_DEBUG critsect_debug =
};
static
CRITICAL_SECTION
xrender_cs
=
{
&
critsect_debug
,
-
1
,
0
,
0
,
0
,
0
};
#define MS_MAKE_TAG( _x1, _x2, _x3, _x4 ) \
( ( (ULONG)_x4 << 24 ) | \
( (ULONG)_x3 << 16 ) | \
( (ULONG)_x2 << 8 ) | \
(ULONG)_x1 )
#define MS_GASP_TAG MS_MAKE_TAG('g', 'a', 's', 'p')
#define GASP_GRIDFIT 0x01
#define GASP_DOGRAY 0x02
#ifdef WORDS_BIGENDIAN
#define get_be_word(x) (x)
#else
#define get_be_word(x) RtlUshortByteSwap(x)
#endif
/***********************************************************************
* X11DRV_XRender_Init
...
...
@@ -405,11 +422,48 @@ static int AllocEntry(void)
return
mru
;
}
static
int
GetCacheEntry
(
LFANDSIZE
*
plfsz
)
static
BOOL
get_gasp_flags
(
X11DRV_PDEVICE
*
physDev
,
WORD
*
flags
)
{
DWORD
size
;
WORD
*
gasp
;
WORD
num_recs
;
DWORD
ppem
;
TEXTMETRICW
tm
;
*
flags
=
0
;
size
=
GetFontData
(
physDev
->
hdc
,
MS_GASP_TAG
,
0
,
NULL
,
0
);
if
(
size
==
GDI_ERROR
)
return
FALSE
;
gasp
=
HeapAlloc
(
GetProcessHeap
(),
0
,
size
);
GetFontData
(
physDev
->
hdc
,
MS_GASP_TAG
,
0
,
gasp
,
size
);
GetTextMetricsW
(
physDev
->
hdc
,
&
tm
);
ppem
=
abs
(
X11DRV_YWStoDS
(
physDev
,
tm
.
tmAscent
+
tm
.
tmDescent
-
tm
.
tmInternalLeading
));
gasp
++
;
num_recs
=
get_be_word
(
*
gasp
);
gasp
++
;
while
(
num_recs
--
)
{
*
flags
=
get_be_word
(
*
(
gasp
+
1
));
if
(
ppem
<=
get_be_word
(
*
gasp
))
break
;
gasp
+=
2
;
}
TRACE
(
"got flags %04x for ppem %ld
\n
"
,
*
flags
,
ppem
);
HeapFree
(
GetProcessHeap
(),
0
,
gasp
);
return
TRUE
;
}
static
int
GetCacheEntry
(
X11DRV_PDEVICE
*
physDev
,
LFANDSIZE
*
plfsz
)
{
int
ret
;
int
format
;
gsCacheEntry
*
entry
;
WORD
flags
;
if
((
ret
=
LookupEntry
(
plfsz
))
!=
-
1
)
return
ret
;
...
...
@@ -421,7 +475,12 @@ static int GetCacheEntry(LFANDSIZE *plfsz)
}
if
(
antialias
&&
plfsz
->
lf
.
lfQuality
!=
NONANTIALIASED_QUALITY
)
entry
->
aa_default
=
AA_Grey
;
{
if
(
!
get_gasp_flags
(
physDev
,
&
flags
)
||
flags
&
GASP_DOGRAY
)
entry
->
aa_default
=
AA_Grey
;
else
entry
->
aa_default
=
AA_None
;
}
else
entry
->
aa_default
=
AA_None
;
...
...
@@ -493,7 +552,7 @@ BOOL X11DRV_XRender_SelectFont(X11DRV_PDEVICE *physDev, HFONT hfont)
}
else
if
(
physDev
->
xrender
->
cache_index
!=
-
1
)
dec_ref_cache
(
physDev
->
xrender
->
cache_index
);
physDev
->
xrender
->
cache_index
=
GetCacheEntry
(
&
lfsz
);
physDev
->
xrender
->
cache_index
=
GetCacheEntry
(
physDev
,
&
lfsz
);
LeaveCriticalSection
(
&
xrender_cs
);
return
0
;
}
...
...
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