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
87d6e455
Commit
87d6e455
authored
Dec 02, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Dec 02, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Use consistent trace format for rendering parameters object.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
31121442
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
78 additions
and
62 deletions
+78
-62
main.c
dlls/dwrite/main.c
+78
-62
No files found.
dlls/dwrite/main.c
View file @
87d6e455
...
...
@@ -54,14 +54,15 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD reason, LPVOID reserved)
return
TRUE
;
}
struct
renderingparams
{
struct
renderingparams
{
IDWriteRenderingParams3
IDWriteRenderingParams3_iface
;
LONG
ref
;
LONG
ref
count
;
FLOAT
gamma
;
FLOAT
contrast
;
FLOAT
grayscalecontrast
;
FLOAT
cleartype_level
;
float
gamma
;
float
contrast
;
float
grayscalecontrast
;
float
cleartype_level
;
DWRITE_PIXEL_GEOMETRY
geometry
;
DWRITE_RENDERING_MODE1
mode
;
DWRITE_GRID_FIT_MODE
gridfit
;
...
...
@@ -74,9 +75,7 @@ static inline struct renderingparams *impl_from_IDWriteRenderingParams3(IDWriteR
static
HRESULT
WINAPI
renderingparams_QueryInterface
(
IDWriteRenderingParams3
*
iface
,
REFIID
riid
,
void
**
obj
)
{
struct
renderingparams
*
This
=
impl_from_IDWriteRenderingParams3
(
iface
);
TRACE
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_guid
(
riid
),
obj
);
TRACE
(
"%p, %s, %p.
\n
"
,
iface
,
debugstr_guid
(
riid
),
obj
);
if
(
IsEqualIID
(
riid
,
&
IID_IDWriteRenderingParams3
)
||
IsEqualIID
(
riid
,
&
IID_IDWriteRenderingParams2
)
||
...
...
@@ -96,51 +95,61 @@ static HRESULT WINAPI renderingparams_QueryInterface(IDWriteRenderingParams3 *if
static
ULONG
WINAPI
renderingparams_AddRef
(
IDWriteRenderingParams3
*
iface
)
{
struct
renderingparams
*
This
=
impl_from_IDWriteRenderingParams3
(
iface
);
ULONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p)->(%d)
\n
"
,
This
,
ref
);
return
ref
;
struct
renderingparams
*
params
=
impl_from_IDWriteRenderingParams3
(
iface
);
ULONG
refcount
=
InterlockedIncrement
(
&
params
->
refcount
);
TRACE
(
"%p, refcount %d.
\n
"
,
iface
,
refcount
);
return
refcount
;
}
static
ULONG
WINAPI
renderingparams_Release
(
IDWriteRenderingParams3
*
iface
)
{
struct
renderingparams
*
Thi
s
=
impl_from_IDWriteRenderingParams3
(
iface
);
ULONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
struct
renderingparams
*
param
s
=
impl_from_IDWriteRenderingParams3
(
iface
);
ULONG
ref
count
=
InterlockedDecrement
(
&
params
->
refcount
);
TRACE
(
"
(%p)->(%d)
\n
"
,
This
,
ref
);
TRACE
(
"
%p, refcount %d.
\n
"
,
iface
,
refcount
);
if
(
!
ref
)
heap_free
(
Thi
s
);
if
(
!
ref
count
)
heap_free
(
param
s
);
return
ref
;
return
ref
count
;
}
static
FLOAT
WINAPI
renderingparams_GetGamma
(
IDWriteRenderingParams3
*
iface
)
static
float
WINAPI
renderingparams_GetGamma
(
IDWriteRenderingParams3
*
iface
)
{
struct
renderingparams
*
This
=
impl_from_IDWriteRenderingParams3
(
iface
);
TRACE
(
"(%p)
\n
"
,
This
);
return
This
->
gamma
;
struct
renderingparams
*
params
=
impl_from_IDWriteRenderingParams3
(
iface
);
TRACE
(
"%p.
\n
"
,
iface
);
return
params
->
gamma
;
}
static
FLOAT
WINAPI
renderingparams_GetEnhancedContrast
(
IDWriteRenderingParams3
*
iface
)
static
float
WINAPI
renderingparams_GetEnhancedContrast
(
IDWriteRenderingParams3
*
iface
)
{
struct
renderingparams
*
This
=
impl_from_IDWriteRenderingParams3
(
iface
);
TRACE
(
"(%p)
\n
"
,
This
);
return
This
->
contrast
;
struct
renderingparams
*
params
=
impl_from_IDWriteRenderingParams3
(
iface
);
TRACE
(
"%p.
\n
"
,
iface
);
return
params
->
contrast
;
}
static
FLOAT
WINAPI
renderingparams_GetClearTypeLevel
(
IDWriteRenderingParams3
*
iface
)
static
float
WINAPI
renderingparams_GetClearTypeLevel
(
IDWriteRenderingParams3
*
iface
)
{
struct
renderingparams
*
This
=
impl_from_IDWriteRenderingParams3
(
iface
);
TRACE
(
"(%p)
\n
"
,
This
);
return
This
->
cleartype_level
;
struct
renderingparams
*
params
=
impl_from_IDWriteRenderingParams3
(
iface
);
TRACE
(
"%p.
\n
"
,
iface
);
return
params
->
cleartype_level
;
}
static
DWRITE_PIXEL_GEOMETRY
WINAPI
renderingparams_GetPixelGeometry
(
IDWriteRenderingParams3
*
iface
)
{
struct
renderingparams
*
This
=
impl_from_IDWriteRenderingParams3
(
iface
);
TRACE
(
"(%p)
\n
"
,
This
);
return
This
->
geometry
;
struct
renderingparams
*
params
=
impl_from_IDWriteRenderingParams3
(
iface
);
TRACE
(
"%p.
\n
"
,
iface
);
return
params
->
geometry
;
}
static
DWRITE_RENDERING_MODE
rendering_mode_from_mode1
(
DWRITE_RENDERING_MODE1
mode
)
...
...
@@ -161,35 +170,42 @@ static DWRITE_RENDERING_MODE rendering_mode_from_mode1(DWRITE_RENDERING_MODE1 mo
static
DWRITE_RENDERING_MODE
WINAPI
renderingparams_GetRenderingMode
(
IDWriteRenderingParams3
*
iface
)
{
struct
renderingparams
*
Thi
s
=
impl_from_IDWriteRenderingParams3
(
iface
);
struct
renderingparams
*
param
s
=
impl_from_IDWriteRenderingParams3
(
iface
);
TRACE
(
"
(%p)
\n
"
,
This
);
TRACE
(
"
%p.
\n
"
,
iface
);
return
rendering_mode_from_mode1
(
Thi
s
->
mode
);
return
rendering_mode_from_mode1
(
param
s
->
mode
);
}
static
FLOAT
WINAPI
renderingparams1_GetGrayscaleEnhancedContrast
(
IDWriteRenderingParams3
*
iface
)
static
float
WINAPI
renderingparams1_GetGrayscaleEnhancedContrast
(
IDWriteRenderingParams3
*
iface
)
{
struct
renderingparams
*
This
=
impl_from_IDWriteRenderingParams3
(
iface
);
TRACE
(
"(%p)
\n
"
,
This
);
return
This
->
grayscalecontrast
;
struct
renderingparams
*
params
=
impl_from_IDWriteRenderingParams3
(
iface
);
TRACE
(
"%p.
\n
"
,
iface
);
return
params
->
grayscalecontrast
;
}
static
DWRITE_GRID_FIT_MODE
WINAPI
renderingparams2_GetGridFitMode
(
IDWriteRenderingParams3
*
iface
)
{
struct
renderingparams
*
This
=
impl_from_IDWriteRenderingParams3
(
iface
);
TRACE
(
"(%p)
\n
"
,
This
);
return
This
->
gridfit
;
struct
renderingparams
*
params
=
impl_from_IDWriteRenderingParams3
(
iface
);
TRACE
(
"%p.
\n
"
,
iface
);
return
params
->
gridfit
;
}
static
DWRITE_RENDERING_MODE1
WINAPI
renderingparams3_GetRenderingMode1
(
IDWriteRenderingParams3
*
iface
)
{
struct
renderingparams
*
This
=
impl_from_IDWriteRenderingParams3
(
iface
);
TRACE
(
"(%p)
\n
"
,
This
);
return
This
->
mode
;
struct
renderingparams
*
params
=
impl_from_IDWriteRenderingParams3
(
iface
);
TRACE
(
"%p.
\n
"
,
iface
);
return
params
->
mode
;
}
static
const
struct
IDWriteRenderingParams3Vtbl
renderingparamsvtbl
=
{
static
const
struct
IDWriteRenderingParams3Vtbl
renderingparamsvtbl
=
{
renderingparams_QueryInterface
,
renderingparams_AddRef
,
renderingparams_Release
,
...
...
@@ -203,11 +219,11 @@ static const struct IDWriteRenderingParams3Vtbl renderingparamsvtbl = {
renderingparams3_GetRenderingMode1
};
static
HRESULT
create_renderingparams
(
FLOAT
gamma
,
FLOAT
contrast
,
FLOAT
grayscalecontrast
,
FLOAT
cleartype_level
,
static
HRESULT
create_renderingparams
(
float
gamma
,
float
contrast
,
float
grayscalecontrast
,
float
cleartype_level
,
DWRITE_PIXEL_GEOMETRY
geometry
,
DWRITE_RENDERING_MODE1
mode
,
DWRITE_GRID_FIT_MODE
gridfit
,
IDWriteRenderingParams3
**
params
)
{
struct
renderingparams
*
This
;
struct
renderingparams
*
object
;
*
params
=
NULL
;
...
...
@@ -217,21 +233,21 @@ static HRESULT create_renderingparams(FLOAT gamma, FLOAT contrast, FLOAT graysca
if
((
UINT32
)
gridfit
>
DWRITE_GRID_FIT_MODE_ENABLED
||
(
UINT32
)
geometry
>
DWRITE_PIXEL_GEOMETRY_BGR
)
return
E_INVALIDARG
;
This
=
heap_alloc
(
sizeof
(
struct
renderingparams
));
if
(
!
This
)
return
E_OUTOFMEMORY
;
if
(
!
(
object
=
heap_alloc
(
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
This
->
IDWriteRenderingParams3_iface
.
lpVtbl
=
&
renderingparamsvtbl
;
This
->
ref
=
1
;
object
->
IDWriteRenderingParams3_iface
.
lpVtbl
=
&
renderingparamsvtbl
;
object
->
refcount
=
1
;
This
->
gamma
=
gamma
;
This
->
contrast
=
contrast
;
This
->
grayscalecontrast
=
grayscalecontrast
;
This
->
cleartype_level
=
cleartype_level
;
This
->
geometry
=
geometry
;
This
->
mode
=
mode
;
This
->
gridfit
=
gridfit
;
object
->
gamma
=
gamma
;
object
->
contrast
=
contrast
;
object
->
grayscalecontrast
=
grayscalecontrast
;
object
->
cleartype_level
=
cleartype_level
;
object
->
geometry
=
geometry
;
object
->
mode
=
mode
;
object
->
gridfit
=
gridfit
;
*
params
=
&
This
->
IDWriteRenderingParams3_iface
;
*
params
=
&
object
->
IDWriteRenderingParams3_iface
;
return
S_OK
;
}
...
...
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