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
4d512f9e
Commit
4d512f9e
authored
Feb 14, 2016
by
Nikolay Sivov
Committed by
Alexandre Julliard
Feb 15, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Keep factory reference for each layout.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
af206b1b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
10 deletions
+18
-10
dwrite_private.h
dlls/dwrite/dwrite_private.h
+3
-2
layout.c
dlls/dwrite/layout.c
+13
-6
main.c
dlls/dwrite/main.c
+2
-2
No files found.
dlls/dwrite/dwrite_private.h
View file @
4d512f9e
...
...
@@ -115,8 +115,9 @@ extern HRESULT convert_fontface_to_logfont(IDWriteFontFace*, LOGFONTW*) DECLSPEC
extern
HRESULT
create_numbersubstitution
(
DWRITE_NUMBER_SUBSTITUTION_METHOD
,
const
WCHAR
*
locale
,
BOOL
,
IDWriteNumberSubstitution
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_textformat
(
const
WCHAR
*
,
IDWriteFontCollection
*
,
DWRITE_FONT_WEIGHT
,
DWRITE_FONT_STYLE
,
DWRITE_FONT_STRETCH
,
FLOAT
,
const
WCHAR
*
,
IDWriteTextFormat
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_textlayout
(
const
WCHAR
*
,
UINT32
,
IDWriteTextFormat
*
,
FLOAT
,
FLOAT
,
IDWriteTextLayout
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_gdicompat_textlayout
(
const
WCHAR
*
,
UINT32
,
IDWriteTextFormat
*
,
FLOAT
,
FLOAT
,
FLOAT
,
const
DWRITE_MATRIX
*
,
BOOL
,
IDWriteTextLayout
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_textlayout
(
IDWriteFactory2
*
,
const
WCHAR
*
,
UINT32
,
IDWriteTextFormat
*
,
FLOAT
,
FLOAT
,
IDWriteTextLayout
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_gdicompat_textlayout
(
IDWriteFactory2
*
,
const
WCHAR
*
,
UINT32
,
IDWriteTextFormat
*
,
FLOAT
,
FLOAT
,
FLOAT
,
const
DWRITE_MATRIX
*
,
BOOL
,
IDWriteTextLayout
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_trimmingsign
(
IDWriteFactory2
*
,
IDWriteTextFormat
*
,
IDWriteInlineObject
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_typography
(
IDWriteTypography
**
)
DECLSPEC_HIDDEN
;
extern
HRESULT
create_gdiinterop
(
IDWriteFactory2
*
,
IDWriteGdiInterop
**
)
DECLSPEC_HIDDEN
;
...
...
dlls/dwrite/layout.c
View file @
4d512f9e
...
...
@@ -238,6 +238,8 @@ struct dwrite_textlayout {
IDWriteTextAnalysisSource1
IDWriteTextAnalysisSource1_iface
;
LONG
ref
;
IDWriteFactory2
*
factory
;
WCHAR
*
str
;
UINT32
len
;
struct
dwrite_textformat_data
format
;
...
...
@@ -2548,6 +2550,7 @@ static ULONG WINAPI dwritetextlayout_Release(IDWriteTextLayout2 *iface)
TRACE
(
"(%p)->(%d)
\n
"
,
This
,
ref
);
if
(
!
ref
)
{
IDWriteFactory2_Release
(
This
->
factory
);
free_layout_ranges_list
(
This
);
free_layout_eruns
(
This
);
free_layout_runs
(
This
);
...
...
@@ -4353,7 +4356,8 @@ static HRESULT layout_format_from_textformat(struct dwrite_textlayout *layout, I
return
IDWriteTextFormat_GetFontCollection
(
format
,
&
layout
->
format
.
collection
);
}
static
HRESULT
init_textlayout
(
const
WCHAR
*
str
,
UINT32
len
,
IDWriteTextFormat
*
format
,
FLOAT
maxwidth
,
FLOAT
maxheight
,
struct
dwrite_textlayout
*
layout
)
static
HRESULT
init_textlayout
(
IDWriteFactory2
*
factory
,
const
WCHAR
*
str
,
UINT32
len
,
IDWriteTextFormat
*
format
,
FLOAT
maxwidth
,
FLOAT
maxheight
,
struct
dwrite_textlayout
*
layout
)
{
struct
layout_range_header
*
range
,
*
strike
,
*
underline
,
*
effect
,
*
spacing
,
*
typography
;
static
const
DWRITE_TEXT_RANGE
r
=
{
0
,
~
0u
};
...
...
@@ -4421,6 +4425,8 @@ static HRESULT init_textlayout(const WCHAR *str, UINT32 len, IDWriteTextFormat *
goto
fail
;
}
layout
->
factory
=
factory
;
IDWriteFactory2_AddRef
(
layout
->
factory
);
list_add_head
(
&
layout
->
ranges
,
&
range
->
entry
);
list_add_head
(
&
layout
->
strike_ranges
,
&
strike
->
entry
);
list_add_head
(
&
layout
->
underline_ranges
,
&
underline
->
entry
);
...
...
@@ -4434,7 +4440,8 @@ fail:
return
hr
;
}
HRESULT
create_textlayout
(
const
WCHAR
*
str
,
UINT32
len
,
IDWriteTextFormat
*
format
,
FLOAT
maxwidth
,
FLOAT
maxheight
,
IDWriteTextLayout
**
ret
)
HRESULT
create_textlayout
(
IDWriteFactory2
*
factory
,
const
WCHAR
*
str
,
UINT32
len
,
IDWriteTextFormat
*
format
,
FLOAT
maxwidth
,
FLOAT
maxheight
,
IDWriteTextLayout
**
ret
)
{
struct
dwrite_textlayout
*
layout
;
HRESULT
hr
;
...
...
@@ -4447,15 +4454,15 @@ HRESULT create_textlayout(const WCHAR *str, UINT32 len, IDWriteTextFormat *forma
layout
=
heap_alloc
(
sizeof
(
struct
dwrite_textlayout
));
if
(
!
layout
)
return
E_OUTOFMEMORY
;
hr
=
init_textlayout
(
str
,
len
,
format
,
maxwidth
,
maxheight
,
layout
);
hr
=
init_textlayout
(
factory
,
str
,
len
,
format
,
maxwidth
,
maxheight
,
layout
);
if
(
hr
==
S_OK
)
*
ret
=
(
IDWriteTextLayout
*
)
&
layout
->
IDWriteTextLayout2_iface
;
return
hr
;
}
HRESULT
create_gdicompat_textlayout
(
const
WCHAR
*
str
,
UINT32
len
,
IDWriteTextFormat
*
format
,
FLOAT
maxwidth
,
FLOAT
maxheigh
t
,
FLOAT
ppdip
,
const
DWRITE_MATRIX
*
transform
,
BOOL
use_gdi_natural
,
IDWriteTextLayout
**
ret
)
HRESULT
create_gdicompat_textlayout
(
IDWriteFactory2
*
factory
,
const
WCHAR
*
str
,
UINT32
len
,
IDWriteTextFormat
*
forma
t
,
FLOAT
maxwidth
,
FLOAT
maxheight
,
FLOAT
ppdip
,
const
DWRITE_MATRIX
*
transform
,
BOOL
use_gdi_natural
,
IDWriteTextLayout
**
ret
)
{
struct
dwrite_textlayout
*
layout
;
HRESULT
hr
;
...
...
@@ -4468,7 +4475,7 @@ HRESULT create_gdicompat_textlayout(const WCHAR *str, UINT32 len, IDWriteTextFor
layout
=
heap_alloc
(
sizeof
(
struct
dwrite_textlayout
));
if
(
!
layout
)
return
E_OUTOFMEMORY
;
hr
=
init_textlayout
(
str
,
len
,
format
,
maxwidth
,
maxheight
,
layout
);
hr
=
init_textlayout
(
factory
,
str
,
len
,
format
,
maxwidth
,
maxheight
,
layout
);
if
(
hr
==
S_OK
)
{
layout
->
measuringmode
=
use_gdi_natural
?
DWRITE_MEASURING_MODE_GDI_NATURAL
:
DWRITE_MEASURING_MODE_GDI_CLASSIC
;
...
...
dlls/dwrite/main.c
View file @
4d512f9e
...
...
@@ -1059,7 +1059,7 @@ static HRESULT WINAPI dwritefactory_CreateTextLayout(IDWriteFactory2 *iface, WCH
TRACE
(
"(%p)->(%s:%u %p %f %f %p)
\n
"
,
This
,
debugstr_wn
(
string
,
len
),
len
,
format
,
max_width
,
max_height
,
layout
);
return
create_textlayout
(
string
,
len
,
format
,
max_width
,
max_height
,
layout
);
return
create_textlayout
(
iface
,
string
,
len
,
format
,
max_width
,
max_height
,
layout
);
}
static
HRESULT
WINAPI
dwritefactory_CreateGdiCompatibleTextLayout
(
IDWriteFactory2
*
iface
,
WCHAR
const
*
string
,
...
...
@@ -1071,7 +1071,7 @@ static HRESULT WINAPI dwritefactory_CreateGdiCompatibleTextLayout(IDWriteFactory
TRACE
(
"(%p)->(%s:%u %p %f %f %f %p %d %p)
\n
"
,
This
,
debugstr_wn
(
string
,
len
),
len
,
format
,
layout_width
,
layout_height
,
pixels_per_dip
,
transform
,
use_gdi_natural
,
layout
);
return
create_gdicompat_textlayout
(
string
,
len
,
format
,
layout_width
,
layout_height
,
pixels_per_dip
,
transform
,
return
create_gdicompat_textlayout
(
iface
,
string
,
len
,
format
,
layout_width
,
layout_height
,
pixels_per_dip
,
transform
,
use_gdi_natural
,
layout
);
}
...
...
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