summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2008-06-16 16:37:23 -0400
committerKristian Høgsberg <krh@redhat.com>2008-06-16 16:43:50 -0400
commit48a6bfa3bbed72d052324daa44e50bfb41b68efb (patch)
tree11f431d39c5be507bd6fb84c390ca081707d2015 /src
parent0a7e2c92196e4091387560ae054b62a0d7c0e3e7 (diff)
downloadplymouth-48a6bfa3bbed72d052324daa44e50bfb41b68efb.tar.gz
plymouth-48a6bfa3bbed72d052324daa44e50bfb41b68efb.tar.xz
plymouth-48a6bfa3bbed72d052324daa44e50bfb41b68efb.zip
Factor out background drawing code in throbber helper.
Diffstat (limited to 'src')
-rw-r--r--src/libplybootsplash/ply-throbber.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/libplybootsplash/ply-throbber.c b/src/libplybootsplash/ply-throbber.c
index 2349864..0dd6dc5 100644
--- a/src/libplybootsplash/ply-throbber.c
+++ b/src/libplybootsplash/ply-throbber.c
@@ -122,6 +122,14 @@ ply_throbber_free (ply_throbber_t *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;