mirror of
https://gitlab.freedesktop.org/plymouth/plymouth.git
synced 2026-05-07 20:08:17 +02:00
Factor out background drawing code in throbber helper.
This commit is contained in:
parent
0a7e2c9219
commit
48a6bfa3bb
1 changed files with 11 additions and 5 deletions
|
|
@ -121,6 +121,14 @@ ply_throbber_free (ply_throbber_t *throbber)
|
|||
free (throbber);
|
||||
}
|
||||
|
||||
static void
|
||||
draw_background (ply_throbber_t *throbber)
|
||||
{
|
||||
ply_frame_buffer_fill_with_gradient (throbber->frame_buffer, &throbber->frame_area,
|
||||
PLYMOUTH_BACKGROUND_START_COLOR,
|
||||
PLYMOUTH_BACKGROUND_END_COLOR);
|
||||
}
|
||||
|
||||
static void
|
||||
animate_at_time (ply_throbber_t *throbber,
|
||||
double time)
|
||||
|
|
@ -141,9 +149,7 @@ animate_at_time (ply_throbber_t *throbber,
|
|||
|
||||
ply_frame_buffer_pause_updates (throbber->frame_buffer);
|
||||
if (throbber->frame_area.width > 0)
|
||||
ply_frame_buffer_fill_with_gradient (throbber->frame_buffer, &throbber->frame_area,
|
||||
PLYMOUTH_BACKGROUND_START_COLOR,
|
||||
PLYMOUTH_BACKGROUND_END_COLOR);
|
||||
draw_background (throbber);
|
||||
|
||||
frames = (ply_image_t * const *) ply_array_get_elements (throbber->frames);
|
||||
|
||||
|
|
@ -305,8 +311,8 @@ void
|
|||
ply_throbber_stop (ply_throbber_t *throbber)
|
||||
{
|
||||
if (throbber->frame_area.width > 0)
|
||||
ply_frame_buffer_fill_with_hex_color (throbber->frame_buffer, &throbber->frame_area,
|
||||
PLYMOUTH_BACKGROUND_COLOR);
|
||||
draw_background (throbber);
|
||||
|
||||
throbber->frame_buffer = NULL;
|
||||
throbber->window = NULL;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue