diff options
author | 2016-01-25 16:06:46 -0500 | |
---|---|---|
committer | 2016-01-25 16:06:46 -0500 | |
commit | f1e1ba0a5689966984f71a00572b89ea2d26f06b (patch) | |
tree | 7d7319859fdfa90ac7e6803b634f38a5418bb180 /swaylock | |
parent | Merge pull request #475 from christophgysin/swaylock_color (diff) | |
parent | extract cairo_set_source_u32() (diff) | |
download | sway-f1e1ba0a5689966984f71a00572b89ea2d26f06b.tar.gz sway-f1e1ba0a5689966984f71a00572b89ea2d26f06b.tar.zst sway-f1e1ba0a5689966984f71a00572b89ea2d26f06b.zip |
Merge pull request #476 from christophgysin/cairo_set_source_u32
extract cairo_set_source_u32()
Diffstat (limited to 'swaylock')
-rw-r--r-- | swaylock/main.c | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/swaylock/main.c b/swaylock/main.c index 98e26839..f0fe1d00 100644 --- a/swaylock/main.c +++ b/swaylock/main.c | |||
@@ -115,14 +115,6 @@ void notify_key(enum wl_keyboard_key_state state, xkb_keysym_t sym, uint32_t cod | |||
115 | } | 115 | } |
116 | } | 116 | } |
117 | 117 | ||
118 | static void cairo_set_source_u32(cairo_t *cairo, uint32_t color) { | ||
119 | cairo_set_source_rgba(cairo, | ||
120 | (color >> (3*8) & 0xFF) / 255.0, | ||
121 | (color >> (2*8) & 0xFF) / 255.0, | ||
122 | (color >> (1*8) & 0xFF) / 255.0, | ||
123 | (color >> (0*8) & 0xFF) / 255.0); | ||
124 | } | ||
125 | |||
126 | void render_color(struct window *window, uint32_t color) { | 118 | void render_color(struct window *window, uint32_t color) { |
127 | cairo_set_source_u32(window->cairo, color); | 119 | cairo_set_source_u32(window->cairo, color); |
128 | cairo_paint(window->cairo); | 120 | cairo_paint(window->cairo); |