summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorQuentin Glidic <sardemff7+git@sardemff7.net>2016-02-21 19:18:58 +0100
committerQuentin Glidic <sardemff7+git@sardemff7.net>2016-02-21 22:10:03 +0100
commit09e520dfe8e86f719c209374200e5470df7af58b (patch)
treeadaf3f9fad3385991d0a473b8093ad8f8cad5c41 /source
parentaa1d8b4046cde49fe9d088eef44daca6765b1bb2 (diff)
rofi: Always use ARGB for Cairo image surfaces
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
Diffstat (limited to 'source')
-rw-r--r--source/textbox.c4
-rw-r--r--source/view.c4
-rw-r--r--source/x11-helper.c8
3 files changed, 4 insertions, 12 deletions
diff --git a/source/textbox.c b/source/textbox.c
index d9225fb3..26d57b6a 100644
--- a/source/textbox.c
+++ b/source/textbox.c
@@ -90,7 +90,7 @@ textbox* textbox_create ( TextboxFlags flags, short x, short y, short w, short h
tb->changed = FALSE;
- tb->main_surface = cairo_image_surface_create ( get_format (), tb->widget.w, tb->widget.h );
+ tb->main_surface = cairo_image_surface_create ( CAIRO_FORMAT_ARGB32, tb->widget.w, tb->widget.h );
tb->main_draw = cairo_create ( tb->main_surface );
tb->layout = pango_layout_new ( p_context );
textbox_font ( tb, tbft );
@@ -271,7 +271,7 @@ static void texbox_update ( textbox *tb )
tb->main_draw = NULL;
tb->main_surface = NULL;
}
- tb->main_surface = cairo_image_surface_create ( get_format (), tb->widget.w, tb->widget.h );
+ tb->main_surface = cairo_image_surface_create ( CAIRO_FORMAT_ARGB32, tb->widget.w, tb->widget.h );
tb->main_draw = cairo_create ( tb->main_surface );
cairo_set_operator ( tb->main_draw, CAIRO_OPERATOR_SOURCE );
diff --git a/source/view.c b/source/view.c
index 2c069007..460a2487 100644
--- a/source/view.c
+++ b/source/view.c
@@ -884,7 +884,7 @@ void rofi_view_update ( RofiViewState *state )
return;
}
TICK ();
- cairo_surface_t * surf = cairo_image_surface_create ( get_format (), state->w, state->h );
+ cairo_surface_t * surf = cairo_image_surface_create ( CAIRO_FORMAT_ARGB32, state->w, state->h );
cairo_t *d = cairo_create ( surf );
cairo_set_operator ( d, CAIRO_OPERATOR_SOURCE );
if ( config.fake_transparency ) {
@@ -1254,7 +1254,7 @@ void rofi_view_setup_fake_transparency ( Display *display, RofiViewState *state
DisplayWidth ( display, screen ),
DisplayHeight ( display, screen ) );
- fake_bg = cairo_image_surface_create ( get_format (), state->mon.w, state->mon.h );
+ fake_bg = cairo_image_surface_create ( CAIRO_FORMAT_ARGB32, state->mon.w, state->mon.h );
cairo_t *dr = cairo_create ( fake_bg );
cairo_set_source_surface ( dr, s, -state->mon.x, -state->mon.y );
cairo_paint ( dr );
diff --git a/source/x11-helper.c b/source/x11-helper.c
index 576ec72c..6171d673 100644
--- a/source/x11-helper.c
+++ b/source/x11-helper.c
@@ -600,14 +600,6 @@ void create_visual_and_colormap ( Display *display )
}
}
-cairo_format_t get_format ( void )
-{
- if ( truecolor ) {
- return CAIRO_FORMAT_ARGB32;
- }
- return CAIRO_FORMAT_RGB24;
-}
-
unsigned int color_get ( Display *display, const char *const name, const char * const defn )
{
char *copy = g_strdup ( name );