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
fd35a1af
Commit
fd35a1af
authored
Aug 06, 2015
by
Nikolay Sivov
Committed by
Alexandre Julliard
Aug 07, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dwrite: Implement GetPaletteEntries().
parent
4df29eb0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
8 deletions
+41
-8
dwrite_private.h
dlls/dwrite/dwrite_private.h
+1
-0
font.c
dlls/dwrite/font.c
+2
-2
opentype.c
dlls/dwrite/opentype.c
+38
-0
font.c
dlls/dwrite/tests/font.c
+0
-6
No files found.
dlls/dwrite/dwrite_private.h
View file @
fd35a1af
...
...
@@ -155,6 +155,7 @@ extern HRESULT opentype_get_typographic_features(IDWriteFontFace*,UINT32,UINT32,
extern
BOOL
opentype_get_vdmx_size
(
const
void
*
,
INT
,
UINT16
*
,
UINT16
*
)
DECLSPEC_HIDDEN
;
extern
UINT32
opentype_get_cpal_palettecount
(
const
void
*
)
DECLSPEC_HIDDEN
;
extern
UINT32
opentype_get_cpal_paletteentrycount
(
const
void
*
)
DECLSPEC_HIDDEN
;
extern
HRESULT
opentype_get_cpal_entries
(
const
void
*
,
UINT32
,
UINT32
,
UINT32
,
DWRITE_COLOR_F
*
)
DECLSPEC_HIDDEN
;
enum
gasp_flags
{
GASP_GRIDFIT
=
0x0001
,
...
...
dlls/dwrite/font.c
View file @
fd35a1af
...
...
@@ -972,8 +972,8 @@ static HRESULT WINAPI dwritefontface2_GetPaletteEntries(IDWriteFontFace2 *iface,
UINT32
first_entry_index
,
UINT32
entry_count
,
DWRITE_COLOR_F
*
entries
)
{
struct
dwrite_fontface
*
This
=
impl_from_IDWriteFontFace2
(
iface
);
FIXME
(
"(%p)->(%u %u %u %p): stub
\n
"
,
This
,
palette_index
,
first_entry_index
,
entry_count
,
entries
);
return
E_NOTIMPL
;
TRACE
(
"(%p)->(%u %u %u %p)
\n
"
,
This
,
palette_index
,
first_entry_index
,
entry_count
,
entries
);
return
opentype_get_cpal_entries
(
get_fontface_cpal
(
This
),
palette_index
,
first_entry_index
,
entry_count
,
entries
)
;
}
static
HRESULT
WINAPI
dwritefontface2_GetRecommendedRenderingMode
(
IDWriteFontFace2
*
iface
,
FLOAT
emSize
,
...
...
dlls/dwrite/opentype.c
View file @
fd35a1af
...
...
@@ -687,6 +687,14 @@ struct CPAL_SubHeader_1
ULONG
offsetPaletteEntryLabelArray
;
};
struct
CPAL_ColorRecord
{
BYTE
blue
;
BYTE
green
;
BYTE
red
;
BYTE
alpha
;
};
BOOL
is_face_type_supported
(
DWRITE_FONT_FACE_TYPE
type
)
{
return
(
type
==
DWRITE_FONT_FACE_TYPE_CFF
)
||
...
...
@@ -1434,3 +1442,33 @@ UINT32 opentype_get_cpal_paletteentrycount(const void *cpal)
const
struct
CPAL_Header_0
*
header
=
(
const
struct
CPAL_Header_0
*
)
cpal
;
return
header
?
GET_BE_WORD
(
header
->
numPaletteEntries
)
:
0
;
}
HRESULT
opentype_get_cpal_entries
(
const
void
*
cpal
,
UINT32
palette
,
UINT32
first_entry_index
,
UINT32
entry_count
,
DWRITE_COLOR_F
*
entries
)
{
const
struct
CPAL_Header_0
*
header
=
(
const
struct
CPAL_Header_0
*
)
cpal
;
const
struct
CPAL_ColorRecord
*
records
;
UINT32
palettecount
,
entrycount
,
i
;
if
(
!
header
)
return
DWRITE_E_NOCOLOR
;
palettecount
=
GET_BE_WORD
(
header
->
numPalette
);
if
(
palette
>=
palettecount
)
return
DWRITE_E_NOCOLOR
;
entrycount
=
GET_BE_WORD
(
header
->
numPaletteEntries
);
if
(
first_entry_index
+
entry_count
>
entrycount
)
return
E_INVALIDARG
;
records
=
(
const
struct
CPAL_ColorRecord
*
)((
BYTE
*
)
cpal
+
GET_BE_DWORD
(
header
->
offsetFirstColorRecord
));
first_entry_index
+=
GET_BE_WORD
(
header
->
colorRecordIndices
[
palette
]);
for
(
i
=
0
;
i
<
entry_count
;
i
++
)
{
entries
[
i
].
r
=
records
[
first_entry_index
+
i
].
red
/
255
.
0
f
;
entries
[
i
].
g
=
records
[
first_entry_index
+
i
].
green
/
255
.
0
f
;
entries
[
i
].
b
=
records
[
first_entry_index
+
i
].
blue
/
255
.
0
f
;
entries
[
i
].
a
=
records
[
first_entry_index
+
i
].
alpha
/
255
.
0
f
;
}
return
S_OK
;
}
dlls/dwrite/tests/font.c
View file @
fd35a1af
...
...
@@ -4792,7 +4792,6 @@ static void test_GetPaletteEntries(void)
}
hr
=
IDWriteFontFace2_GetPaletteEntries
(
fontface2
,
0
,
0
,
1
,
&
color
);
todo_wine
ok
(
hr
==
DWRITE_E_NOCOLOR
,
"got 0x%08x
\n
"
,
hr
);
IDWriteFontFace2_Release
(
fontface2
);
...
...
@@ -4827,7 +4826,6 @@ todo_wine
/* invalid palette index */
color
.
r
=
color
.
g
=
color
.
b
=
color
.
a
=
123
.
0
;
hr
=
IDWriteFontFace2_GetPaletteEntries
(
fontface2
,
palettecount
,
0
,
1
,
&
color
);
todo_wine
ok
(
hr
==
DWRITE_E_NOCOLOR
,
"got 0x%08x
\n
"
,
hr
);
ok
(
color
.
r
==
123
.
0
&&
color
.
g
==
123
.
0
&&
color
.
b
==
123
.
0
&&
color
.
a
==
123
.
0
,
"got wrong color %.2fx%.2fx%.2fx%.2f
\n
"
,
color
.
r
,
color
.
g
,
color
.
b
,
color
.
a
);
...
...
@@ -4835,23 +4833,19 @@ todo_wine
/* invalid entry index */
color
.
r
=
color
.
g
=
color
.
b
=
color
.
a
=
123
.
0
;
hr
=
IDWriteFontFace2_GetPaletteEntries
(
fontface2
,
0
,
entrycount
,
1
,
&
color
);
todo_wine
ok
(
hr
==
E_INVALIDARG
,
"got 0x%08x
\n
"
,
hr
);
ok
(
color
.
r
==
123
.
0
&&
color
.
g
==
123
.
0
&&
color
.
b
==
123
.
0
&&
color
.
a
==
123
.
0
,
"got wrong color %.2fx%.2fx%.2fx%.2f
\n
"
,
color
.
r
,
color
.
g
,
color
.
b
,
color
.
a
);
color
.
r
=
color
.
g
=
color
.
b
=
color
.
a
=
123
.
0
;
hr
=
IDWriteFontFace2_GetPaletteEntries
(
fontface2
,
0
,
entrycount
-
1
,
1
,
&
color
);
todo_wine
{
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
color
.
r
!=
123
.
0
&&
color
.
g
!=
123
.
0
&&
color
.
b
!=
123
.
0
&&
color
.
a
!=
123
.
0
,
"got wrong color %.2fx%.2fx%.2fx%.2f
\n
"
,
color
.
r
,
color
.
g
,
color
.
b
,
color
.
a
);
}
/* zero return length */
color
.
r
=
color
.
g
=
color
.
b
=
color
.
a
=
123
.
0
;
hr
=
IDWriteFontFace2_GetPaletteEntries
(
fontface2
,
0
,
0
,
0
,
&
color
);
todo_wine
ok
(
hr
==
S_OK
,
"got 0x%08x
\n
"
,
hr
);
ok
(
color
.
r
==
123
.
0
&&
color
.
g
==
123
.
0
&&
color
.
b
==
123
.
0
&&
color
.
a
==
123
.
0
,
"got wrong color %.2fx%.2fx%.2fx%.2f
\n
"
,
color
.
r
,
color
.
g
,
color
.
b
,
color
.
a
);
...
...
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