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
83aafaaa
Commit
83aafaaa
authored
Dec 25, 2014
by
Nikolay Sivov
Committed by
Alexandre Julliard
Dec 28, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Store nominal breakpoint data in layout.
parent
ac4c85ea
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
1 deletion
+29
-1
layout.c
dlls/dwrite/layout.c
+29
-1
No files found.
dlls/dwrite/layout.c
View file @
83aafaaa
...
...
@@ -120,6 +120,8 @@ struct dwrite_textlayout {
struct
list
ranges
;
struct
list
runs
;
BOOL
recompute
;
DWRITE_LINE_BREAKPOINT
*
breakpoints
;
};
struct
dwrite_textformat
{
...
...
@@ -276,6 +278,24 @@ static HRESULT layout_compute(struct dwrite_textlayout *layout)
}
}
/* nominal breakpoints are evaluated only once, because string never changes */
if
(
!
layout
->
breakpoints
)
{
IDWriteTextAnalyzer
*
analyzer
;
HRESULT
hr
;
layout
->
breakpoints
=
heap_alloc
(
sizeof
(
DWRITE_LINE_BREAKPOINT
)
*
layout
->
len
);
if
(
!
layout
->
breakpoints
)
return
E_OUTOFMEMORY
;
hr
=
get_textanalyzer
(
&
analyzer
);
if
(
FAILED
(
hr
))
return
hr
;
hr
=
IDWriteTextAnalyzer_AnalyzeLineBreakpoints
(
analyzer
,
&
layout
->
IDWriteTextAnalysisSource_iface
,
0
,
layout
->
len
,
&
layout
->
IDWriteTextAnalysisSink_iface
);
IDWriteTextAnalyzer_Release
(
analyzer
);
}
layout
->
recompute
=
FALSE
;
return
hr
;
}
...
...
@@ -675,6 +695,7 @@ static ULONG WINAPI dwritetextlayout_Release(IDWriteTextLayout2 *iface)
free_layout_ranges_list
(
This
);
free_layout_runs
(
This
);
release_format_data
(
&
This
->
format
);
heap_free
(
This
->
breakpoints
);
heap_free
(
This
->
str
);
heap_free
(
This
);
}
...
...
@@ -1575,7 +1596,13 @@ static HRESULT WINAPI dwritetextlayout_sink_SetScriptAnalysis(IDWriteTextAnalysi
static
HRESULT
WINAPI
dwritetextlayout_sink_SetLineBreakpoints
(
IDWriteTextAnalysisSink
*
iface
,
UINT32
position
,
UINT32
length
,
DWRITE_LINE_BREAKPOINT
const
*
breakpoints
)
{
return
E_NOTIMPL
;
struct
dwrite_textlayout
*
layout
=
impl_from_IDWriteTextAnalysisSink
(
iface
);
if
(
position
+
length
>
layout
->
len
)
return
E_FAIL
;
memcpy
(
&
layout
->
breakpoints
[
position
],
breakpoints
,
length
*
sizeof
(
DWRITE_LINE_BREAKPOINT
));
return
S_OK
;
}
static
HRESULT
WINAPI
dwritetextlayout_sink_SetBidiLevel
(
IDWriteTextAnalysisSink
*
iface
,
UINT32
position
,
...
...
@@ -1806,6 +1833,7 @@ HRESULT create_textlayout(const WCHAR *str, UINT32 len, IDWriteTextFormat *forma
This
->
maxwidth
=
maxwidth
;
This
->
maxheight
=
maxheight
;
This
->
recompute
=
TRUE
;
This
->
breakpoints
=
NULL
;
layout_format_from_textformat
(
This
,
format
);
list_init
(
&
This
->
runs
);
...
...
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