mirror of
https://github.com/davatorium/rofi.git
synced 2024-11-11 13:50:48 -05:00
rofi: Always use ARGB for Cairo image surfaces
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
This commit is contained in:
parent
aa1d8b4046
commit
09e520dfe8
4 changed files with 4 additions and 14 deletions
|
@ -164,8 +164,6 @@ void color_border ( Display *display, cairo_t *d );
|
|||
void color_separator ( Display *display, cairo_t *d );
|
||||
void color_cache_reset ( void );
|
||||
|
||||
cairo_format_t get_format ( void );
|
||||
|
||||
void x11_helper_set_cairo_rgba ( cairo_t *d, unsigned int pixel );
|
||||
/*@}*/
|
||||
#endif
|
||||
|
|
|
@ -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 );
|
||||
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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 );
|
||||
|
|
Loading…
Reference in a new issue