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
dcb8094a
Commit
dcb8094a
authored
Jul 25, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jul 25, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Use u32-reads for AnalyzeScript().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
parent
7fd01cf7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
19 deletions
+12
-19
analyzer.c
dlls/dwrite/analyzer.c
+12
-19
No files found.
dlls/dwrite/analyzer.c
View file @
dcb8094a
...
...
@@ -513,22 +513,21 @@ static DWRITE_SCRIPT_ANALYSIS get_char_sa(WCHAR c)
return
sa
;
}
static
HRESULT
analyze_script
(
const
WCHAR
*
text
,
UINT32
position
,
UINT32
length
,
IDWriteTextAnalysisSink
*
sink
)
static
HRESULT
analyze_script
(
struct
text_source_context
*
context
,
IDWriteTextAnalysisSink
*
sink
)
{
DWRITE_SCRIPT_ANALYSIS
sa
;
UINT32
pos
,
i
,
seq_length
;
UINT32
pos
,
seq_length
;
if
(
!
length
)
return
S_OK
;
text_source_get_next_u32_char
(
context
);
sa
=
get_char_sa
(
*
text
);
sa
=
get_char_sa
(
context
->
ch
);
pos
=
position
;
pos
=
context
->
position
;
seq_length
=
1
;
for
(
i
=
1
;
i
<
length
;
i
++
)
while
(
!
text_source_get_next_u32_char
(
context
)
)
{
DWRITE_SCRIPT_ANALYSIS
cur_sa
=
get_char_sa
(
text
[
i
]
);
DWRITE_SCRIPT_ANALYSIS
cur_sa
=
get_char_sa
(
context
->
ch
);
/* Unknown type is ignored when preceded or followed by another script */
switch
(
sa
.
script
)
{
...
...
@@ -554,7 +553,7 @@ static HRESULT analyze_script(const WCHAR *text, UINT32 position, UINT32 length,
hr
=
IDWriteTextAnalysisSink_SetScriptAnalysis
(
sink
,
pos
,
seq_length
,
&
sa
);
if
(
FAILED
(
hr
))
return
hr
;
pos
=
position
+
i
;
pos
+=
seq_length
;
seq_length
=
1
;
sa
=
cur_sa
;
}
...
...
@@ -1104,23 +1103,17 @@ static HRESULT get_text_source_ptr(IDWriteTextAnalysisSource *source, UINT32 pos
static
HRESULT
WINAPI
dwritetextanalyzer_AnalyzeScript
(
IDWriteTextAnalyzer2
*
iface
,
IDWriteTextAnalysisSource
*
source
,
UINT32
position
,
UINT32
length
,
IDWriteTextAnalysisSink
*
sink
)
{
WCHAR
*
buff
=
NULL
;
const
WCHAR
*
text
;
struct
text_source_context
context
;
HRESULT
hr
;
TRACE
(
"%p, %u, %u, %p.
\n
"
,
source
,
position
,
length
,
sink
);
if
(
length
==
0
)
if
(
!
length
)
return
S_OK
;
hr
=
get_text_source_ptr
(
source
,
position
,
length
,
&
text
,
&
buff
);
if
(
FAILED
(
hr
))
return
hr
;
hr
=
analyze_script
(
text
,
position
,
length
,
sink
);
free
(
buff
);
if
(
FAILED
(
hr
=
text_source_context_init
(
&
context
,
source
,
position
,
length
)))
return
hr
;
return
hr
;
return
analyze_script
(
&
context
,
sink
)
;
}
static
HRESULT
WINAPI
dwritetextanalyzer_AnalyzeBidi
(
IDWriteTextAnalyzer2
*
iface
,
...
...
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