Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lorenzo Ferrillo
wine
Commits
2e977e11
Commit
2e977e11
authored
12 years ago
by
Nikolay Sivov
Committed by
Alexandre Julliard
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
dwrite: Separate format data and keep it in both layout and text format.
parent
22508806
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/dwrite/layout.c
+32
-22
32 additions, 22 deletions
dlls/dwrite/layout.c
with
32 additions
and
22 deletions
dlls/dwrite/layout.c
+
32
−
22
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
->
format
.
family_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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment