mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-09 10:20:07 +00:00
gsk: Change the clear op api
A clear op is just a fancy memcpy. Make it the callers responsibility to convert the color to the right color state before passing it to the clear op.
This commit is contained in:
parent
f9612533c2
commit
9eebe8e547
@ -104,14 +104,13 @@ static const GskGpuOpClass GSK_GPU_CLEAR_OP_CLASS = {
|
||||
|
||||
void
|
||||
gsk_gpu_clear_op (GskGpuFrame *frame,
|
||||
GdkColorState *ccs,
|
||||
const cairo_rectangle_int_t *rect,
|
||||
const GdkRGBA *color)
|
||||
const float color[4])
|
||||
{
|
||||
GskGpuClearOp *self;
|
||||
|
||||
self = (GskGpuClearOp *) gsk_gpu_op_alloc (frame, &GSK_GPU_CLEAR_OP_CLASS);
|
||||
|
||||
self->rect = *rect;
|
||||
gdk_color_state_from_rgba (ccs, color, self->color);
|
||||
memcpy (self->color, color, sizeof (float) * 4);
|
||||
}
|
||||
|
@ -1,13 +1,13 @@
|
||||
#pragma once
|
||||
|
||||
#include "gskgputypesprivate.h"
|
||||
#include "gskgpucolorstatesprivate.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
void gsk_gpu_clear_op (GskGpuFrame *frame,
|
||||
GdkColorState *ccs,
|
||||
const cairo_rectangle_int_t *rect,
|
||||
const GdkRGBA *color);
|
||||
const float color[4]);
|
||||
|
||||
|
||||
G_END_DECLS
|
||||
|
@ -1471,6 +1471,7 @@ gsk_gpu_node_processor_add_color_node (GskGpuNodeProcessor *self,
|
||||
cairo_rectangle_int_t int_clipped;
|
||||
graphene_rect_t rect, clipped;
|
||||
const GdkRGBA *color;
|
||||
float clear_color[4];
|
||||
|
||||
color = gsk_color_node_get_color (node);
|
||||
graphene_rect_offset_r (&node->bounds,
|
||||
@ -1568,10 +1569,8 @@ gsk_gpu_node_processor_add_color_node (GskGpuNodeProcessor *self,
|
||||
}
|
||||
}
|
||||
|
||||
gsk_gpu_clear_op (self->frame,
|
||||
self->ccs,
|
||||
&int_clipped,
|
||||
color);
|
||||
gdk_color_state_from_rgba (self->ccs, color, clear_color);
|
||||
gsk_gpu_clear_op (self->frame, &int_clipped, clear_color);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -3322,10 +3321,10 @@ gsk_gpu_node_processor_add_subsurface_node (GskGpuNodeProcessor *self,
|
||||
{
|
||||
if (gdk_rectangle_intersect (&int_clipped, &self->scissor, &int_clipped))
|
||||
{
|
||||
gsk_gpu_clear_op (self->frame,
|
||||
GDK_COLOR_STATE_SRGB,
|
||||
&int_clipped,
|
||||
&GDK_RGBA_TRANSPARENT);
|
||||
float color[4];
|
||||
|
||||
gdk_color_state_from_rgba (self->ccs, &GDK_RGBA_TRANSPARENT, color);
|
||||
gsk_gpu_clear_op (self->frame, &int_clipped, color);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user