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
72dcc4d4
Commit
72dcc4d4
authored
Jun 04, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jun 05, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite/tests: Test actual strings being reported to a renderer.
parent
ff6201c6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
55 additions
and
11 deletions
+55
-11
layout.c
dlls/dwrite/tests/layout.c
+55
-11
No files found.
dlls/dwrite/tests/layout.c
View file @
72dcc4d4
...
...
@@ -231,6 +231,7 @@ static const char *get_draw_kind_name(enum drawcall_kind kind)
struct
drawcall_entry
{
enum
drawcall_kind
kind
;
WCHAR
string
[
10
];
/* only meaningful for DrawGlyphRun() */
};
struct
drawcall_sequence
...
...
@@ -326,6 +327,18 @@ static void ok_sequence_(struct drawcall_sequence **seq, int sequence_index,
ok_
(
file
,
line
)
(
0
,
"%s: call %s was expected, but got call %s instead
\n
"
,
context
,
get_draw_kind_name
(
expected
->
kind
),
get_draw_kind_name
(
actual
->
kind
));
}
else
if
(
expected
->
kind
==
DRAW_GLYPHRUN
)
{
int
cmp
=
lstrcmpW
(
expected
->
string
,
actual
->
string
);
if
(
cmp
!=
0
&&
todo
)
{
failcount
++
;
todo_wine
ok_
(
file
,
line
)
(
0
,
"%s: glyphrun string %s was expected, but got %s instead
\n
"
,
context
,
wine_dbgstr_w
(
expected
->
string
),
wine_dbgstr_w
(
actual
->
string
));
}
else
ok_
(
file
,
line
)
(
cmp
==
0
,
"%s: glyphrun string %s was expected, but got %s instead
\n
"
,
context
,
wine_dbgstr_w
(
expected
->
string
),
wine_dbgstr_w
(
actual
->
string
));
}
expected
++
;
actual
++
;
}
...
...
@@ -421,6 +434,14 @@ static HRESULT WINAPI testrenderer_DrawGlyphRun(IDWriteTextRenderer *iface,
struct
drawcall_entry
entry
;
DWRITE_SCRIPT_ANALYSIS
sa
;
ok
(
descr
->
stringLength
<
sizeof
(
entry
.
string
)
/
sizeof
(
WCHAR
),
"string is too long
\n
"
);
if
(
descr
->
stringLength
&&
descr
->
stringLength
<
sizeof
(
entry
.
string
)
/
sizeof
(
WCHAR
))
{
memcpy
(
entry
.
string
,
descr
->
string
,
descr
->
stringLength
*
sizeof
(
WCHAR
));
entry
.
string
[
descr
->
stringLength
]
=
0
;
}
else
entry
.
string
[
0
]
=
0
;
/* see what's reported for control codes runs */
get_script_analysis
(
descr
->
string
,
descr
->
stringLength
,
&
sa
);
if
(
sa
.
script
==
g_control_sa
.
script
)
{
...
...
@@ -1102,10 +1123,10 @@ static void test_SetInlineObject(void)
/* drawing calls sequence doesn't depend on run order, instead all runs are
drawn first, inline objects next and then underline/strikes */
static
const
struct
drawcall_entry
draw_seq
[]
=
{
{
DRAW_GLYPHRUN
},
{
DRAW_GLYPHRUN
},
{
DRAW_GLYPHRUN
},
{
DRAW_GLYPHRUN
},
{
DRAW_GLYPHRUN
,
{
's'
,
0
}
},
{
DRAW_GLYPHRUN
,
{
'r'
,
'i'
,
0
}
},
{
DRAW_GLYPHRUN
,
{
'n'
,
0
}
},
{
DRAW_GLYPHRUN
,
{
'g'
,
0
}
},
{
DRAW_INLINE
},
{
DRAW_UNDERLINE
},
{
DRAW_STRIKETHROUGH
},
...
...
@@ -1113,18 +1134,25 @@ static const struct drawcall_entry draw_seq[] = {
};
static
const
struct
drawcall_entry
draw_seq2
[]
=
{
{
DRAW_GLYPHRUN
},
{
DRAW_GLYPHRUN
},
{
DRAW_GLYPHRUN
},
{
DRAW_GLYPHRUN
},
{
DRAW_GLYPHRUN
},
{
DRAW_GLYPHRUN
},
{
DRAW_GLYPHRUN
,
{
's'
,
0
}
},
{
DRAW_GLYPHRUN
,
{
't'
,
0
}
},
{
DRAW_GLYPHRUN
,
{
'r'
,
0
}
},
{
DRAW_GLYPHRUN
,
{
'i'
,
0
}
},
{
DRAW_GLYPHRUN
,
{
'n'
,
0
}
},
{
DRAW_GLYPHRUN
,
{
'g'
,
0
}
},
{
DRAW_LAST_KIND
}
};
static
const
struct
drawcall_entry
draw_seq3
[]
=
{
{
DRAW_GLYPHRUN
},
{
DRAW_GLYPHRUN
},
{
DRAW_GLYPHRUN
,
{
'a'
,
'b'
,
0
}
},
{
DRAW_LAST_KIND
}
};
static
const
struct
drawcall_entry
draw_seq4
[]
=
{
{
DRAW_GLYPHRUN
,
{
's'
,
't'
,
'r'
,
0
}
},
{
DRAW_GLYPHRUN
,
{
'i'
,
'n'
,
'g'
,
0
}
},
{
DRAW_STRIKETHROUGH
},
{
DRAW_LAST_KIND
}
};
...
...
@@ -1197,6 +1225,22 @@ static void test_Draw(void)
ok_sequence
(
sequences
,
RENDERER_ID
,
draw_seq3
,
"draw test 3"
,
TRUE
);
IDWriteTextLayout_Release
(
layout
);
/* strikethrough splits ranges from renderer point of view, but doesn't break
shaping */
hr
=
IDWriteFactory_CreateTextLayout
(
factory
,
strW
,
6
,
format
,
500
.
0
,
100
.
0
,
&
layout
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
flush_sequence
(
sequences
,
RENDERER_ID
);
range
.
startPosition
=
0
;
range
.
length
=
3
;
hr
=
IDWriteTextLayout_SetStrikethrough
(
layout
,
TRUE
,
range
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
hr
=
IDWriteTextLayout_Draw
(
layout
,
NULL
,
&
testrenderer
,
0
.
0
,
0
.
0
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok_sequence
(
sequences
,
RENDERER_ID
,
draw_seq4
,
"draw test 4"
,
TRUE
);
IDWriteTextLayout_Release
(
layout
);
IDWriteTextFormat_Release
(
format
);
IDWriteFactory_Release
(
factory
);
}
...
...
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