diff options
author | Drew DeVault <sir@cmpwn.com> | 2016-01-25 16:06:46 -0500 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2016-01-25 16:06:46 -0500 |
commit | f1e1ba0a5689966984f71a00572b89ea2d26f06b (patch) | |
tree | 7d7319859fdfa90ac7e6803b634f38a5418bb180 /wayland/cairo.c | |
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 'wayland/cairo.c')
-rw-r--r-- | wayland/cairo.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/wayland/cairo.c b/wayland/cairo.c index 7462b10a..ba439d9d 100644 --- a/wayland/cairo.c +++ b/wayland/cairo.c | |||
@@ -1,6 +1,13 @@ | |||
1 | #include <cairo/cairo.h> | ||
2 | #include "client/cairo.h" | 1 | #include "client/cairo.h" |
3 | 2 | ||
3 | void cairo_set_source_u32(cairo_t *cairo, uint32_t color) { | ||
4 | cairo_set_source_rgba(cairo, | ||
5 | (color >> (3*8) & 0xFF) / 255.0, | ||
6 | (color >> (2*8) & 0xFF) / 255.0, | ||
7 | (color >> (1*8) & 0xFF) / 255.0, | ||
8 | (color >> (0*8) & 0xFF) / 255.0); | ||
9 | } | ||
10 | |||
4 | #ifdef WITH_GDK_PIXBUF | 11 | #ifdef WITH_GDK_PIXBUF |
5 | #include <gdk-pixbuf/gdk-pixbuf.h> | 12 | #include <gdk-pixbuf/gdk-pixbuf.h> |
6 | 13 | ||