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
31496c60
Commit
31496c60
authored
Nov 26, 2014
by
Nikolay Sivov
Committed by
Alexandre Julliard
Nov 27, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Use stream fragment context when reading font tables.
parent
d1bd7094
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
38 deletions
+2
-38
font.c
dlls/dwrite/font.c
+2
-36
font.c
dlls/dwrite/tests/font.c
+0
-2
No files found.
dlls/dwrite/font.c
View file @
31496c60
...
...
@@ -91,14 +91,6 @@ struct dwrite_font {
struct
dwrite_font_data
*
data
;
};
#define DWRITE_FONTTABLE_MAGIC 0xededfafa
struct
dwrite_fonttablecontext
{
UINT32
magic
;
void
*
context
;
UINT32
file_index
;
};
struct
dwrite_fonttable
{
void
*
data
;
void
*
context
;
...
...
@@ -359,45 +351,19 @@ static HRESULT WINAPI dwritefontface_TryGetFontTable(IDWriteFontFace2 *iface, UI
const
void
**
table_data
,
UINT32
*
table_size
,
void
**
context
,
BOOL
*
exists
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace2
(
iface
);
struct
dwrite_fonttablecontext
*
tablecontext
;
HRESULT
hr
=
S_OK
;
int
i
;
TRACE
(
"(%p)->(%u %p %p %p %p)
\n
"
,
This
,
table_tag
,
table_data
,
table_size
,
context
,
exists
);
tablecontext
=
heap_alloc
(
sizeof
(
struct
dwrite_fonttablecontext
));
if
(
!
tablecontext
)
return
E_OUTOFMEMORY
;
tablecontext
->
magic
=
DWRITE_FONTTABLE_MAGIC
;
*
exists
=
FALSE
;
for
(
i
=
0
;
i
<
This
->
file_count
&&
!
(
*
exists
);
i
++
)
{
hr
=
opentype_get_font_table
(
This
->
streams
[
i
],
This
->
type
,
This
->
index
,
table_tag
,
table_data
,
&
tablecontext
->
context
,
table_size
,
exists
);
tablecontext
->
file_index
=
i
;
}
if
(
FAILED
(
hr
)
&&
!*
exists
)
heap_free
(
tablecontext
);
else
*
context
=
(
void
*
)
tablecontext
;
return
hr
;
return
opentype_get_font_table
(
This
->
streams
[
0
],
This
->
type
,
This
->
index
,
table_tag
,
table_data
,
context
,
table_size
,
exists
);
}
static
void
WINAPI
dwritefontface_ReleaseFontTable
(
IDWriteFontFace2
*
iface
,
void
*
table_context
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace2
(
iface
);
struct
dwrite_fonttablecontext
*
tablecontext
=
(
struct
dwrite_fonttablecontext
*
)
table_context
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
table_context
);
if
(
tablecontext
->
magic
!=
DWRITE_FONTTABLE_MAGIC
)
{
TRACE
(
"Invalid table magic
\n
"
);
return
;
}
IDWriteFontFileStream_ReleaseFileFragment
(
This
->
streams
[
tablecontext
->
file_index
],
tablecontext
->
context
);
heap_free
(
tablecontext
);
IDWriteFontFileStream_ReleaseFileFragment
(
This
->
streams
[
0
],
table_context
);
}
static
HRESULT
WINAPI
dwritefontface_GetGlyphRunOutline
(
IDWriteFontFace2
*
iface
,
FLOAT
emSize
,
...
...
dlls/dwrite/tests/font.c
View file @
31496c60
...
...
@@ -2324,7 +2324,6 @@ static void test_TryGetFontTable(void)
hr
=
IDWriteFontFace_TryGetFontTable
(
fontface
,
MS_CMAP_TAG
,
&
table
,
&
size
,
&
context
,
&
exists
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
exists
==
TRUE
,
"got %d
\n
"
,
exists
);
todo_wine
ok
(
context
==
NULL
&&
table
!=
NULL
,
"cmap: context %p, table %p
\n
"
,
context
,
table
);
exists
=
FALSE
;
...
...
@@ -2333,7 +2332,6 @@ todo_wine
hr
=
IDWriteFontFace_TryGetFontTable
(
fontface
,
MS_CMAP_TAG
,
&
table2
,
&
size
,
&
context2
,
&
exists
);
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
exists
==
TRUE
,
"got %d
\n
"
,
exists
);
todo_wine
ok
(
context2
==
context
&&
table2
==
table
,
"cmap: context2 %p, table2 %p
\n
"
,
context2
,
table2
);
IDWriteFontFace_ReleaseFontTable
(
fontface
,
context2
);
...
...
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