{
const float scale = ops_get_scale (builder);
const GskRoundedRect *outline = gsk_outset_shadow_node_peek_outline (node);
+ const GdkRGBA *color = gsk_outset_shadow_node_peek_color (node);
const float blur_radius = gsk_outset_shadow_node_get_blur_radius (node);
const float blur_extra = blur_radius * 3; /* 3 Because we use that in the shader as well */
const float spread = gsk_outset_shadow_node_get_spread (node);
cached_tid = gsk_gl_shadow_cache_get_texture_id (&self->shadow_cache,
self->gl_driver,
&scaled_outline,
+ color,
blur_radius);
if (cached_tid == 0)
/* Draw outline */
ops_set_program (builder, &self->color_program);
ops_push_clip (builder, &scaled_outline);
- ops_set_color (builder, gsk_outset_shadow_node_peek_color (node));
+ ops_set_color (builder, color);
ops_draw (builder, (GskQuadVertex[GL_N_VERTICES]) {
{ { 0, }, { 0, 1 }, },
{ { 0, texture_height }, { 0, 0 }, },
gsk_gl_driver_mark_texture_permanent (self->gl_driver, blurred_texture_id);
gsk_gl_shadow_cache_commit (&self->shadow_cache,
&scaled_outline,
+ color,
blur_radius,
blurred_texture_id);
}
{
GskRoundedRect outline;
float blur_radius;
+ GdkRGBA color;
} CacheKey;
typedef struct
{
GskRoundedRect outline;
float blur_radius;
+ GdkRGBA color;
int texture_id;
int unused_frames;
const CacheKey *a = x;
const CacheKey *b = y;
- return graphene_size_equal (&a->outline.corner[0], &b->outline.corner[0]) &&
+ return a->blur_radius == b->blur_radius &&
+ graphene_size_equal (&a->outline.corner[0], &b->outline.corner[0]) &&
graphene_size_equal (&a->outline.corner[1], &b->outline.corner[1]) &&
graphene_size_equal (&a->outline.corner[2], &b->outline.corner[2]) &&
graphene_size_equal (&a->outline.corner[3], &b->outline.corner[3]) &&
graphene_rect_equal (&a->outline.bounds, &b->outline.bounds) &&
- a->blur_radius == b->blur_radius;
+ gdk_rgba_equal (&a->color, &b->color);
}
void
gsk_gl_shadow_cache_get_texture_id (GskGLShadowCache *self,
GskGLDriver *gl_driver,
const GskRoundedRect *shadow_rect,
+ const GdkRGBA *color,
float blur_radius)
{
CacheItem *item= NULL;
{
CacheItem *k = &g_array_index (self->textures, CacheItem, i);
- if (key_equal (&(CacheKey){*shadow_rect, blur_radius},
- &(CacheKey){k->outline, k->blur_radius}))
+ if (key_equal (&(CacheKey){*shadow_rect, blur_radius, *color},
+ &(CacheKey){k->outline, k->blur_radius, k->color}))
{
item = k;
break;
void
gsk_gl_shadow_cache_commit (GskGLShadowCache *self,
const GskRoundedRect *shadow_rect,
+ const GdkRGBA *color,
float blur_radius,
int texture_id)
{
item = &g_array_index (self->textures, CacheItem, self->textures->len - 1);
item->outline = *shadow_rect;
+ item->color = *color;
item->blur_radius = blur_radius;
item->unused_frames = 0;
item->texture_id = texture_id;