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
03897554
Commit
03897554
authored
Nov 30, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Nov 30, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite/layout: Zero-initialize layout structure.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
2903090e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
33 deletions
+11
-33
layout.c
dlls/dwrite/layout.c
+11
-33
No files found.
dlls/dwrite/layout.c
View file @
03897554
...
...
@@ -5080,9 +5080,6 @@ static HRESULT layout_format_from_textformat(struct dwrite_textlayout *layout, I
layout
->
format
.
wrapping
=
IDWriteTextFormat_GetWordWrapping
(
format
);
layout
->
format
.
readingdir
=
IDWriteTextFormat_GetReadingDirection
(
format
);
layout
->
format
.
flow
=
IDWriteTextFormat_GetFlowDirection
(
format
);
layout
->
format
.
fallback
=
NULL
;
layout
->
format
.
spacing
.
leadingBefore
=
0
.
0
f
;
layout
->
format
.
spacing
.
fontLineGapUsage
=
DWRITE_FONT_LINE_GAP_USAGE_DEFAULT
;
hr
=
IDWriteTextFormat_GetLineSpacing
(
format
,
&
layout
->
format
.
spacing
.
method
,
&
layout
->
format
.
spacing
.
height
,
&
layout
->
format
.
spacing
.
baseline
);
if
(
FAILED
(
hr
))
...
...
@@ -5115,7 +5112,8 @@ static HRESULT layout_format_from_textformat(struct dwrite_textlayout *layout, I
layout
->
format
.
family_len
=
len
;
hr
=
IDWriteTextFormat_QueryInterface
(
format
,
&
IID_IDWriteTextFormat1
,
(
void
**
)
&
format1
);
if
(
hr
==
S_OK
)
{
if
(
hr
==
S_OK
)
{
IDWriteTextFormat2
*
format2
;
layout
->
format
.
vertical_orientation
=
IDWriteTextFormat1_GetVerticalGlyphOrientation
(
format1
);
...
...
@@ -5129,10 +5127,6 @@ static HRESULT layout_format_from_textformat(struct dwrite_textlayout *layout, I
IDWriteTextFormat1_Release
(
format1
);
}
else
{
layout
->
format
.
vertical_orientation
=
DWRITE_VERTICAL_GLYPH_ORIENTATION_DEFAULT
;
layout
->
format
.
optical_alignment
=
DWRITE_OPTICAL_ALIGNMENT_NONE
;
}
hr
=
IDWriteTextFormat_QueryInterface
(
format
,
&
IID_IDWriteTextFormat3
,
(
void
**
)
&
format3
);
if
(
hr
==
S_OK
)
...
...
@@ -5157,14 +5151,6 @@ static HRESULT init_textlayout(const struct textlayout_desc *desc, struct dwrite
layout
->
refcount
=
1
;
layout
->
len
=
desc
->
length
;
layout
->
recompute
=
RECOMPUTE_EVERYTHING
;
layout
->
nominal_breakpoints
=
NULL
;
layout
->
actual_breakpoints
=
NULL
;
layout
->
cluster_count
=
0
;
layout
->
clustermetrics
=
NULL
;
layout
->
clusters
=
NULL
;
layout
->
lines
=
NULL
;
layout
->
lines_size
=
0
;
layout
->
minwidth
=
0
.
0
f
;
list_init
(
&
layout
->
eruns
);
list_init
(
&
layout
->
inlineobjects
);
list_init
(
&
layout
->
underlines
);
...
...
@@ -5176,14 +5162,8 @@ static HRESULT init_textlayout(const struct textlayout_desc *desc, struct dwrite
list_init
(
&
layout
->
effects
);
list_init
(
&
layout
->
spacing
);
list_init
(
&
layout
->
typographies
);
memset
(
&
layout
->
format
,
0
,
sizeof
(
layout
->
format
));
memset
(
&
layout
->
metrics
,
0
,
sizeof
(
layout
->
metrics
));
layout
->
metrics
.
layoutWidth
=
desc
->
max_width
;
layout
->
metrics
.
layoutHeight
=
desc
->
max_height
;
layout
->
measuringmode
=
DWRITE_MEASURING_MODE_NATURAL
;
layout
->
ppdip
=
0
.
0
f
;
memset
(
&
layout
->
transform
,
0
,
sizeof
(
layout
->
transform
));
layout
->
str
=
heap_strdupnW
(
desc
->
string
,
desc
->
length
);
if
(
desc
->
length
&&
!
layout
->
str
)
{
...
...
@@ -5212,10 +5192,8 @@ static HRESULT init_textlayout(const struct textlayout_desc *desc, struct dwrite
goto
fail
;
}
if
(
desc
->
is_gdi_compatible
)
layout
->
measuringmode
=
desc
->
use_gdi_natural
?
DWRITE_MEASURING_MODE_GDI_NATURAL
:
DWRITE_MEASURING_MODE_GDI_CLASSIC
;
else
layout
->
measuringmode
=
DWRITE_MEASURING_MODE_NATURAL
;
layout
->
measuringmode
=
desc
->
is_gdi_compatible
?
(
desc
->
use_gdi_natural
?
DWRITE_MEASURING_MODE_GDI_NATURAL
:
DWRITE_MEASURING_MODE_GDI_CLASSIC
)
:
DWRITE_MEASURING_MODE_NATURAL
;
layout
->
ppdip
=
desc
->
ppdip
;
layout
->
transform
=
desc
->
transform
?
*
desc
->
transform
:
identity
;
...
...
@@ -5234,22 +5212,22 @@ fail:
return
hr
;
}
HRESULT
create_textlayout
(
const
struct
textlayout_desc
*
desc
,
IDWriteTextLayout
**
re
t
)
HRESULT
create_textlayout
(
const
struct
textlayout_desc
*
desc
,
IDWriteTextLayout
**
layou
t
)
{
struct
dwrite_textlayout
*
layou
t
;
struct
dwrite_textlayout
*
objec
t
;
HRESULT
hr
;
*
re
t
=
NULL
;
*
layou
t
=
NULL
;
if
(
!
desc
->
format
||
!
desc
->
string
)
return
E_INVALIDARG
;
layout
=
heap_alloc
(
sizeof
(
struct
dwrite_textlayout
));
if
(
!
layout
)
return
E_OUTOFMEMORY
;
if
(
!
(
object
=
heap_alloc_zero
(
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
hr
=
init_textlayout
(
desc
,
layou
t
);
hr
=
init_textlayout
(
desc
,
objec
t
);
if
(
hr
==
S_OK
)
*
ret
=
(
IDWriteTextLayout
*
)
&
layou
t
->
IDWriteTextLayout4_iface
;
*
layout
=
(
IDWriteTextLayout
*
)
&
objec
t
->
IDWriteTextLayout4_iface
;
return
hr
;
}
...
...
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