Merge branch 'wip/otte/for-main' into 'main'

gpu: Remove unused macro

See merge request GNOME/gtk!7449
This commit is contained in:
Benjamin Otte 2024-07-13 01:25:35 +00:00
commit e975d6db17
5 changed files with 12 additions and 19 deletions

View File

@ -4,8 +4,8 @@
#include "gskgpuopprivate.h"
#include "gskgpuprintprivate.h"
/* for gsk_gpu_rgba_to_float() */
#include "gskgpushaderopprivate.h"
#include "gdk/gdkcolorstateprivate.h"
typedef struct _GskGpuClearOp GskGpuClearOp;

View File

@ -384,7 +384,7 @@ gsk_gpu_node_processor_init_draw (GskGpuNodeProcessor *self,
gsk_gpu_render_pass_begin_op (frame,
image,
&area,
&GDK_RGBA_TRANSPARENT,
GSK_VEC4_TRANSPARENT,
GSK_RENDER_PASS_OFFSCREEN);
return image;
@ -697,7 +697,7 @@ gsk_gpu_copy_image (GskGpuFrame *frame,
gsk_gpu_render_pass_begin_op (other.frame,
copy,
&(cairo_rectangle_int_t) { 0, 0, width, height },
&GDK_RGBA_TRANSPARENT,
GSK_VEC4_TRANSPARENT,
GSK_RENDER_PASS_OFFSCREEN);
gsk_gpu_node_processor_sync_globals (&other, 0);
@ -1627,6 +1627,7 @@ gsk_gpu_node_processor_add_first_color_node (GskGpuNodeProcessor *self,
GskRenderNode *node)
{
graphene_rect_t clip_bounds;
float color[4];
if (!node->fully_opaque)
return FALSE;
@ -1635,10 +1636,11 @@ gsk_gpu_node_processor_add_first_color_node (GskGpuNodeProcessor *self,
if (!gsk_rect_contains_rect (&node->bounds, &clip_bounds))
return FALSE;
gdk_color_state_from_rgba (self->ccs, gsk_color_node_get_color (node), color);
gsk_gpu_render_pass_begin_op (self->frame,
target,
clip,
gsk_color_node_get_color (node),
color,
pass_type);
return TRUE;
@ -3921,7 +3923,7 @@ gsk_gpu_node_processor_process (GskGpuFrame *frame,
gsk_gpu_render_pass_begin_op (frame,
target,
clip,
&GDK_RGBA_TRANSPARENT,
GSK_VEC4_TRANSPARENT,
pass_type);
gsk_gpu_node_processor_add_node (&self, node);

View File

@ -330,7 +330,7 @@ void
gsk_gpu_render_pass_begin_op (GskGpuFrame *frame,
GskGpuImage *image,
const cairo_rectangle_int_t *area,
const GdkRGBA *clear_color_or_null,
float clear_color_or_null[4],
GskRenderPassType pass_type)
{
GskGpuRenderPassOp *self;
@ -341,7 +341,7 @@ gsk_gpu_render_pass_begin_op (GskGpuFrame *frame,
self->area = *area;
self->clear = clear_color_or_null != NULL;
if (clear_color_or_null)
gsk_gpu_rgba_to_float (clear_color_or_null, self->clear_color);
gsk_gpu_color_to_float (clear_color_or_null, self->clear_color);
self->pass_type = pass_type;
}

View File

@ -11,7 +11,7 @@ G_BEGIN_DECLS
void gsk_gpu_render_pass_begin_op (GskGpuFrame *frame,
GskGpuImage *image,
const cairo_rectangle_int_t *area,
const GdkRGBA *clear_color_or_null,
float clear_color_or_null[4],
GskRenderPassType pass_type);
void gsk_gpu_render_pass_end_op (GskGpuFrame *frame,
GskGpuImage *image,

View File

@ -66,18 +66,9 @@ GskGpuOp * gsk_gpu_shader_op_gl_command (GskGpuO
GskGpuFrame *frame,
GskGLCommandState *state);
static inline void
gsk_gpu_rgba_to_float (const GdkRGBA *rgba,
float values[4])
{
values[0] = rgba->red;
values[1] = rgba->green;
values[2] = rgba->blue;
values[3] = rgba->alpha;
}
#define GSK_RGBA_TO_VEC4(_color) (float[4]) { (_color)->red, (_color)->green, (_color)->blue, (_color)->alpha }
#define GSK_RGBA_TO_VEC4_ALPHA(_color, _alpha) (float[4]) { (_color)->red, (_color)->green, (_color)->blue, (_color)->alpha * (_alpha) }
#define GSK_VEC4_TRANSPARENT (float[4]) { 0.0f, 0.0f, 0.0f, 0.0f }
static inline void
gsk_gpu_color_to_float (const float color[4],