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
7a64715b
Commit
7a64715b
authored
Jul 06, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jul 06, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Remove separate line count layout field.
parent
7b5f3188
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
10 deletions
+7
-10
layout.c
dlls/dwrite/layout.c
+7
-10
No files found.
dlls/dwrite/layout.c
View file @
7a64715b
...
@@ -243,7 +243,6 @@ struct dwrite_textlayout {
...
@@ -243,7 +243,6 @@ struct dwrite_textlayout {
FLOAT
minwidth
;
FLOAT
minwidth
;
DWRITE_LINE_METRICS
*
lines
;
DWRITE_LINE_METRICS
*
lines
;
UINT32
line_count
;
UINT32
line_alloc
;
UINT32
line_alloc
;
DWRITE_TEXT_METRICS1
metrics
;
DWRITE_TEXT_METRICS1
metrics
;
...
@@ -1028,7 +1027,7 @@ static HRESULT layout_set_line_metrics(struct dwrite_textlayout *layout, DWRITE_
...
@@ -1028,7 +1027,7 @@ static HRESULT layout_set_line_metrics(struct dwrite_textlayout *layout, DWRITE_
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
}
}
if
(
layout
->
line_c
ount
==
layout
->
line_alloc
)
{
if
(
layout
->
metrics
.
lineC
ount
==
layout
->
line_alloc
)
{
DWRITE_LINE_METRICS
*
l
=
heap_realloc
(
layout
->
lines
,
layout
->
line_alloc
*
2
*
sizeof
(
*
layout
->
lines
));
DWRITE_LINE_METRICS
*
l
=
heap_realloc
(
layout
->
lines
,
layout
->
line_alloc
*
2
*
sizeof
(
*
layout
->
lines
));
if
(
!
l
)
if
(
!
l
)
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
...
@@ -1037,7 +1036,7 @@ static HRESULT layout_set_line_metrics(struct dwrite_textlayout *layout, DWRITE_
...
@@ -1037,7 +1036,7 @@ static HRESULT layout_set_line_metrics(struct dwrite_textlayout *layout, DWRITE_
}
}
layout
->
lines
[
*
line
]
=
*
metrics
;
layout
->
lines
[
*
line
]
=
*
metrics
;
layout
->
line_c
ount
+=
1
;
layout
->
metrics
.
lineC
ount
+=
1
;
*
line
+=
1
;
*
line
+=
1
;
return
S_OK
;
return
S_OK
;
}
}
...
@@ -1094,7 +1093,7 @@ static HRESULT layout_compute_effective_runs(struct dwrite_textlayout *layout)
...
@@ -1094,7 +1093,7 @@ static HRESULT layout_compute_effective_runs(struct dwrite_textlayout *layout)
if
(
FAILED
(
hr
))
if
(
FAILED
(
hr
))
return
hr
;
return
hr
;
layout
->
line_c
ount
=
0
;
layout
->
metrics
.
lineC
ount
=
0
;
origin_x
=
0
.
0
;
origin_x
=
0
.
0
;
line
=
0
;
line
=
0
;
run
=
layout
->
clusters
[
0
].
run
;
run
=
layout
->
clusters
[
0
].
run
;
...
@@ -1214,7 +1213,6 @@ static HRESULT layout_compute_effective_runs(struct dwrite_textlayout *layout)
...
@@ -1214,7 +1213,6 @@ static HRESULT layout_compute_effective_runs(struct dwrite_textlayout *layout)
layout
->
metrics
.
left
=
layout
->
metrics
.
top
=
0
.
0
;
layout
->
metrics
.
left
=
layout
->
metrics
.
top
=
0
.
0
;
layout
->
metrics
.
maxBidiReorderingDepth
=
1
;
/* FIXME */
layout
->
metrics
.
maxBidiReorderingDepth
=
1
;
/* FIXME */
layout
->
metrics
.
lineCount
=
layout
->
line_count
;
layout
->
metrics
.
height
=
0
.
0
;
layout
->
metrics
.
height
=
0
.
0
;
/* Now all line info is here, update effective runs positions in flow direction */
/* Now all line info is here, update effective runs positions in flow direction */
...
@@ -1222,7 +1220,7 @@ static HRESULT layout_compute_effective_runs(struct dwrite_textlayout *layout)
...
@@ -1222,7 +1220,7 @@ static HRESULT layout_compute_effective_runs(struct dwrite_textlayout *layout)
inrun
=
layout_get_next_inline_run
(
layout
,
NULL
);
inrun
=
layout_get_next_inline_run
(
layout
,
NULL
);
origin_y
=
0
.
0
;
origin_y
=
0
.
0
;
for
(
line
=
0
;
line
<
layout
->
line_c
ount
;
line
++
)
{
for
(
line
=
0
;
line
<
layout
->
metrics
.
lineC
ount
;
line
++
)
{
origin_y
+=
layout
->
lines
[
line
].
baseline
;
origin_y
+=
layout
->
lines
[
line
].
baseline
;
...
@@ -2599,10 +2597,10 @@ static HRESULT WINAPI dwritetextlayout_GetLineMetrics(IDWriteTextLayout2 *iface,
...
@@ -2599,10 +2597,10 @@ static HRESULT WINAPI dwritetextlayout_GetLineMetrics(IDWriteTextLayout2 *iface,
return
hr
;
return
hr
;
if
(
metrics
)
if
(
metrics
)
memcpy
(
metrics
,
This
->
lines
,
sizeof
(
DWRITE_LINE_METRICS
)
*
min
(
max_count
,
This
->
line_c
ount
));
memcpy
(
metrics
,
This
->
lines
,
sizeof
(
*
metrics
)
*
min
(
max_count
,
This
->
metrics
.
lineC
ount
));
*
count
=
This
->
line_c
ount
;
*
count
=
This
->
metrics
.
lineC
ount
;
return
max_count
>=
This
->
line_c
ount
?
S_OK
:
E_NOT_SUFFICIENT_BUFFER
;
return
max_count
>=
This
->
metrics
.
lineC
ount
?
S_OK
:
E_NOT_SUFFICIENT_BUFFER
;
}
}
static
HRESULT
WINAPI
dwritetextlayout_GetMetrics
(
IDWriteTextLayout2
*
iface
,
DWRITE_TEXT_METRICS
*
metrics
)
static
HRESULT
WINAPI
dwritetextlayout_GetMetrics
(
IDWriteTextLayout2
*
iface
,
DWRITE_TEXT_METRICS
*
metrics
)
...
@@ -3556,7 +3554,6 @@ static HRESULT init_textlayout(const WCHAR *str, UINT32 len, IDWriteTextFormat *
...
@@ -3556,7 +3554,6 @@ static HRESULT init_textlayout(const WCHAR *str, UINT32 len, IDWriteTextFormat *
layout
->
clustermetrics
=
NULL
;
layout
->
clustermetrics
=
NULL
;
layout
->
clusters
=
NULL
;
layout
->
clusters
=
NULL
;
layout
->
lines
=
NULL
;
layout
->
lines
=
NULL
;
layout
->
line_count
=
0
;
layout
->
line_alloc
=
0
;
layout
->
line_alloc
=
0
;
layout
->
minwidth
=
0
.
0
;
layout
->
minwidth
=
0
.
0
;
list_init
(
&
layout
->
eruns
);
list_init
(
&
layout
->
eruns
);
...
...
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