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
2e977e11
Commit
2e977e11
authored
Oct 23, 2012
by
Nikolay Sivov
Committed by
Alexandre Julliard
Oct 23, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Separate format data and keep it in both layout and text format.
parent
22508806
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
22 deletions
+32
-22
layout.c
dlls/dwrite/layout.c
+32
-22
No files found.
dlls/dwrite/layout.c
View file @
2e977e11
...
...
@@ -32,17 +32,7 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
dwrite
);
struct
dwrite_textlayout
{
IDWriteTextLayout
IDWriteTextLayout_iface
;
LONG
ref
;
WCHAR
*
str
;
};
struct
dwrite_textformat
{
IDWriteTextFormat
IDWriteTextFormat_iface
;
LONG
ref
;
struct
dwrite_textformat_data
{
WCHAR
*
family_name
;
WCHAR
*
locale
;
...
...
@@ -55,6 +45,27 @@ struct dwrite_textformat {
IDWriteFontCollection
*
collection
;
};
struct
dwrite_textlayout
{
IDWriteTextLayout
IDWriteTextLayout_iface
;
LONG
ref
;
WCHAR
*
str
;
struct
dwrite_textformat_data
format
;
};
struct
dwrite_textformat
{
IDWriteTextFormat
IDWriteTextFormat_iface
;
LONG
ref
;
struct
dwrite_textformat_data
format
;
};
static
void
release_format_data
(
struct
dwrite_textformat_data
*
data
)
{
if
(
data
->
collection
)
IDWriteFontCollection_Release
(
data
->
collection
);
heap_free
(
data
->
family_name
);
heap_free
(
data
->
locale
);
}
static
inline
struct
dwrite_textlayout
*
impl_from_IDWriteTextLayout
(
IDWriteTextLayout
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
dwrite_textlayout
,
IDWriteTextLayout_iface
);
...
...
@@ -665,6 +676,7 @@ HRESULT create_textlayout(const WCHAR *str, UINT32 len, IDWriteTextLayout **layo
This
->
IDWriteTextLayout_iface
.
lpVtbl
=
&
dwritetextlayoutvtbl
;
This
->
ref
=
1
;
This
->
str
=
heap_strdupnW
(
str
,
len
);
memset
(
&
This
->
format
,
0
,
sizeof
(
This
->
format
));
*
layout
=
&
This
->
IDWriteTextLayout_iface
;
...
...
@@ -707,9 +719,7 @@ static ULONG WINAPI dwritetextformat_Release(IDWriteTextFormat *iface)
if
(
!
ref
)
{
if
(
This
->
collection
)
IDWriteFontCollection_Release
(
This
->
collection
);
heap_free
(
This
->
family_name
);
heap_free
(
This
->
locale
);
release_format_data
(
&
This
->
format
);
heap_free
(
This
);
}
...
...
@@ -838,7 +848,7 @@ static HRESULT WINAPI dwritetextformat_GetFontCollection(IDWriteTextFormat *ifac
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
collection
);
*
collection
=
This
->
collection
;
*
collection
=
This
->
format
.
collection
;
IDWriteFontCollection_AddRef
(
*
collection
);
return
S_OK
;
...
...
@@ -943,20 +953,20 @@ HRESULT create_textformat(const WCHAR *family_name, IDWriteFontCollection *colle
This
->
IDWriteTextFormat_iface
.
lpVtbl
=
&
dwritetextformatvtbl
;
This
->
ref
=
1
;
This
->
family_name
=
heap_strdupW
(
family_name
);
This
->
locale
=
heap_strdupW
(
locale
);
This
->
weight
=
weight
;
This
->
style
=
style
;
This
->
size
=
size
;
This
->
f
ormat
.
f
amily_name
=
heap_strdupW
(
family_name
);
This
->
format
.
locale
=
heap_strdupW
(
locale
);
This
->
format
.
weight
=
weight
;
This
->
format
.
style
=
style
;
This
->
format
.
size
=
size
;
if
(
collection
)
{
This
->
collection
=
collection
;
This
->
format
.
collection
=
collection
;
IDWriteFontCollection_AddRef
(
collection
);
}
else
{
HRESULT
hr
=
get_system_fontcollection
(
&
This
->
collection
);
HRESULT
hr
=
get_system_fontcollection
(
&
This
->
format
.
collection
);
if
(
hr
!=
S_OK
)
{
IDWriteTextFormat_Release
(
&
This
->
IDWriteTextFormat_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