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
c32a19f1
Commit
c32a19f1
authored
Jan 26, 2017
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jan 26, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Implement another variant of CreateGlyphRunAnalysis().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
1afcfc77
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
22 deletions
+49
-22
dwrite_private.h
dlls/dwrite/dwrite_private.h
+1
-1
font.c
dlls/dwrite/font.c
+36
-19
main.c
dlls/dwrite/main.c
+12
-2
No files found.
dlls/dwrite/dwrite_private.h
View file @
c32a19f1
...
...
@@ -143,7 +143,7 @@ struct glyphrunanalysis_desc
{
const
DWRITE_GLYPH_RUN
*
run
;
const
DWRITE_MATRIX
*
transform
;
DWRITE_RENDERING_MODE
rendering_mode
;
DWRITE_RENDERING_MODE
1
rendering_mode
;
DWRITE_MEASURING_MODE
measuring_mode
;
DWRITE_GRID_FIT_MODE
gridfit_mode
;
DWRITE_TEXT_ANTIALIAS_MODE
aa_mode
;
...
...
dlls/dwrite/font.c
View file @
c32a19f1
...
...
@@ -166,7 +166,7 @@ struct dwrite_glyphrunanalysis {
IDWriteGlyphRunAnalysis
IDWriteGlyphRunAnalysis_iface
;
LONG
ref
;
DWRITE_RENDERING_MODE
rendering_mode
;
DWRITE_RENDERING_MODE
1
rendering_mode
;
DWRITE_GLYPH_RUN
run
;
/* glyphAdvances and glyphOffsets are not used */
DWRITE_MATRIX
m
;
FLOAT
ppdip
;
...
...
@@ -1167,7 +1167,7 @@ static HRESULT WINAPI dwritefontface3_GetRecommendedRenderingMode(IDWriteFontFac
emSize
*=
max
(
dpiX
,
dpiY
)
/
96
.
0
f
;
*
rendering_mode
=
DWRITE_RENDERING_MODE_DEFAULT
;
*
rendering_mode
=
DWRITE_RENDERING_MODE
1
_DEFAULT
;
*
gridfit_mode
=
DWRITE_GRID_FIT_MODE_DEFAULT
;
if
(
params
)
{
IDWriteRenderingParams3
*
params3
;
...
...
@@ -4757,6 +4757,19 @@ static ULONG WINAPI glyphrunanalysis_Release(IDWriteGlyphRunAnalysis *iface)
return
ref
;
}
static
BOOL
is_natural_rendering_mode
(
DWRITE_RENDERING_MODE1
mode
)
{
switch
(
mode
)
{
case
DWRITE_RENDERING_MODE1_NATURAL
:
case
DWRITE_RENDERING_MODE1_NATURAL_SYMMETRIC
:
case
DWRITE_RENDERING_MODE1_NATURAL_SYMMETRIC_DOWNSAMPLED
:
return
TRUE
;
default:
return
FALSE
;
}
}
static
void
glyphrunanalysis_get_texturebounds
(
struct
dwrite_glyphrunanalysis
*
analysis
,
RECT
*
bounds
)
{
struct
dwrite_glyphbitmap
glyph_bitmap
;
...
...
@@ -4787,8 +4800,7 @@ static void glyphrunanalysis_get_texturebounds(struct dwrite_glyphrunanalysis *a
memset
(
&
glyph_bitmap
,
0
,
sizeof
(
glyph_bitmap
));
glyph_bitmap
.
fontface
=
fontface3
;
glyph_bitmap
.
emsize
=
analysis
->
run
.
fontEmSize
*
analysis
->
ppdip
;
glyph_bitmap
.
nohint
=
analysis
->
rendering_mode
==
DWRITE_RENDERING_MODE_NATURAL
||
analysis
->
rendering_mode
==
DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC
;
glyph_bitmap
.
nohint
=
is_natural_rendering_mode
(
analysis
->
rendering_mode
);
if
(
analysis
->
flags
&
RUNANALYSIS_USE_TRANSFORM
)
glyph_bitmap
.
m
=
&
analysis
->
m
;
...
...
@@ -4836,8 +4848,8 @@ static HRESULT WINAPI glyphrunanalysis_GetAlphaTextureBounds(IDWriteGlyphRunAnal
return
E_INVALIDARG
;
}
if
((
type
==
DWRITE_TEXTURE_ALIASED_1x1
&&
This
->
rendering_mode
!=
DWRITE_RENDERING_MODE_ALIASED
)
||
(
type
==
DWRITE_TEXTURE_CLEARTYPE_3x1
&&
This
->
rendering_mode
==
DWRITE_RENDERING_MODE_ALIASED
))
{
if
((
type
==
DWRITE_TEXTURE_ALIASED_1x1
&&
This
->
rendering_mode
!=
DWRITE_RENDERING_MODE
1
_ALIASED
)
||
(
type
==
DWRITE_TEXTURE_CLEARTYPE_3x1
&&
This
->
rendering_mode
==
DWRITE_RENDERING_MODE
1
_ALIASED
))
{
memset
(
bounds
,
0
,
sizeof
(
*
bounds
));
return
S_OK
;
}
...
...
@@ -4889,8 +4901,7 @@ static void glyphrunanalysis_render(struct dwrite_glyphrunanalysis *analysis, DW
memset
(
&
glyph_bitmap
,
0
,
sizeof
(
glyph_bitmap
));
glyph_bitmap
.
fontface
=
fontface2
;
glyph_bitmap
.
emsize
=
analysis
->
run
.
fontEmSize
*
analysis
->
ppdip
;
glyph_bitmap
.
nohint
=
analysis
->
rendering_mode
==
DWRITE_RENDERING_MODE_NATURAL
||
analysis
->
rendering_mode
==
DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC
;
glyph_bitmap
.
nohint
=
is_natural_rendering_mode
(
analysis
->
rendering_mode
);
glyph_bitmap
.
type
=
type
;
if
(
analysis
->
flags
&
RUNANALYSIS_USE_TRANSFORM
)
glyph_bitmap
.
m
=
&
analysis
->
m
;
...
...
@@ -5018,14 +5029,15 @@ static HRESULT WINAPI glyphrunanalysis_CreateAlphaTexture(IDWriteGlyphRunAnalysi
/* validate requested texture type with rendering mode */
switch
(
This
->
rendering_mode
)
{
case
DWRITE_RENDERING_MODE_ALIASED
:
case
DWRITE_RENDERING_MODE
1
_ALIASED
:
if
(
type
!=
DWRITE_TEXTURE_ALIASED_1x1
)
return
DWRITE_E_UNSUPPORTEDOPERATION
;
break
;
case
DWRITE_RENDERING_MODE_GDI_CLASSIC
:
case
DWRITE_RENDERING_MODE_GDI_NATURAL
:
case
DWRITE_RENDERING_MODE_NATURAL
:
case
DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC
:
case
DWRITE_RENDERING_MODE1_GDI_CLASSIC
:
case
DWRITE_RENDERING_MODE1_GDI_NATURAL
:
case
DWRITE_RENDERING_MODE1_NATURAL
:
case
DWRITE_RENDERING_MODE1_NATURAL_SYMMETRIC
:
case
DWRITE_RENDERING_MODE1_NATURAL_SYMMETRIC_DOWNSAMPLED
:
if
(
type
!=
DWRITE_TEXTURE_CLEARTYPE_3x1
)
return
DWRITE_E_UNSUPPORTEDOPERATION
;
break
;
...
...
@@ -5071,8 +5083,8 @@ static HRESULT WINAPI glyphrunanalysis_GetAlphaBlendParams(IDWriteGlyphRunAnalys
switch
(
This
->
rendering_mode
)
{
case
DWRITE_RENDERING_MODE_GDI_CLASSIC
:
case
DWRITE_RENDERING_MODE_GDI_NATURAL
:
case
DWRITE_RENDERING_MODE
1
_GDI_CLASSIC
:
case
DWRITE_RENDERING_MODE
1
_GDI_NATURAL
:
{
UINT
value
=
0
;
SystemParametersInfoW
(
SPI_GETFONTSMOOTHINGCONTRAST
,
0
,
&
value
,
0
);
...
...
@@ -5081,9 +5093,12 @@ static HRESULT WINAPI glyphrunanalysis_GetAlphaBlendParams(IDWriteGlyphRunAnalys
*
cleartypelevel
=
1
.
0
f
;
break
;
}
case
DWRITE_RENDERING_MODE_ALIASED
:
case
DWRITE_RENDERING_MODE_NATURAL
:
case
DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC
:
case
DWRITE_RENDERING_MODE1_NATURAL_SYMMETRIC_DOWNSAMPLED
:
WARN
(
"Downsampled mode is ignored.
\n
"
);
/* fallthrough */
case
DWRITE_RENDERING_MODE1_ALIASED
:
case
DWRITE_RENDERING_MODE1_NATURAL
:
case
DWRITE_RENDERING_MODE1_NATURAL_SYMMETRIC
:
*
gamma
=
IDWriteRenderingParams_GetGamma
(
params
);
*
contrast
=
IDWriteRenderingParams_GetEnhancedContrast
(
params
);
*
cleartypelevel
=
IDWriteRenderingParams_GetClearTypeLevel
(
params
);
...
...
@@ -5133,7 +5148,9 @@ HRESULT create_glyphrunanalysis(const struct glyphrunanalysis_desc *desc, IDWrit
*
ret
=
NULL
;
/* check for valid rendering mode */
if
((
UINT32
)
desc
->
rendering_mode
>=
DWRITE_RENDERING_MODE_OUTLINE
||
desc
->
rendering_mode
==
DWRITE_RENDERING_MODE_DEFAULT
)
if
((
UINT32
)
desc
->
rendering_mode
>=
DWRITE_RENDERING_MODE1_NATURAL_SYMMETRIC_DOWNSAMPLED
||
desc
->
rendering_mode
==
DWRITE_RENDERING_MODE1_OUTLINE
||
desc
->
rendering_mode
==
DWRITE_RENDERING_MODE1_DEFAULT
)
return
E_INVALIDARG
;
analysis
=
heap_alloc
(
sizeof
(
*
analysis
));
...
...
dlls/dwrite/main.c
View file @
c32a19f1
...
...
@@ -1291,11 +1291,21 @@ static HRESULT WINAPI dwritefactory3_CreateGlyphRunAnalysis(IDWriteFactory4 *ifa
IDWriteGlyphRunAnalysis
**
analysis
)
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory4
(
iface
);
struct
glyphrunanalysis_desc
desc
;
FIXME
(
"(%p)->(%p %p %d %d %d %d %.2f %.2f %p): stub
\n
"
,
This
,
run
,
transform
,
rendering_mode
,
measuring_mode
,
TRACE
(
"(%p)->(%p %p %d %d %d %d %.2f %.2f %p)
\n
"
,
This
,
run
,
transform
,
rendering_mode
,
measuring_mode
,
gridfit_mode
,
aa_mode
,
originX
,
originY
,
analysis
);
return
E_NOTIMPL
;
desc
.
run
=
run
;
desc
.
ppdip
=
1
.
0
f
;
desc
.
transform
=
transform
;
desc
.
rendering_mode
=
rendering_mode
;
desc
.
measuring_mode
=
measuring_mode
;
desc
.
gridfit_mode
=
gridfit_mode
;
desc
.
aa_mode
=
aa_mode
;
desc
.
origin_x
=
originX
;
desc
.
origin_y
=
originY
;
return
create_glyphrunanalysis
(
&
desc
,
analysis
);
}
static
HRESULT
WINAPI
dwritefactory3_CreateCustomRenderingParams
(
IDWriteFactory4
*
iface
,
FLOAT
gamma
,
FLOAT
contrast
,
...
...
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