Pass ccs to the cairo blur code

This is needed to set the color properly.
This commit is contained in:
Matthias Clasen 2024-08-02 09:13:41 -04:00
parent 389d246af8
commit 2be48a8f86
3 changed files with 9 additions and 3 deletions

View File

@ -20,8 +20,12 @@
* Owen Taylor <otaylor@redhat.com>
*/
#include "config.h"
#include "gskcairoblurprivate.h"
#include "gdkcairoprivate.h"
#include <math.h>
#include <string.h>
@ -371,6 +375,7 @@ mask_surface_repeat (cairo_t *cr,
cairo_t *
gsk_cairo_blur_finish_drawing (cairo_t *cr,
GdkColorState *ccs,
float radius,
const GdkRGBA *color,
GskBlurFlags blur_flags)
@ -392,7 +397,7 @@ gsk_cairo_blur_finish_drawing (cairo_t *cr,
gsk_cairo_blur_surface (surface, x_scale * radius, blur_flags);
gdk_cairo_set_source_rgba (original_cr, color);
gdk_cairo_set_source_rgba_ccs (original_cr, ccs, color);
if (blur_flags & GSK_BLUR_REPEAT)
mask_surface_repeat (original_cr, surface);
else

View File

@ -44,6 +44,7 @@ cairo_t * gsk_cairo_blur_start_drawing (cairo_t *cr,
float radius,
GskBlurFlags blur_flags);
cairo_t * gsk_cairo_blur_finish_drawing (cairo_t *cr,
GdkColorState *ccs,
float radius,
const GdkRGBA *color,
GskBlurFlags blur_flags);

View File

@ -2207,7 +2207,7 @@ draw_shadow (cairo_t *cr,
cairo_fill (shadow_cr);
gsk_cairo_blur_finish_drawing (shadow_cr, radius, color, blur_flags);
gsk_cairo_blur_finish_drawing (shadow_cr, ccs, radius, color, blur_flags);
}
typedef struct {
@ -5310,7 +5310,7 @@ gsk_shadow_node_draw (GskRenderNode *node,
cairo_pattern_destroy (pattern);
cairo_restore (cr);
cr = gsk_cairo_blur_finish_drawing (cr, 0.5 * shadow->radius, &shadow->color, GSK_BLUR_X | GSK_BLUR_Y);
cr = gsk_cairo_blur_finish_drawing (cr, ccs, 0.5 * shadow->radius, &shadow->color, GSK_BLUR_X | GSK_BLUR_Y);
cairo_restore (cr);
}