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
7a83be7b
Commit
7a83be7b
authored
Dec 25, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
Dec 25, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Optimize for the most common case of layout object initialization.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
e9d47253
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
0 deletions
+27
-0
layout.c
dlls/dwrite/layout.c
+27
-0
No files found.
dlls/dwrite/layout.c
View file @
7a83be7b
...
...
@@ -326,6 +326,8 @@ static inline struct dwrite_textformat *impl_from_IDWriteTextFormat1(IDWriteText
return
CONTAINING_RECORD
(
iface
,
struct
dwrite_textformat
,
IDWriteTextFormat1_iface
);
}
static
struct
dwrite_textformat
*
unsafe_impl_from_IDWriteTextFormat
(
IDWriteTextFormat
*
);
static
inline
struct
dwrite_trimmingsign
*
impl_from_IDWriteInlineObject
(
IDWriteInlineObject
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
dwrite_trimmingsign
,
IDWriteInlineObject_iface
);
...
...
@@ -3896,10 +3898,29 @@ static const IDWriteTextAnalysisSourceVtbl dwritetextlayoutsourcevtbl = {
static
HRESULT
layout_format_from_textformat
(
struct
dwrite_textlayout
*
layout
,
IDWriteTextFormat
*
format
)
{
struct
dwrite_textformat
*
textformat
;
IDWriteTextFormat1
*
format1
;
UINT32
len
;
HRESULT
hr
;
if
((
textformat
=
unsafe_impl_from_IDWriteTextFormat
(
format
)))
{
layout
->
format
=
textformat
->
format
;
layout
->
format
.
locale
=
heap_strdupW
(
textformat
->
format
.
locale
);
layout
->
format
.
family_name
=
heap_strdupW
(
textformat
->
format
.
family_name
);
if
(
!
layout
->
format
.
locale
||
!
layout
->
format
.
family_name
)
return
E_OUTOFMEMORY
;
if
(
layout
->
format
.
trimmingsign
)
IDWriteInlineObject_AddRef
(
layout
->
format
.
trimmingsign
);
if
(
layout
->
format
.
collection
)
IDWriteFontCollection_AddRef
(
layout
->
format
.
collection
);
if
(
layout
->
format
.
fallback
)
IDWriteFontFallback_AddRef
(
layout
->
format
.
fallback
);
return
S_OK
;
}
layout
->
format
.
weight
=
IDWriteTextFormat_GetFontWeight
(
format
);
layout
->
format
.
style
=
IDWriteTextFormat_GetFontStyle
(
format
);
layout
->
format
.
stretch
=
IDWriteTextFormat_GetFontStretch
(
format
);
...
...
@@ -4599,6 +4620,12 @@ static const IDWriteTextFormat1Vtbl dwritetextformatvtbl = {
dwritetextformat1_GetFontFallback
};
static
struct
dwrite_textformat
*
unsafe_impl_from_IDWriteTextFormat
(
IDWriteTextFormat
*
iface
)
{
return
(
iface
->
lpVtbl
==
(
IDWriteTextFormatVtbl
*
)
&
dwritetextformatvtbl
)
?
CONTAINING_RECORD
(
iface
,
struct
dwrite_textformat
,
IDWriteTextFormat1_iface
)
:
NULL
;
}
HRESULT
create_textformat
(
const
WCHAR
*
family_name
,
IDWriteFontCollection
*
collection
,
DWRITE_FONT_WEIGHT
weight
,
DWRITE_FONT_STYLE
style
,
DWRITE_FONT_STRETCH
stretch
,
FLOAT
size
,
const
WCHAR
*
locale
,
IDWriteTextFormat
**
format
)
{
...
...
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