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
a090314c
Commit
a090314c
authored
Nov 07, 2018
by
Nikolay Sivov
Committed by
Alexandre Julliard
Nov 07, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite/tests: Test run bidi level too.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
54cd4464
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
4 deletions
+36
-4
layout.c
dlls/dwrite/tests/layout.c
+36
-4
No files found.
dlls/dwrite/tests/layout.c
View file @
a090314c
...
@@ -311,6 +311,7 @@ struct drawcall_entry {
...
@@ -311,6 +311,7 @@ struct drawcall_entry {
WCHAR
string
[
10
];
/* only meaningful for DrawGlyphRun() */
WCHAR
string
[
10
];
/* only meaningful for DrawGlyphRun() */
WCHAR
locale
[
LOCALE_NAME_MAX_LENGTH
];
WCHAR
locale
[
LOCALE_NAME_MAX_LENGTH
];
UINT32
glyphcount
;
/* only meaningful for DrawGlyphRun() */
UINT32
glyphcount
;
/* only meaningful for DrawGlyphRun() */
UINT32
bidilevel
;
};
};
struct
drawcall_sequence
struct
drawcall_sequence
...
@@ -432,6 +433,17 @@ static void ok_sequence_(struct drawcall_sequence **seq, int sequence_index,
...
@@ -432,6 +433,17 @@ static void ok_sequence_(struct drawcall_sequence **seq, int sequence_index,
ok_
(
file
,
line
)
(
expected
->
glyphcount
==
actual
->
glyphcount
,
ok_
(
file
,
line
)
(
expected
->
glyphcount
==
actual
->
glyphcount
,
"%s: wrong glyph count, %u was expected, but got %u instead
\n
"
,
"%s: wrong glyph count, %u was expected, but got %u instead
\n
"
,
context
,
expected
->
glyphcount
,
actual
->
glyphcount
);
context
,
expected
->
glyphcount
,
actual
->
glyphcount
);
if
(
expected
->
bidilevel
!=
actual
->
bidilevel
&&
todo
)
{
failcount
++
;
todo_wine
ok_
(
file
,
line
)
(
0
,
"%s: wrong bidi level, %u was expected, but got %u instead
\n
"
,
context
,
expected
->
bidilevel
,
actual
->
bidilevel
);
}
else
ok_
(
file
,
line
)
(
expected
->
bidilevel
==
actual
->
bidilevel
,
"%s: wrong bidi level, %u was expected, but got %u instead
\n
"
,
context
,
expected
->
bidilevel
,
actual
->
bidilevel
);
}
}
else
if
((
expected
->
kind
&
DRAW_KINDS_MASK
)
==
DRAW_UNDERLINE
)
{
else
if
((
expected
->
kind
&
DRAW_KINDS_MASK
)
==
DRAW_UNDERLINE
)
{
int
cmp
=
lstrcmpW
(
expected
->
locale
,
actual
->
locale
);
int
cmp
=
lstrcmpW
(
expected
->
locale
,
actual
->
locale
);
...
@@ -606,6 +618,7 @@ static HRESULT WINAPI testrenderer_DrawGlyphRun(IDWriteTextRenderer *iface,
...
@@ -606,6 +618,7 @@ static HRESULT WINAPI testrenderer_DrawGlyphRun(IDWriteTextRenderer *iface,
ok
(
lstrlenW
(
descr
->
localeName
)
<
LOCALE_NAME_MAX_LENGTH
,
"unexpectedly long locale name
\n
"
);
ok
(
lstrlenW
(
descr
->
localeName
)
<
LOCALE_NAME_MAX_LENGTH
,
"unexpectedly long locale name
\n
"
);
lstrcpyW
(
entry
.
locale
,
descr
->
localeName
);
lstrcpyW
(
entry
.
locale
,
descr
->
localeName
);
entry
.
glyphcount
=
run
->
glyphCount
;
entry
.
glyphcount
=
run
->
glyphCount
;
entry
.
bidilevel
=
run
->
bidiLevel
;
add_call
(
sequences
,
RENDERER_ID
,
&
entry
);
add_call
(
sequences
,
RENDERER_ID
,
&
entry
);
return
S_OK
;
return
S_OK
;
}
}
...
@@ -1681,14 +1694,22 @@ static const struct drawcall_entry draw_single_run_seq[] = {
...
@@ -1681,14 +1694,22 @@ static const struct drawcall_entry draw_single_run_seq[] = {
{
DRAW_LAST_KIND
}
{
DRAW_LAST_KIND
}
};
};
static
const
struct
drawcall_entry
draw_reordered_run_seq
[]
=
{
static
const
struct
drawcall_entry
draw_
ltr_
reordered_run_seq
[]
=
{
{
DRAW_GLYPHRUN
,
{
'1'
,
'2'
,
'3'
,
'-'
,
'5'
,
'2'
,
0
},
{
'r'
,
'u'
,
0
},
6
},
{
DRAW_GLYPHRUN
,
{
'1'
,
'2'
,
'3'
,
'-'
,
'5'
,
'2'
,
0
},
{
'r'
,
'u'
,
0
},
6
},
{
DRAW_GLYPHRUN
,
{
0x64a
,
0x64f
,
0x633
,
0x627
,
0x648
,
0x650
,
0x64a
,
0
},
{
'r'
,
'u'
,
0
},
7
},
{
DRAW_GLYPHRUN
,
{
0x64a
,
0x64f
,
0x633
,
0x627
,
0x648
,
0x650
,
0x64a
,
0
},
{
'r'
,
'u'
,
0
},
7
,
1
},
{
DRAW_GLYPHRUN
,
{
'7'
,
'1'
,
0
},
{
'r'
,
'u'
,
0
},
2
},
{
DRAW_GLYPHRUN
,
{
'7'
,
'1'
,
0
},
{
'r'
,
'u'
,
0
},
2
,
2
},
{
DRAW_GLYPHRUN
,
{
'.'
,
0
},
{
'r'
,
'u'
,
0
},
1
},
{
DRAW_GLYPHRUN
,
{
'.'
,
0
},
{
'r'
,
'u'
,
0
},
1
},
{
DRAW_LAST_KIND
}
{
DRAW_LAST_KIND
}
};
};
static
const
struct
drawcall_entry
draw_rtl_reordered_run_seq
[]
=
{
{
DRAW_GLYPHRUN
,
{
'1'
,
'2'
,
'3'
,
'-'
,
'5'
,
'2'
,
0
},
{
'r'
,
'u'
,
0
},
6
,
2
},
{
DRAW_GLYPHRUN
,
{
0x64a
,
0x64f
,
0x633
,
0x627
,
0x648
,
0x650
,
0x64a
,
0
},
{
'r'
,
'u'
,
0
},
7
,
1
},
{
DRAW_GLYPHRUN
,
{
'7'
,
'1'
,
0
},
{
'r'
,
'u'
,
0
},
2
,
2
},
{
DRAW_GLYPHRUN
,
{
'.'
,
0
},
{
'r'
,
'u'
,
0
},
1
,
1
},
{
DRAW_LAST_KIND
}
};
static
void
test_Draw
(
void
)
static
void
test_Draw
(
void
)
{
{
static
const
WCHAR
str3W
[]
=
{
'1'
,
'2'
,
'3'
,
'-'
,
'5'
,
'2'
,
0x64a
,
0x64f
,
0x633
,
0x627
,
0x648
,
0x650
,
static
const
WCHAR
str3W
[]
=
{
'1'
,
'2'
,
'3'
,
'-'
,
'5'
,
'2'
,
0x64a
,
0x64f
,
0x633
,
0x627
,
0x648
,
0x650
,
...
@@ -1887,10 +1908,21 @@ todo_wine
...
@@ -1887,10 +1908,21 @@ todo_wine
ctxt
.
use_gdi_natural
=
FALSE
;
ctxt
.
use_gdi_natural
=
FALSE
;
ctxt
.
snapping_disabled
=
TRUE
;
ctxt
.
snapping_disabled
=
TRUE
;
hr
=
IDWriteTextLayout_SetReadingDirection
(
layout
,
DWRITE_READING_DIRECTION_LEFT_TO_RIGHT
);
ok
(
hr
==
S_OK
,
"Failed to set reading direction, hr %#x.
\n
"
,
hr
);
flush_sequence
(
sequences
,
RENDERER_ID
);
hr
=
IDWriteTextLayout_Draw
(
layout
,
&
ctxt
,
&
testrenderer
,
0
.
0
f
,
0
.
0
f
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok_sequence
(
sequences
,
RENDERER_ID
,
draw_ltr_reordered_run_seq
,
"draw test 11"
,
FALSE
);
hr
=
IDWriteTextLayout_SetReadingDirection
(
layout
,
DWRITE_READING_DIRECTION_RIGHT_TO_LEFT
);
ok
(
hr
==
S_OK
,
"Failed to set reading direction, hr %#x.
\n
"
,
hr
);
flush_sequence
(
sequences
,
RENDERER_ID
);
flush_sequence
(
sequences
,
RENDERER_ID
);
hr
=
IDWriteTextLayout_Draw
(
layout
,
&
ctxt
,
&
testrenderer
,
0
.
0
f
,
0
.
0
f
);
hr
=
IDWriteTextLayout_Draw
(
layout
,
&
ctxt
,
&
testrenderer
,
0
.
0
f
,
0
.
0
f
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok_sequence
(
sequences
,
RENDERER_ID
,
draw_r
eordered_run_seq
,
"draw test 11
"
,
FALSE
);
ok_sequence
(
sequences
,
RENDERER_ID
,
draw_r
tl_reordered_run_seq
,
"draw test 12
"
,
FALSE
);
IDWriteTextLayout_Release
(
layout
);
IDWriteTextLayout_Release
(
layout
);
...
...
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