Remove _palette_entry_count as can be done with _palette_colors

This commit is contained in:
Ebrahim Byagowi 2018-10-21 10:17:34 +03:30 committed by Khaled Hosny
parent 6795dcfc08
commit 44f79b4bf8
3 changed files with 4 additions and 25 deletions

View File

@ -116,20 +116,6 @@ hb_ot_color_get_palette_name_id (hb_face_t *face, unsigned int palette)
return _get_cpal (face).get_palette_name_id (palette);
}
/**
* hb_ot_color_get_palette_entry_count:
* @face: a font face.
*
* Returns: Number of entries on each palette
*
* Since: REPLACEME
*/
unsigned int
hb_ot_color_get_palette_entry_count (hb_face_t *face)
{
return _get_cpal (face).get_palette_entries_count ();
}
/**
* hb_ot_color_get_palette_entry_name_id:
* @face: a font face.
@ -176,8 +162,8 @@ unsigned int
hb_ot_color_get_palette_colors (hb_face_t *face,
unsigned int palette, /* default=0 */
unsigned int start_offset,
unsigned int *count /* IN/OUT */,
hb_color_t *colors /* OUT */)
unsigned int *count /* IN/OUT. May be NULL. */,
hb_color_t *colors /* OUT. May be NULL. */)
{
const OT::CPAL& cpal = _get_cpal(face);
if (unlikely (palette >= cpal.get_palette_count ()))

View File

@ -50,9 +50,6 @@ hb_ot_color_get_palette_count (hb_face_t *face);
HB_EXTERN hb_name_id_t
hb_ot_color_get_palette_name_id (hb_face_t *face, unsigned int palette);
HB_EXTERN unsigned int
hb_ot_color_get_palette_entry_count (hb_face_t *face);
HB_EXTERN hb_name_id_t
hb_ot_color_get_palette_entry_name_id (hb_face_t *face, unsigned int palette_entry);

View File

@ -295,14 +295,10 @@ test_hb_ot_color_get_palette_colors_v1 (void)
static void
test_hb_ot_color_get_palette_entry (void)
test_hb_ot_color_get_palette_entry_name_id (void)
{
hb_face_t *empty = hb_face_get_empty ();
g_assert_cmpuint (hb_ot_color_get_palette_entry_count (empty), ==, 0);
g_assert_cmpuint (hb_ot_color_get_palette_entry_count (cpal_v0), ==, 2);
g_assert_cmpuint (hb_ot_color_get_palette_entry_count (cpal_v1), ==, 2);
g_assert_cmpuint (hb_ot_color_get_palette_entry_name_id (empty, 0), ==, HB_NAME_ID_INVALID);
g_assert_cmpuint (hb_ot_color_get_palette_entry_name_id (empty, 1), ==, HB_NAME_ID_INVALID);
g_assert_cmpuint (hb_ot_color_get_palette_entry_name_id (empty, 2), ==, HB_NAME_ID_INVALID);
@ -380,7 +376,7 @@ main (int argc, char **argv)
hb_test_add (test_hb_ot_color_get_palette_colors_empty);
hb_test_add (test_hb_ot_color_get_palette_colors_v0);
hb_test_add (test_hb_ot_color_get_palette_colors_v1);
hb_test_add (test_hb_ot_color_get_palette_entry);
hb_test_add (test_hb_ot_color_get_palette_entry_name_id);
hb_test_add (test_hb_ot_color_get_color_layers);
hb_test_add (test_hb_ot_color_has_data);
status = hb_test_run();