Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
22db5690cc | ||
|
|
5bd8696253 | ||
|
|
142499b2a4 | ||
|
|
46d4f5166a | ||
|
|
0ebf6cb830 | ||
|
|
e8ef918866 |
@@ -49,6 +49,7 @@ int bootflow_menu_new(struct expo **expp)
|
||||
ret = expo_new("bootflows", priv, &exp);
|
||||
if (ret)
|
||||
return log_msg_ret("exp", ret);
|
||||
expo_req_size(exp, 1366, 768);
|
||||
|
||||
ret = scene_new(exp, "main", MAIN, &scn);
|
||||
if (ret < 0)
|
||||
@@ -309,6 +310,8 @@ int bootflow_menu_poll(struct expo *exp, int *seqp)
|
||||
ret = scene_menu_select_item(scn, OBJ_MENU, act.select.id);
|
||||
if (ret)
|
||||
return log_msg_ret("bmp", ret);
|
||||
if (act.select.changed)
|
||||
return -EREMCHG;
|
||||
return -ERESTART;
|
||||
}
|
||||
case EXPOACT_QUIT:
|
||||
|
||||
@@ -376,3 +376,9 @@ int expo_poll(struct expo *exp, struct expo_action *act)
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void expo_req_size(struct expo *exp, int width, int height)
|
||||
{
|
||||
exp->req_width = width;
|
||||
exp->req_height = height;
|
||||
}
|
||||
|
||||
13
boot/scene.c
13
boot/scene.c
@@ -1173,6 +1173,19 @@ void scene_highlight_first(struct scene *scn)
|
||||
}
|
||||
}
|
||||
|
||||
int scene_img_set_data(struct scene *scn, uint id, const void *data, int size)
|
||||
{
|
||||
struct scene_obj_img *img;
|
||||
|
||||
img = scene_obj_find(scn, id, SCENEOBJT_IMAGE);
|
||||
if (!img)
|
||||
return log_msg_ret("sid", -ENOENT);
|
||||
img->data = data;
|
||||
/* TODO: Consider using an abuf for the image */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int scene_obj_open(struct scene *scn, struct scene_obj *obj)
|
||||
{
|
||||
int ret;
|
||||
|
||||
@@ -302,7 +302,7 @@ int scene_menu_arrange(struct scene *scn, struct expo_arrange_info *arr,
|
||||
return log_msg_ret("nam", ret);
|
||||
scene_obj_set_hide(scn, item->label_id,
|
||||
stack && !open && !selected);
|
||||
x += 200;
|
||||
x += dims[SCENEBB_label].x + 50 + 18;
|
||||
|
||||
/* space for the pointer */
|
||||
if (pointer_dims.x) {
|
||||
@@ -410,6 +410,7 @@ int scene_menu_send_key(struct scene *scn, struct scene_obj_menu *menu, int key,
|
||||
{
|
||||
const bool open = menu->obj.flags & SCENEOF_OPEN;
|
||||
struct scene_menitem *item, *cur, *key_item;
|
||||
bool changed = false;
|
||||
|
||||
cur = NULL;
|
||||
key_item = NULL;
|
||||
@@ -433,19 +434,28 @@ int scene_menu_send_key(struct scene *scn, struct scene_obj_menu *menu, int key,
|
||||
struct scene_menitem, sibling)) {
|
||||
item = list_entry(item->sibling.prev,
|
||||
struct scene_menitem, sibling);
|
||||
event->type = EXPOACT_POINT_ITEM;
|
||||
event->select.id = item->id;
|
||||
log_debug("up to item %d\n", event->select.id);
|
||||
changed = true;
|
||||
}
|
||||
/*
|
||||
* issue an event even if the pointer did not move, so the
|
||||
* caller knows that an attempt was made, e.g. to cancel an
|
||||
* autoboot timeout
|
||||
*/
|
||||
event->type = EXPOACT_POINT_ITEM;
|
||||
event->select.id = item->id;
|
||||
event->select.changed = changed;
|
||||
log_debug("up to item %d\n", event->select.id);
|
||||
break;
|
||||
case BKEY_DOWN:
|
||||
if (!list_is_last(&item->sibling, &menu->item_head)) {
|
||||
item = list_entry(item->sibling.next,
|
||||
struct scene_menitem, sibling);
|
||||
event->type = EXPOACT_POINT_ITEM;
|
||||
event->select.id = item->id;
|
||||
log_debug("down to item %d\n", event->select.id);
|
||||
changed = true;
|
||||
}
|
||||
event->type = EXPOACT_POINT_ITEM;
|
||||
event->select.id = item->id;
|
||||
event->select.changed = changed;
|
||||
log_debug("down to item %d\n", event->select.id);
|
||||
break;
|
||||
case BKEY_SELECT:
|
||||
event->type = EXPOACT_SELECT;
|
||||
|
||||
@@ -126,7 +126,7 @@ __maybe_unused static int bootflow_handle_menu(struct bootstd_priv *std,
|
||||
return log_msg_ret("bhr", ret);
|
||||
}
|
||||
ret = bootflow_menu_poll(exp, &seq);
|
||||
} while (ret == -EAGAIN || ret == -ERESTART);
|
||||
} while (ret == -EAGAIN || ret == -ERESTART || ret == -EREMCHG);
|
||||
|
||||
if (ret == -EPIPE) {
|
||||
printf("Nothing chosen\n");
|
||||
|
||||
@@ -287,19 +287,21 @@ static int console_truetype_putc_xy(struct udevice *dev, uint x, uint y,
|
||||
u8 *bits, *data;
|
||||
int advance;
|
||||
void *start, *end, *line;
|
||||
int row;
|
||||
int row, kern;
|
||||
|
||||
/* First get some basic metrics about this character */
|
||||
stbtt_GetCodepointHMetrics(font, cp, &advance, &lsb);
|
||||
|
||||
/*
|
||||
* First out our current X position in fractional pixels. If we wrote
|
||||
* a character previously, using kerning to fine-tune the position of
|
||||
* a character previously, use kerning to fine-tune the position of
|
||||
* this character */
|
||||
xpos = frac(VID_TO_PIXEL((double)x));
|
||||
kern = 0;
|
||||
if (vc_priv->last_ch) {
|
||||
xpos += met->scale * stbtt_GetCodepointKernAdvance(font,
|
||||
vc_priv->last_ch, cp);
|
||||
kern = stbtt_GetCodepointKernAdvance(font, vc_priv->last_ch,
|
||||
cp);
|
||||
xpos += met->scale * kern;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -310,7 +312,7 @@ static int console_truetype_putc_xy(struct udevice *dev, uint x, uint y,
|
||||
*/
|
||||
x_shift = xpos - (double)tt_floor(xpos);
|
||||
xpos += advance * met->scale;
|
||||
width_frac = (int)VID_TO_POS(advance * met->scale);
|
||||
width_frac = (int)VID_TO_POS((kern + advance) * met->scale);
|
||||
if (x + width_frac >= vc_priv->xsize_frac)
|
||||
return -EAGAIN;
|
||||
|
||||
|
||||
@@ -242,10 +242,10 @@ static void video_splash_align_axis(int *axis, unsigned long panel_size,
|
||||
*axis = max(0, (int)axis_alignment);
|
||||
}
|
||||
|
||||
void video_bmp_get_info(void *bmp_image, ulong *widthp, ulong *heightp,
|
||||
void video_bmp_get_info(const void *bmp_image, ulong *widthp, ulong *heightp,
|
||||
uint *bpixp)
|
||||
{
|
||||
struct bmp_image *bmp = bmp_image;
|
||||
const struct bmp_image *bmp = bmp_image;
|
||||
|
||||
*widthp = get_unaligned_le32(&bmp->header.width);
|
||||
*heightp = get_unaligned_le32(&bmp->header.height);
|
||||
|
||||
@@ -688,7 +688,9 @@ int bootflow_menu_start(struct bootstd_priv *std, bool text_mode,
|
||||
* @exp: Expo to poll
|
||||
* @seqp: Returns the bootflow chosen or currently pointed to (numbered from 0)
|
||||
* Return: 0 if a bootflow was chosen, -EAGAIN if nothing is chosen yet, -EPIPE
|
||||
* if the user quit, -ERESTART if the expo needs refreshing
|
||||
* if the user quit, -EREMCHG if the expo needs refreshing, -ERESTART if
|
||||
* the user tried to move to a new selection but was unable (e.g. already
|
||||
* at the top and tried to move up)
|
||||
*/
|
||||
int bootflow_menu_poll(struct expo *exp, int *seqp);
|
||||
|
||||
|
||||
@@ -65,12 +65,15 @@ enum expoact_type {
|
||||
* @type: Action type (EXPOACT_NONE if there is no action)
|
||||
* @select: Used for EXPOACT_POINT_ITEM and EXPOACT_SELECT
|
||||
* @select.id: ID number of the object affected.
|
||||
* @select.changed: true if the selection has changed since last time (only
|
||||
* valid for EXPOACT_POINT_ITEM)
|
||||
*/
|
||||
struct expo_action {
|
||||
enum expoact_type type;
|
||||
union {
|
||||
struct {
|
||||
int id;
|
||||
bool changed;
|
||||
} select;
|
||||
};
|
||||
};
|
||||
@@ -109,6 +112,8 @@ struct expo_theme {
|
||||
* @scene_id: Current scene ID (0 if none)
|
||||
* @next_id: Next ID number to use, for automatic allocation
|
||||
* @action: Action selected by user. At present only one is supported, with the
|
||||
* @req_width: Requested width of the display
|
||||
* @req_height: Requested height of the display
|
||||
* type set to EXPOACT_NONE if there is no action
|
||||
* @text_mode: true to use text mode for the menu (no vidconsole)
|
||||
* @popup: true to use popup menus, instead of showing all items
|
||||
@@ -128,6 +133,8 @@ struct expo {
|
||||
uint scene_id;
|
||||
uint next_id;
|
||||
struct expo_action action;
|
||||
int req_width;
|
||||
int req_height;
|
||||
bool text_mode;
|
||||
bool popup;
|
||||
bool show_highlight;
|
||||
@@ -361,7 +368,7 @@ static inline bool scene_obj_can_highlight(const struct scene_obj *obj)
|
||||
*/
|
||||
struct scene_obj_img {
|
||||
struct scene_obj obj;
|
||||
char *data;
|
||||
const char *data;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -701,6 +708,17 @@ void scene_highlight_first(struct scene *scn);
|
||||
*/
|
||||
void scene_set_highlight_id(struct scene *scn, uint id);
|
||||
|
||||
/**
|
||||
* scene_img_set_data() - Set the image data for an image object
|
||||
*
|
||||
* @scn: Scene to update
|
||||
* @id: ID of existing image obejct
|
||||
* @data: Image data to use
|
||||
* @size: Size of image data
|
||||
* Returns: 0 if OK, -ENOENT if @id is invalid
|
||||
*/
|
||||
int scene_img_set_data(struct scene *scn, uint id, const void *data, int size);
|
||||
|
||||
/**
|
||||
* scene_set_open() - Set whether an item is open or not
|
||||
*
|
||||
@@ -1081,4 +1099,17 @@ int cb_expo_build(struct expo **expp);
|
||||
*/
|
||||
int expo_poll(struct expo *exp, struct expo_action *act);
|
||||
|
||||
/**
|
||||
* expo_req_size() - Request a size for the expo display
|
||||
*
|
||||
* Set the width and height of the display, so far as requested positions and
|
||||
* size are concerned. The actual display may be larger or smaller, in which
|
||||
* case expo scales the objects to fit
|
||||
*
|
||||
* @exp: Expo to update
|
||||
* @width: Requested display width
|
||||
* @height: Requested display height
|
||||
*/
|
||||
void expo_req_size(struct expo *exp, int width, int height);
|
||||
|
||||
#endif /*__EXPO_H */
|
||||
|
||||
@@ -310,7 +310,7 @@ void video_sync_all(void);
|
||||
* @heightp: Returns height in pixels
|
||||
* @bpixp: Returns log2 of bits per pixel
|
||||
*/
|
||||
void video_bmp_get_info(void *bmp_image, ulong *widthp, ulong *heightp,
|
||||
void video_bmp_get_info(const void *bmp_image, ulong *widthp, ulong *heightp,
|
||||
uint *bpixp);
|
||||
|
||||
/**
|
||||
|
||||
@@ -271,7 +271,7 @@ static int cedit_render(struct unit_test_state *uts)
|
||||
ut_asserteq(ID_AC_OFF, menu->cur_item_id);
|
||||
|
||||
ut_assertok(expo_render(exp));
|
||||
ut_asserteq(4888, video_compress_fb(uts, dev, false));
|
||||
ut_asserteq(4926, video_compress_fb(uts, dev, false));
|
||||
ut_assertok(video_check_copy_fb(uts, dev));
|
||||
|
||||
/* move to the second menu */
|
||||
@@ -279,54 +279,54 @@ static int cedit_render(struct unit_test_state *uts)
|
||||
act.select.id = ID_POWER_LOSS;
|
||||
ut_assertok(cedit_do_action(exp, scn, vid_priv, &act));
|
||||
ut_assertok(expo_render(exp));
|
||||
ut_asserteq(4967, video_compress_fb(uts, dev, false));
|
||||
ut_asserteq(5000, video_compress_fb(uts, dev, false));
|
||||
|
||||
/* open the menu */
|
||||
act.type = EXPOACT_OPEN;
|
||||
act.select.id = ID_POWER_LOSS;
|
||||
ut_assertok(cedit_do_action(exp, scn, vid_priv, &act));
|
||||
ut_assertok(expo_render(exp));
|
||||
ut_asserteq(5397, video_compress_fb(uts, dev, false));
|
||||
ut_asserteq(5390, video_compress_fb(uts, dev, false));
|
||||
|
||||
/* close the menu */
|
||||
act.type = EXPOACT_CLOSE;
|
||||
act.select.id = ID_POWER_LOSS;
|
||||
ut_assertok(cedit_do_action(exp, scn, vid_priv, &act));
|
||||
ut_assertok(expo_render(exp));
|
||||
ut_asserteq(4967, video_compress_fb(uts, dev, false));
|
||||
ut_asserteq(5000, video_compress_fb(uts, dev, false));
|
||||
|
||||
/* open the menu again to check it looks the same */
|
||||
act.type = EXPOACT_OPEN;
|
||||
act.select.id = ID_POWER_LOSS;
|
||||
ut_assertok(cedit_do_action(exp, scn, vid_priv, &act));
|
||||
ut_assertok(expo_render(exp));
|
||||
ut_asserteq(5397, video_compress_fb(uts, dev, false));
|
||||
ut_asserteq(5390, video_compress_fb(uts, dev, false));
|
||||
|
||||
/* close the menu */
|
||||
act.type = EXPOACT_CLOSE;
|
||||
act.select.id = ID_POWER_LOSS;
|
||||
ut_assertok(cedit_do_action(exp, scn, vid_priv, &act));
|
||||
ut_assertok(expo_render(exp));
|
||||
ut_asserteq(4967, video_compress_fb(uts, dev, false));
|
||||
ut_asserteq(5000, video_compress_fb(uts, dev, false));
|
||||
|
||||
act.type = EXPOACT_OPEN;
|
||||
act.select.id = ID_POWER_LOSS;
|
||||
ut_assertok(cedit_do_action(exp, scn, vid_priv, &act));
|
||||
ut_assertok(expo_render(exp));
|
||||
ut_asserteq(5397, video_compress_fb(uts, dev, false));
|
||||
ut_asserteq(5390, video_compress_fb(uts, dev, false));
|
||||
|
||||
act.type = EXPOACT_POINT_ITEM;
|
||||
act.select.id = ID_AC_ON;
|
||||
ut_assertok(cedit_do_action(exp, scn, vid_priv, &act));
|
||||
ut_assertok(expo_render(exp));
|
||||
ut_asserteq(5341, video_compress_fb(uts, dev, false));
|
||||
ut_asserteq(5363, video_compress_fb(uts, dev, false));
|
||||
|
||||
/* select it */
|
||||
act.type = EXPOACT_SELECT;
|
||||
act.select.id = ID_AC_ON;
|
||||
ut_assertok(cedit_do_action(exp, scn, vid_priv, &act));
|
||||
ut_assertok(expo_render(exp));
|
||||
ut_asserteq(4939, video_compress_fb(uts, dev, false));
|
||||
ut_asserteq(4964, video_compress_fb(uts, dev, false));
|
||||
|
||||
ut_asserteq(ID_AC_ON, menu->cur_item_id);
|
||||
|
||||
@@ -335,14 +335,14 @@ static int cedit_render(struct unit_test_state *uts)
|
||||
act.select.id = ID_MACHINE_NAME;
|
||||
ut_assertok(cedit_do_action(exp, scn, vid_priv, &act));
|
||||
ut_assertok(expo_render(exp));
|
||||
ut_asserteq(4850, video_compress_fb(uts, dev, false));
|
||||
ut_asserteq(4868, video_compress_fb(uts, dev, false));
|
||||
|
||||
/* open it */
|
||||
act.type = EXPOACT_OPEN;
|
||||
act.select.id = ID_MACHINE_NAME;
|
||||
ut_assertok(cedit_do_action(exp, scn, vid_priv, &act));
|
||||
ut_assertok(expo_render(exp));
|
||||
ut_asserteq(4883, video_compress_fb(uts, dev, false));
|
||||
ut_asserteq(4871, video_compress_fb(uts, dev, false));
|
||||
|
||||
/*
|
||||
* Send some keypresses. Note that the console must be enabled so that
|
||||
@@ -358,7 +358,7 @@ static int cedit_render(struct unit_test_state *uts)
|
||||
ut_silence_console(uts);
|
||||
ut_assertok(cedit_arange(exp, vid_priv, scn->id));
|
||||
ut_assertok(expo_render(exp));
|
||||
ut_asserteq(5033, video_compress_fb(uts, dev, false));
|
||||
ut_asserteq(5076, video_compress_fb(uts, dev, false));
|
||||
|
||||
expo_destroy(exp);
|
||||
cur_exp = NULL;
|
||||
@@ -401,7 +401,7 @@ static int cedit_render_lineedit(struct unit_test_state *uts)
|
||||
ut_asserteq(20, tline->pos);
|
||||
|
||||
ut_assertok(expo_render(exp));
|
||||
ut_asserteq(5315, video_compress_fb(uts, dev, false));
|
||||
ut_asserteq(5344, video_compress_fb(uts, dev, false));
|
||||
ut_assertok(video_check_copy_fb(uts, dev));
|
||||
|
||||
/* move to the line-edit field */
|
||||
@@ -409,14 +409,14 @@ static int cedit_render_lineedit(struct unit_test_state *uts)
|
||||
act.select.id = ID_MACHINE_NAME;
|
||||
ut_assertok(cedit_do_action(exp, scn, vid_priv, &act));
|
||||
ut_assertok(expo_render(exp));
|
||||
ut_asserteq(5372, video_compress_fb(uts, dev, false));
|
||||
ut_asserteq(5408, video_compress_fb(uts, dev, false));
|
||||
|
||||
/* open it */
|
||||
act.type = EXPOACT_OPEN;
|
||||
act.select.id = ID_MACHINE_NAME;
|
||||
ut_assertok(cedit_do_action(exp, scn, vid_priv, &act));
|
||||
ut_assertok(expo_render(exp));
|
||||
ut_asserteq(5259, video_compress_fb(uts, dev, false));
|
||||
ut_asserteq(5291, video_compress_fb(uts, dev, false));
|
||||
|
||||
/* delete some characters */
|
||||
ut_unsilence_console(uts);
|
||||
@@ -427,7 +427,7 @@ static int cedit_render_lineedit(struct unit_test_state *uts)
|
||||
|
||||
ut_assertok(cedit_arange(exp, vid_priv, scn->id));
|
||||
ut_assertok(expo_render(exp));
|
||||
ut_asserteq(5126, video_compress_fb(uts, dev, false));
|
||||
ut_asserteq(5209, video_compress_fb(uts, dev, false));
|
||||
|
||||
expo_destroy(exp);
|
||||
cur_exp = NULL;
|
||||
|
||||
@@ -262,6 +262,7 @@ static int expo_object_attr(struct unit_test_state *uts)
|
||||
struct expo *exp;
|
||||
ulong start_mem;
|
||||
char name[100];
|
||||
char image[10];
|
||||
ofnode node;
|
||||
char *data;
|
||||
int id;
|
||||
@@ -305,6 +306,11 @@ static int expo_object_attr(struct unit_test_state *uts)
|
||||
ut_assertok(expo_setup_theme(exp, node));
|
||||
ut_asserteq(30, txt->gen.font_size);
|
||||
|
||||
/* try setting up a fake image */
|
||||
strcpy(image, "wibble");
|
||||
ut_assertok(scene_img_set_data(scn, OBJ_LOGO, image, sizeof(image)));
|
||||
ut_asserteq_str("wibble", img->data);
|
||||
|
||||
expo_destroy(exp);
|
||||
|
||||
ut_assertok(ut_check_delta(start_mem));
|
||||
@@ -421,13 +427,13 @@ static int expo_object_menu(struct unit_test_state *uts)
|
||||
ut_asserteq(menu->obj.bbox.x0, name1->obj.bbox.x0);
|
||||
ut_asserteq(menu->obj.bbox.y0 + 32, name1->obj.bbox.y0);
|
||||
|
||||
ut_asserteq(menu->obj.bbox.x0 + 200, ptr->obj.bbox.x0);
|
||||
ut_asserteq(menu->obj.bbox.x0 + 100, ptr->obj.bbox.x0);
|
||||
ut_asserteq(menu->obj.bbox.y0 + 32, ptr->obj.bbox.y0);
|
||||
|
||||
ut_asserteq(menu->obj.bbox.x0 + 229, key1->obj.bbox.x0);
|
||||
ut_asserteq(menu->obj.bbox.x0 + 129, key1->obj.bbox.x0);
|
||||
ut_asserteq(menu->obj.bbox.y0 + 32, key1->obj.bbox.y0);
|
||||
|
||||
ut_asserteq(menu->obj.bbox.x0 + 279, desc1->obj.bbox.x0);
|
||||
ut_asserteq(menu->obj.bbox.x0 + 179, desc1->obj.bbox.x0);
|
||||
ut_asserteq(menu->obj.bbox.y0 + 32, desc1->obj.bbox.y0);
|
||||
|
||||
ut_asserteq(-4, prev1->obj.bbox.x0);
|
||||
@@ -624,31 +630,31 @@ static int expo_render_image(struct unit_test_state *uts)
|
||||
/* same for the key */
|
||||
obj = scene_obj_find(scn, ITEM1_KEY, SCENEOBJT_NONE);
|
||||
ut_assertnonnull(obj);
|
||||
ut_asserteq(280, obj->bbox.x0);
|
||||
ut_asserteq(177, obj->bbox.x0);
|
||||
ut_asserteq(436, obj->bbox.y0);
|
||||
ut_asserteq(280 + 9, obj->bbox.x1);
|
||||
ut_asserteq(177 + 9, obj->bbox.x1);
|
||||
ut_asserteq(436 + 18, obj->bbox.y1);
|
||||
|
||||
obj = scene_obj_find(scn, ITEM2_KEY, SCENEOBJT_NONE);
|
||||
ut_assertnonnull(obj);
|
||||
ut_asserteq(280, obj->bbox.x0);
|
||||
ut_asserteq(177, obj->bbox.x0);
|
||||
ut_asserteq(454, obj->bbox.y0);
|
||||
ut_asserteq(280 + 9, obj->bbox.x1);
|
||||
ut_asserteq(177 + 9, obj->bbox.x1);
|
||||
ut_asserteq(454 + 18, obj->bbox.y1);
|
||||
|
||||
/* and the description */
|
||||
obj = scene_obj_find(scn, ITEM1_DESC, SCENEOBJT_NONE);
|
||||
ut_assertnonnull(obj);
|
||||
ut_asserteq(330, obj->bbox.x0);
|
||||
ut_asserteq(227, obj->bbox.x0);
|
||||
ut_asserteq(436, obj->bbox.y0);
|
||||
ut_asserteq(330 + 89, obj->bbox.x1);
|
||||
ut_asserteq(227 + 89, obj->bbox.x1);
|
||||
ut_asserteq(436 + 18, obj->bbox.y1);
|
||||
|
||||
obj = scene_obj_find(scn, ITEM2_DESC, SCENEOBJT_NONE);
|
||||
ut_assertnonnull(obj);
|
||||
ut_asserteq(330, obj->bbox.x0);
|
||||
ut_asserteq(227, obj->bbox.x0);
|
||||
ut_asserteq(454, obj->bbox.y0);
|
||||
ut_asserteq(330 + 89, obj->bbox.x1);
|
||||
ut_asserteq(227 + 89, obj->bbox.x1);
|
||||
ut_asserteq(454 + 18, obj->bbox.y1);
|
||||
|
||||
/* check dimensions of menu */
|
||||
@@ -678,17 +684,17 @@ static int expo_render_image(struct unit_test_state *uts)
|
||||
/* render it */
|
||||
expo_set_scene_id(exp, SCENE1);
|
||||
ut_assertok(expo_render(exp));
|
||||
ut_asserteq(18786, video_compress_fb(uts, dev, false));
|
||||
ut_asserteq(18782, video_compress_fb(uts, dev, false));
|
||||
|
||||
ut_asserteq(0, scn->highlight_id);
|
||||
ut_assertok(scene_arrange(scn));
|
||||
ut_asserteq(0, scn->highlight_id);
|
||||
ut_assertok(expo_render(exp));
|
||||
ut_asserteq(20433, video_compress_fb(uts, dev, false));
|
||||
ut_asserteq(20366, video_compress_fb(uts, dev, false));
|
||||
|
||||
ut_assertok(scene_arrange(scn));
|
||||
ut_assertok(expo_render(exp));
|
||||
ut_asserteq(20433, video_compress_fb(uts, dev, false));
|
||||
ut_asserteq(20366, video_compress_fb(uts, dev, false));
|
||||
|
||||
scene_set_highlight_id(scn, OBJ_MENU);
|
||||
ut_asserteq(OBJ_MENU, scn->highlight_id);
|
||||
@@ -700,7 +706,7 @@ static int expo_render_image(struct unit_test_state *uts)
|
||||
ut_assert(!(obj->flags & SCENEOF_HIDE));
|
||||
|
||||
ut_assertok(expo_render(exp));
|
||||
ut_asserteq(20433, video_compress_fb(uts, dev, false));
|
||||
ut_asserteq(20366, video_compress_fb(uts, dev, false));
|
||||
|
||||
/* move down */
|
||||
ut_assertok(expo_send_key(exp, BKEY_DOWN));
|
||||
@@ -713,7 +719,7 @@ static int expo_render_image(struct unit_test_state *uts)
|
||||
ut_asserteq(ITEM2, scene_menu_get_cur_item(scn, OBJ_MENU));
|
||||
ut_assertok(scene_arrange(scn));
|
||||
ut_assertok(expo_render(exp));
|
||||
ut_asserteq(19673, video_compress_fb(uts, dev, false));
|
||||
ut_asserteq(19636, video_compress_fb(uts, dev, false));
|
||||
ut_assertok(video_check_copy_fb(uts, dev));
|
||||
|
||||
/* hide the text editor since the following tets don't need it */
|
||||
@@ -722,18 +728,18 @@ static int expo_render_image(struct unit_test_state *uts)
|
||||
/* do some alignment checks */
|
||||
ut_assertok(scene_obj_set_halign(scn, OBJ_TEXT3, SCENEOA_CENTRE));
|
||||
ut_assertok(expo_render(exp));
|
||||
ut_asserteq(16368, video_compress_fb(uts, dev, false));
|
||||
ut_asserteq(16308, video_compress_fb(uts, dev, false));
|
||||
ut_assertok(scene_obj_set_halign(scn, OBJ_TEXT3, SCENEOA_RIGHT));
|
||||
ut_assertok(expo_render(exp));
|
||||
ut_asserteq(16321, video_compress_fb(uts, dev, false));
|
||||
ut_asserteq(16242, video_compress_fb(uts, dev, false));
|
||||
|
||||
ut_assertok(scene_obj_set_halign(scn, OBJ_TEXT3, SCENEOA_LEFT));
|
||||
ut_assertok(scene_obj_set_valign(scn, OBJ_TEXT3, SCENEOA_CENTRE));
|
||||
ut_assertok(expo_render(exp));
|
||||
ut_asserteq(18763, video_compress_fb(uts, dev, false));
|
||||
ut_asserteq(18742, video_compress_fb(uts, dev, false));
|
||||
ut_assertok(scene_obj_set_valign(scn, OBJ_TEXT3, SCENEOA_BOTTOM));
|
||||
ut_assertok(expo_render(exp));
|
||||
ut_asserteq(18714, video_compress_fb(uts, dev, false));
|
||||
ut_asserteq(18663, video_compress_fb(uts, dev, false));
|
||||
|
||||
/* make sure only the preview for the second item is shown */
|
||||
obj = scene_obj_find(scn, ITEM1_PREVIEW, SCENEOBJT_NONE);
|
||||
@@ -759,7 +765,7 @@ static int expo_render_image(struct unit_test_state *uts)
|
||||
exp->show_highlight = true;
|
||||
ut_assertok(scene_arrange(scn));
|
||||
ut_assertok(expo_render(exp));
|
||||
ut_asserteq(18844, video_compress_fb(uts, dev, false));
|
||||
ut_asserteq(18842, video_compress_fb(uts, dev, false));
|
||||
|
||||
/* now try in text mode */
|
||||
expo_set_text_mode(exp, true);
|
||||
|
||||
@@ -582,7 +582,7 @@ static int dm_test_video_truetype(struct unit_test_state *uts)
|
||||
ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));
|
||||
vidconsole_put_string(con, test_string);
|
||||
vidconsole_put_stringn(con, test_string, 30);
|
||||
ut_asserteq(13184, video_compress_fb(uts, dev, false));
|
||||
ut_asserteq(13055, video_compress_fb(uts, dev, false));
|
||||
ut_assertok(video_check_copy_fb(uts, dev));
|
||||
|
||||
return 0;
|
||||
@@ -604,7 +604,7 @@ static int dm_test_video_truetype_scroll(struct unit_test_state *uts)
|
||||
ut_assertok(video_get_nologo(uts, &dev));
|
||||
ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));
|
||||
vidconsole_put_string(con, test_string);
|
||||
ut_asserteq(34287, video_compress_fb(uts, dev, false));
|
||||
ut_asserteq(34248, video_compress_fb(uts, dev, false));
|
||||
ut_assertok(video_check_copy_fb(uts, dev));
|
||||
|
||||
return 0;
|
||||
@@ -626,7 +626,7 @@ static int dm_test_video_truetype_bs(struct unit_test_state *uts)
|
||||
ut_assertok(video_get_nologo(uts, &dev));
|
||||
ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con));
|
||||
vidconsole_put_string(con, test_string);
|
||||
ut_asserteq(29471, video_compress_fb(uts, dev, false));
|
||||
ut_asserteq(29223, video_compress_fb(uts, dev, false));
|
||||
ut_assertok(video_check_copy_fb(uts, dev));
|
||||
|
||||
return 0;
|
||||
@@ -665,7 +665,7 @@ static int dm_test_video_copy(struct unit_test_state *uts)
|
||||
vidconsole_put_string(con, test_string);
|
||||
vidconsole_put_string(con, test_string);
|
||||
|
||||
ut_asserteq(6678, video_compress_fb(uts, dev, false));
|
||||
ut_asserteq(6884, video_compress_fb(uts, dev, false));
|
||||
ut_assertok(video_check_copy_fb(uts, dev));
|
||||
|
||||
/*
|
||||
@@ -690,8 +690,8 @@ static int dm_test_video_copy(struct unit_test_state *uts)
|
||||
vidconsole_put_string(con, test_string);
|
||||
vidconsole_put_string(con, test_string);
|
||||
video_sync(dev, true);
|
||||
ut_asserteq(7589, video_compress_fb(uts, dev, false));
|
||||
ut_asserteq(7704, video_compress_fb(uts, dev, true));
|
||||
ut_asserteq(7621, video_compress_fb(uts, dev, false));
|
||||
ut_asserteq(7741, video_compress_fb(uts, dev, true));
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -746,7 +746,7 @@ static int dm_test_video_damage(struct unit_test_state *uts)
|
||||
ut_asserteq(0, priv->damage.xend);
|
||||
ut_asserteq(0, priv->damage.yend);
|
||||
|
||||
ut_asserteq(7339, video_compress_fb(uts, dev, false));
|
||||
ut_asserteq(7335, video_compress_fb(uts, dev, false));
|
||||
ut_assertok(video_check_copy_fb(uts, dev));
|
||||
|
||||
return 0;
|
||||
@@ -896,7 +896,7 @@ static int dm_test_video_silence(struct unit_test_state *uts)
|
||||
printf("final message: console\n");
|
||||
vidconsole_put_string(con, "final message: video\n");
|
||||
|
||||
ut_asserteq(3892, video_compress_fb(uts, dev, false));
|
||||
ut_asserteq(3944, video_compress_fb(uts, dev, false));
|
||||
ut_assertok(video_check_copy_fb(uts, dev));
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user