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
4d3e0ba0
Commit
4d3e0ba0
authored
Jan 27, 2020
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jan 27, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Implement IDWriteFont::Equals().
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0a5747bf
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
27 deletions
+36
-27
font.c
dlls/dwrite/font.c
+36
-27
No files found.
dlls/dwrite/font.c
View file @
4d3e0ba0
...
...
@@ -295,6 +295,8 @@ static inline struct dwrite_font *impl_from_IDWriteFont3(IDWriteFont3 *iface)
return
CONTAINING_RECORD
(
iface
,
struct
dwrite_font
,
IDWriteFont3_iface
);
}
static
struct
dwrite_font
*
unsafe_impl_from_IDWriteFont
(
IDWriteFont
*
iface
);
static
inline
struct
dwrite_fontfile
*
impl_from_IDWriteFontFile
(
IDWriteFontFile
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
struct
dwrite_fontfile
,
IDWriteFontFile_iface
);
...
...
@@ -467,6 +469,29 @@ void fontface_detach_from_cache(IDWriteFontFace5 *iface)
fontface
->
cached
=
NULL
;
}
static
BOOL
is_same_fontfile
(
IDWriteFontFile
*
left
,
IDWriteFontFile
*
right
)
{
UINT32
left_key_size
,
right_key_size
;
const
void
*
left_key
,
*
right_key
;
HRESULT
hr
;
if
(
left
==
right
)
return
TRUE
;
hr
=
IDWriteFontFile_GetReferenceKey
(
left
,
&
left_key
,
&
left_key_size
);
if
(
FAILED
(
hr
))
return
FALSE
;
hr
=
IDWriteFontFile_GetReferenceKey
(
right
,
&
right_key
,
&
right_key_size
);
if
(
FAILED
(
hr
))
return
FALSE
;
if
(
left_key_size
!=
right_key_size
)
return
FALSE
;
return
!
memcmp
(
left_key
,
right_key
,
left_key_size
);
}
static
HRESULT
WINAPI
dwritefontface_QueryInterface
(
IDWriteFontFace5
*
iface
,
REFIID
riid
,
void
**
obj
)
{
struct
dwrite_fontface
*
fontface
=
impl_from_IDWriteFontFace5
(
iface
);
...
...
@@ -1814,11 +1839,18 @@ static HRESULT WINAPI dwritefont3_CreateFontFace(IDWriteFont3 *iface, IDWriteFon
return
get_fontface_from_font
(
font
,
(
IDWriteFontFace5
**
)
fontface
);
}
static
BOOL
WINAPI
dwritefont3_Equals
(
IDWriteFont3
*
iface
,
IDWriteFont
*
font
)
static
BOOL
WINAPI
dwritefont3_Equals
(
IDWriteFont3
*
iface
,
IDWriteFont
*
other
)
{
struct
dwrite_font
*
This
=
impl_from_IDWriteFont3
(
iface
);
FIXME
(
"(%p)->(%p): stub
\n
"
,
This
,
font
);
return
FALSE
;
struct
dwrite_font
*
font
=
impl_from_IDWriteFont3
(
iface
),
*
other_font
;
TRACE
(
"%p, %p.
\n
"
,
iface
,
other
);
if
(
!
(
other_font
=
unsafe_impl_from_IDWriteFont
(
other
)))
return
FALSE
;
return
font
->
data
->
face_index
==
other_font
->
data
->
face_index
&&
font
->
data
->
simulations
==
other_font
->
data
->
simulations
&&
is_same_fontfile
(
font
->
data
->
file
,
other_font
->
data
->
file
);
}
static
HRESULT
WINAPI
dwritefont3_GetFontFaceReference
(
IDWriteFont3
*
iface
,
IDWriteFontFaceReference
**
reference
)
...
...
@@ -2687,29 +2719,6 @@ static HRESULT WINAPI dwritefontcollection_FindFamilyName(IDWriteFontCollection3
return
S_OK
;
}
static
BOOL
is_same_fontfile
(
IDWriteFontFile
*
left
,
IDWriteFontFile
*
right
)
{
UINT32
left_key_size
,
right_key_size
;
const
void
*
left_key
,
*
right_key
;
HRESULT
hr
;
if
(
left
==
right
)
return
TRUE
;
hr
=
IDWriteFontFile_GetReferenceKey
(
left
,
&
left_key
,
&
left_key_size
);
if
(
FAILED
(
hr
))
return
FALSE
;
hr
=
IDWriteFontFile_GetReferenceKey
(
right
,
&
right_key
,
&
right_key_size
);
if
(
FAILED
(
hr
))
return
FALSE
;
if
(
left_key_size
!=
right_key_size
)
return
FALSE
;
return
!
memcmp
(
left_key
,
right_key
,
left_key_size
);
}
static
HRESULT
WINAPI
dwritefontcollection_GetFontFromFontFace
(
IDWriteFontCollection3
*
iface
,
IDWriteFontFace
*
face
,
IDWriteFont
**
font
)
{
...
...
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