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
ae85317b
Commit
ae85317b
authored
Apr 19, 2016
by
Nikolay Sivov
Committed by
Alexandre Julliard
Apr 19, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Update to IDWriteRenderingParams3.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
44468e85
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
91 additions
and
47 deletions
+91
-47
main.c
dlls/dwrite/main.c
+69
-47
font.c
dlls/dwrite/tests/font.c
+22
-0
No files found.
dlls/dwrite/main.c
View file @
ae85317b
...
...
@@ -54,7 +54,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD reason, LPVOID reserved)
}
struct
renderingparams
{
IDWriteRenderingParams
2
IDWriteRenderingParams2
_iface
;
IDWriteRenderingParams
3
IDWriteRenderingParams3
_iface
;
LONG
ref
;
FLOAT
gamma
;
...
...
@@ -62,28 +62,29 @@ struct renderingparams {
FLOAT
grayscalecontrast
;
FLOAT
cleartype_level
;
DWRITE_PIXEL_GEOMETRY
geometry
;
DWRITE_RENDERING_MODE
mode
;
DWRITE_RENDERING_MODE
1
mode
;
DWRITE_GRID_FIT_MODE
gridfit
;
};
static
inline
struct
renderingparams
*
impl_from_IDWriteRenderingParams
2
(
IDWriteRenderingParams2
*
iface
)
static
inline
struct
renderingparams
*
impl_from_IDWriteRenderingParams
3
(
IDWriteRenderingParams3
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
renderingparams
,
IDWriteRenderingParams
2
_iface
);
return
CONTAINING_RECORD
(
iface
,
struct
renderingparams
,
IDWriteRenderingParams
3
_iface
);
}
static
HRESULT
WINAPI
renderingparams_QueryInterface
(
IDWriteRenderingParams
2
*
iface
,
REFIID
riid
,
void
**
obj
)
static
HRESULT
WINAPI
renderingparams_QueryInterface
(
IDWriteRenderingParams
3
*
iface
,
REFIID
riid
,
void
**
obj
)
{
struct
renderingparams
*
This
=
impl_from_IDWriteRenderingParams
2
(
iface
);
struct
renderingparams
*
This
=
impl_from_IDWriteRenderingParams
3
(
iface
);
TRACE
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_guid
(
riid
),
obj
);
if
(
IsEqualIID
(
riid
,
&
IID_IDWriteRenderingParams2
)
||
if
(
IsEqualIID
(
riid
,
&
IID_IDWriteRenderingParams3
)
||
IsEqualIID
(
riid
,
&
IID_IDWriteRenderingParams2
)
||
IsEqualIID
(
riid
,
&
IID_IDWriteRenderingParams1
)
||
IsEqualIID
(
riid
,
&
IID_IDWriteRenderingParams
)
||
IsEqualIID
(
riid
,
&
IID_IUnknown
))
{
*
obj
=
iface
;
IDWriteRenderingParams
2
_AddRef
(
iface
);
IDWriteRenderingParams
3
_AddRef
(
iface
);
return
S_OK
;
}
...
...
@@ -92,17 +93,17 @@ static HRESULT WINAPI renderingparams_QueryInterface(IDWriteRenderingParams2 *if
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
renderingparams_AddRef
(
IDWriteRenderingParams
2
*
iface
)
static
ULONG
WINAPI
renderingparams_AddRef
(
IDWriteRenderingParams
3
*
iface
)
{
struct
renderingparams
*
This
=
impl_from_IDWriteRenderingParams
2
(
iface
);
struct
renderingparams
*
This
=
impl_from_IDWriteRenderingParams
3
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(%d)
\n
"
,
This
,
ref
);
return
ref
;
}
static
ULONG
WINAPI
renderingparams_Release
(
IDWriteRenderingParams
2
*
iface
)
static
ULONG
WINAPI
renderingparams_Release
(
IDWriteRenderingParams
3
*
iface
)
{
struct
renderingparams
*
This
=
impl_from_IDWriteRenderingParams
2
(
iface
);
struct
renderingparams
*
This
=
impl_from_IDWriteRenderingParams
3
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(%d)
\n
"
,
This
,
ref
);
...
...
@@ -113,56 +114,68 @@ static ULONG WINAPI renderingparams_Release(IDWriteRenderingParams2 *iface)
return
ref
;
}
static
FLOAT
WINAPI
renderingparams_GetGamma
(
IDWriteRenderingParams
2
*
iface
)
static
FLOAT
WINAPI
renderingparams_GetGamma
(
IDWriteRenderingParams
3
*
iface
)
{
struct
renderingparams
*
This
=
impl_from_IDWriteRenderingParams
2
(
iface
);
struct
renderingparams
*
This
=
impl_from_IDWriteRenderingParams
3
(
iface
);
TRACE
(
"(%p)
\n
"
,
This
);
return
This
->
gamma
;
}
static
FLOAT
WINAPI
renderingparams_GetEnhancedContrast
(
IDWriteRenderingParams
2
*
iface
)
static
FLOAT
WINAPI
renderingparams_GetEnhancedContrast
(
IDWriteRenderingParams
3
*
iface
)
{
struct
renderingparams
*
This
=
impl_from_IDWriteRenderingParams
2
(
iface
);
struct
renderingparams
*
This
=
impl_from_IDWriteRenderingParams
3
(
iface
);
TRACE
(
"(%p)
\n
"
,
This
);
return
This
->
contrast
;
}
static
FLOAT
WINAPI
renderingparams_GetClearTypeLevel
(
IDWriteRenderingParams
2
*
iface
)
static
FLOAT
WINAPI
renderingparams_GetClearTypeLevel
(
IDWriteRenderingParams
3
*
iface
)
{
struct
renderingparams
*
This
=
impl_from_IDWriteRenderingParams
2
(
iface
);
struct
renderingparams
*
This
=
impl_from_IDWriteRenderingParams
3
(
iface
);
TRACE
(
"(%p)
\n
"
,
This
);
return
This
->
cleartype_level
;
}
static
DWRITE_PIXEL_GEOMETRY
WINAPI
renderingparams_GetPixelGeometry
(
IDWriteRenderingParams
2
*
iface
)
static
DWRITE_PIXEL_GEOMETRY
WINAPI
renderingparams_GetPixelGeometry
(
IDWriteRenderingParams
3
*
iface
)
{
struct
renderingparams
*
This
=
impl_from_IDWriteRenderingParams
2
(
iface
);
struct
renderingparams
*
This
=
impl_from_IDWriteRenderingParams
3
(
iface
);
TRACE
(
"(%p)
\n
"
,
This
);
return
This
->
geometry
;
}
static
DWRITE_RENDERING_MODE
WINAPI
renderingparams_GetRenderingMode
(
IDWriteRenderingParams
2
*
iface
)
static
DWRITE_RENDERING_MODE
WINAPI
renderingparams_GetRenderingMode
(
IDWriteRenderingParams
3
*
iface
)
{
struct
renderingparams
*
This
=
impl_from_IDWriteRenderingParams2
(
iface
);
struct
renderingparams
*
This
=
impl_from_IDWriteRenderingParams3
(
iface
);
TRACE
(
"(%p)
\n
"
,
This
);
if
(
This
->
mode
==
DWRITE_RENDERING_MODE1_NATURAL_SYMMETRIC_DOWNSAMPLED
)
return
DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC
;
return
This
->
mode
;
}
static
FLOAT
WINAPI
renderingparams
_GetGrayscaleEnhancedContrast
(
IDWriteRenderingParams2
*
iface
)
static
FLOAT
WINAPI
renderingparams
1_GetGrayscaleEnhancedContrast
(
IDWriteRenderingParams3
*
iface
)
{
struct
renderingparams
*
This
=
impl_from_IDWriteRenderingParams
2
(
iface
);
struct
renderingparams
*
This
=
impl_from_IDWriteRenderingParams
3
(
iface
);
TRACE
(
"(%p)
\n
"
,
This
);
return
This
->
grayscalecontrast
;
}
static
DWRITE_GRID_FIT_MODE
WINAPI
renderingparams
_GetGridFitMode
(
IDWriteRenderingParams2
*
iface
)
static
DWRITE_GRID_FIT_MODE
WINAPI
renderingparams
2_GetGridFitMode
(
IDWriteRenderingParams3
*
iface
)
{
struct
renderingparams
*
This
=
impl_from_IDWriteRenderingParams
2
(
iface
);
struct
renderingparams
*
This
=
impl_from_IDWriteRenderingParams
3
(
iface
);
TRACE
(
"(%p)
\n
"
,
This
);
return
This
->
gridfit
;
}
static
const
struct
IDWriteRenderingParams2Vtbl
renderingparamsvtbl
=
{
static
DWRITE_RENDERING_MODE1
WINAPI
renderingparams3_GetRenderingMode1
(
IDWriteRenderingParams3
*
iface
)
{
struct
renderingparams
*
This
=
impl_from_IDWriteRenderingParams3
(
iface
);
TRACE
(
"(%p)
\n
"
,
This
);
return
This
->
mode
;
}
static
const
struct
IDWriteRenderingParams3Vtbl
renderingparamsvtbl
=
{
renderingparams_QueryInterface
,
renderingparams_AddRef
,
renderingparams_Release
,
...
...
@@ -171,12 +184,13 @@ static const struct IDWriteRenderingParams2Vtbl renderingparamsvtbl = {
renderingparams_GetClearTypeLevel
,
renderingparams_GetPixelGeometry
,
renderingparams_GetRenderingMode
,
renderingparams_GetGrayscaleEnhancedContrast
,
renderingparams_GetGridFitMode
renderingparams1_GetGrayscaleEnhancedContrast
,
renderingparams2_GetGridFitMode
,
renderingparams3_GetRenderingMode1
};
static
HRESULT
create_renderingparams
(
FLOAT
gamma
,
FLOAT
contrast
,
FLOAT
grayscalecontrast
,
FLOAT
cleartype_level
,
DWRITE_PIXEL_GEOMETRY
geometry
,
DWRITE_RENDERING_MODE
mode
,
DWRITE_GRID_FIT_MODE
gridfit
,
IDWriteRenderingParams
2
**
params
)
DWRITE_PIXEL_GEOMETRY
geometry
,
DWRITE_RENDERING_MODE
mode
,
DWRITE_GRID_FIT_MODE
gridfit
,
IDWriteRenderingParams
3
**
params
)
{
struct
renderingparams
*
This
;
...
...
@@ -185,7 +199,7 @@ static HRESULT create_renderingparams(FLOAT gamma, FLOAT contrast, FLOAT graysca
This
=
heap_alloc
(
sizeof
(
struct
renderingparams
));
if
(
!
This
)
return
E_OUTOFMEMORY
;
This
->
IDWriteRenderingParams
2
_iface
.
lpVtbl
=
&
renderingparamsvtbl
;
This
->
IDWriteRenderingParams
3
_iface
.
lpVtbl
=
&
renderingparamsvtbl
;
This
->
ref
=
1
;
This
->
gamma
=
gamma
;
...
...
@@ -196,7 +210,7 @@ static HRESULT create_renderingparams(FLOAT gamma, FLOAT contrast, FLOAT graysca
This
->
mode
=
mode
;
This
->
gridfit
=
gridfit
;
*
params
=
&
This
->
IDWriteRenderingParams
2
_iface
;
*
params
=
&
This
->
IDWriteRenderingParams
3
_iface
;
return
S_OK
;
}
...
...
@@ -924,7 +938,7 @@ static HRESULT WINAPI dwritefactory_CreateMonitorRenderingParams(IDWriteFactory3
IDWriteRenderingParams
**
params
)
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory3
(
iface
);
IDWriteRenderingParams
2
*
params2
;
IDWriteRenderingParams
3
*
params3
;
static
int
fixme_once
=
0
;
HRESULT
hr
;
...
...
@@ -933,9 +947,9 @@ static HRESULT WINAPI dwritefactory_CreateMonitorRenderingParams(IDWriteFactory3
if
(
!
fixme_once
++
)
FIXME
(
"(%p): monitor setting ignored
\n
"
,
monitor
);
hr
=
IDWriteFactory
2_CreateCustomRenderingParams
((
IDWriteFactory2
*
)
iface
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
,
0
.
0
f
,
DWRITE_PIXEL_GEOMETRY_FLAT
,
DWRITE_RENDERING_MODE_DEFAULT
,
DWRITE_GRID_FIT_MODE_DEFAULT
,
&
params
2
);
*
params
=
(
IDWriteRenderingParams
*
)
params
2
;
hr
=
IDWriteFactory
3_CreateCustomRenderingParams
(
iface
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
,
0
.
0
f
,
DWRITE_PIXEL_GEOMETRY_FLAT
,
DWRITE_RENDERING_MODE_DEFAULT
,
DWRITE_GRID_FIT_MODE_DEFAULT
,
&
params
3
);
*
params
=
(
IDWriteRenderingParams
*
)
params
3
;
return
hr
;
}
...
...
@@ -943,14 +957,14 @@ static HRESULT WINAPI dwritefactory_CreateCustomRenderingParams(IDWriteFactory3
FLOAT
cleartype_level
,
DWRITE_PIXEL_GEOMETRY
geometry
,
DWRITE_RENDERING_MODE
mode
,
IDWriteRenderingParams
**
params
)
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory3
(
iface
);
IDWriteRenderingParams
2
*
params2
;
IDWriteRenderingParams
3
*
params3
;
HRESULT
hr
;
TRACE
(
"(%p)->(%f %f %f %d %d %p)
\n
"
,
This
,
gamma
,
enhancedContrast
,
cleartype_level
,
geometry
,
mode
,
params
);
hr
=
IDWriteFactory
2_CreateCustomRenderingParams
((
IDWriteFactory2
*
)
iface
,
gamma
,
enhancedContrast
,
1
.
0
f
,
cleartype_level
,
geometry
,
mode
,
DWRITE_GRID_FIT_MODE_DEFAULT
,
&
params
2
);
*
params
=
(
IDWriteRenderingParams
*
)
params
2
;
hr
=
IDWriteFactory
3_CreateCustomRenderingParams
(
iface
,
gamma
,
enhancedContrast
,
1
.
0
f
,
cleartype_level
,
geometry
,
mode
,
DWRITE_GRID_FIT_MODE_DEFAULT
,
&
params
3
);
*
params
=
(
IDWriteRenderingParams
*
)
params
3
;
return
hr
;
}
...
...
@@ -1144,14 +1158,14 @@ static HRESULT WINAPI dwritefactory1_CreateCustomRenderingParams(IDWriteFactory3
DWRITE_RENDERING_MODE
mode
,
IDWriteRenderingParams1
**
params
)
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory3
(
iface
);
IDWriteRenderingParams
2
*
params2
;
IDWriteRenderingParams
3
*
params3
;
HRESULT
hr
;
TRACE
(
"(%p)->(%.2f %.2f %.2f %.2f %d %d %p)
\n
"
,
This
,
gamma
,
enhcontrast
,
enhcontrast_grayscale
,
cleartype_level
,
geometry
,
mode
,
params
);
hr
=
IDWriteFactory
2_CreateCustomRenderingParams
((
IDWriteFactory2
*
)
iface
,
gamma
,
enhcontrast
,
enhcontrast_grayscale
,
cleartype_level
,
geometry
,
mode
,
DWRITE_GRID_FIT_MODE_DEFAULT
,
&
params
2
);
*
params
=
(
IDWriteRenderingParams1
*
)
params
2
;
hr
=
IDWriteFactory
3_CreateCustomRenderingParams
(
iface
,
gamma
,
enhcontrast
,
enhcontrast_grayscale
,
cleartype_level
,
geometry
,
mode
,
DWRITE_GRID_FIT_MODE_DEFAULT
,
&
params
3
);
*
params
=
(
IDWriteRenderingParams1
*
)
params
3
;
return
hr
;
}
...
...
@@ -1196,9 +1210,16 @@ static HRESULT WINAPI dwritefactory2_CreateCustomRenderingParams(IDWriteFactory3
DWRITE_GRID_FIT_MODE
gridfit
,
IDWriteRenderingParams2
**
params
)
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory3
(
iface
);
IDWriteRenderingParams3
*
params3
;
HRESULT
hr
;
TRACE
(
"(%p)->(%.2f %.2f %.2f %.2f %d %d %d %p)
\n
"
,
This
,
gamma
,
contrast
,
grayscalecontrast
,
cleartype_level
,
geometry
,
mode
,
gridfit
,
params
);
return
create_renderingparams
(
gamma
,
contrast
,
grayscalecontrast
,
cleartype_level
,
geometry
,
mode
,
gridfit
,
params
);
hr
=
IDWriteFactory3_CreateCustomRenderingParams
(
iface
,
gamma
,
contrast
,
grayscalecontrast
,
cleartype_level
,
geometry
,
mode
,
DWRITE_GRID_FIT_MODE_DEFAULT
,
&
params3
);
*
params
=
(
IDWriteRenderingParams2
*
)
params3
;
return
hr
;
}
static
HRESULT
WINAPI
dwritefactory2_CreateGlyphRunAnalysis
(
IDWriteFactory3
*
iface
,
const
DWRITE_GLYPH_RUN
*
run
,
...
...
@@ -1233,10 +1254,11 @@ static HRESULT WINAPI dwritefactory3_CreateCustomRenderingParams(IDWriteFactory3
{
struct
dwritefactory
*
This
=
impl_from_IDWriteFactory3
(
iface
);
FIXME
(
"(%p)->(%.2f %.2f %.2f %.2f %d %d %d %p): stub
\n
"
,
This
,
gamma
,
contrast
,
grayscale_contrast
,
cleartype_level
,
TRACE
(
"(%p)->(%.2f %.2f %.2f %.2f %d %d %d %p)
\n
"
,
This
,
gamma
,
contrast
,
grayscale_contrast
,
cleartype_level
,
pixel_geometry
,
rendering_mode
,
gridfit_mode
,
params
);
return
E_NOTIMPL
;
return
create_renderingparams
(
gamma
,
contrast
,
grayscale_contrast
,
cleartype_level
,
pixel_geometry
,
rendering_mode
,
gridfit_mode
,
params
);
}
static
HRESULT
WINAPI
dwritefactory3_CreateFontFaceReference
(
IDWriteFactory3
*
iface
,
WCHAR
const
*
path
,
FILETIME
const
*
writetime
,
...
...
dlls/dwrite/tests/font.c
View file @
ae85317b
...
...
@@ -3977,6 +3977,7 @@ static void test_CreateRenderingParams(void)
IDWriteRenderingParams1
*
params1
;
IDWriteRenderingParams
*
params
;
DWRITE_RENDERING_MODE
mode
;
IDWriteFactory3
*
factory3
;
IDWriteFactory
*
factory
;
HRESULT
hr
;
...
...
@@ -4020,6 +4021,27 @@ static void test_CreateRenderingParams(void)
ok
(
mode
==
DWRITE_RENDERING_MODE_DEFAULT
,
"got %d
\n
"
,
mode
);
IDWriteRenderingParams_Release
(
params
);
hr
=
IDWriteFactory_QueryInterface
(
factory
,
&
IID_IDWriteFactory3
,
(
void
**
)
&
factory3
);
if
(
hr
==
S_OK
)
{
IDWriteRenderingParams3
*
params3
;
hr
=
IDWriteFactory3_CreateCustomRenderingParams
(
factory3
,
1
.
0
f
,
0
.
0
f
,
0
.
0
f
,
1
.
0
f
,
DWRITE_PIXEL_GEOMETRY_FLAT
,
DWRITE_RENDERING_MODE1_NATURAL_SYMMETRIC_DOWNSAMPLED
,
DWRITE_GRID_FIT_MODE_DEFAULT
,
&
params3
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IDWriteRenderingParams3_QueryInterface
(
params3
,
&
IID_IDWriteRenderingParams
,
(
void
**
)
&
params
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
mode
=
IDWriteRenderingParams_GetRenderingMode
(
params
);
ok
(
mode
==
DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC
,
"got %d
\n
"
,
mode
);
IDWriteRenderingParams_Release
(
params
);
IDWriteRenderingParams3_Release
(
params3
);
IDWriteFactory3_Release
(
factory3
);
}
else
win_skip
(
"IDWriteRenderingParams3 not supported.
\n
"
);
IDWriteFactory_Release
(
factory
);
}
...
...
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