[gtk/wip/baedert/gl-rework: 14/29] gl renderer: Don't copy matrix/offset of color matrix nodes into ops
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/baedert/gl-rework: 14/29] gl renderer: Don't copy matrix/offset of color matrix nodes into ops
- Date: Tue, 17 Dec 2019 12:37:17 +0000 (UTC)
commit 9cc0c8e0fc0e7a1bfa85003dd93429f640226f8b
Author: Timm Bäder <mail baedert org>
Date: Mon Dec 16 06:32:36 2019 +0100
gl renderer: Don't copy matrix/offset of color matrix nodes into ops
gsk/gl/gskglrenderer.c | 4 ++--
gsk/gl/gskglrenderops.c | 16 +++++++++-------
gsk/gl/gskglrenderopsprivate.h | 4 ++--
gsk/gl/opbuffer.h | 4 ++--
4 files changed, 15 insertions(+), 13 deletions(-)
---
diff --git a/gsk/gl/gskglrenderer.c b/gsk/gl/gskglrenderer.c
index 739fce6a2f..684cd91de1 100644
--- a/gsk/gl/gskglrenderer.c
+++ b/gsk/gl/gskglrenderer.c
@@ -2492,10 +2492,10 @@ apply_color_matrix_op (const Program *program,
float mat[16];
float vec[4];
OP_PRINT (" -> Color Matrix");
- graphene_matrix_to_float (&op->matrix, mat);
+ graphene_matrix_to_float (op->matrix, mat);
glUniformMatrix4fv (program->color_matrix.color_matrix_location, 1, GL_FALSE, mat);
- graphene_vec4_to_float (&op->offset, vec);
+ graphene_vec4_to_float (op->offset, vec);
glUniform4fv (program->color_matrix.color_offset_location, 1, vec);
}
diff --git a/gsk/gl/gskglrenderops.c b/gsk/gl/gskglrenderops.c
index c5ba2d7a0f..df65da3b0c 100644
--- a/gsk/gl/gskglrenderops.c
+++ b/gsk/gl/gskglrenderops.c
@@ -633,20 +633,22 @@ ops_set_color_matrix (RenderOpBuilder *builder,
ProgramState *current_program_state = get_current_program_state (builder);
OpColorMatrix *op;
- if (memcmp (matrix,
- ¤t_program_state->color_matrix.matrix,
+ if (current_program_state->color_matrix.matrix &&
+ current_program_state->color_matrix.offset &&
+ memcmp (matrix,
+ current_program_state->color_matrix.matrix,
sizeof (graphene_matrix_t)) == 0 &&
memcmp (offset,
- ¤t_program_state->color_matrix.offset,
+ current_program_state->color_matrix.offset,
sizeof (graphene_vec4_t)) == 0)
return;
- current_program_state->color_matrix.matrix = *matrix;
- current_program_state->color_matrix.offset = *offset;
+ current_program_state->color_matrix.matrix = matrix;
+ current_program_state->color_matrix.offset = offset;
op = ops_begin (builder, OP_CHANGE_COLOR_MATRIX);
- op->matrix = *matrix;
- op->offset = *offset;
+ op->matrix = matrix;
+ op->offset = offset;
}
void
diff --git a/gsk/gl/gskglrenderopsprivate.h b/gsk/gl/gskglrenderopsprivate.h
index 9011d4aaa3..b4933aa6b4 100644
--- a/gsk/gl/gskglrenderopsprivate.h
+++ b/gsk/gl/gskglrenderopsprivate.h
@@ -118,8 +118,8 @@ typedef struct
union {
const GdkRGBA *color;
struct {
- graphene_matrix_t matrix;
- graphene_vec4_t offset;
+ const graphene_matrix_t *matrix;
+ const graphene_vec4_t *offset;
} color_matrix;
struct {
float widths[4];
diff --git a/gsk/gl/opbuffer.h b/gsk/gl/opbuffer.h
index 8578bc108b..e5198bb0b3 100644
--- a/gsk/gl/opbuffer.h
+++ b/gsk/gl/opbuffer.h
@@ -118,8 +118,8 @@ typedef struct
typedef struct
{
- graphene_matrix_t matrix;
- graphene_vec4_t offset;
+ const graphene_matrix_t *matrix;
+ const graphene_vec4_t *offset;
} OpColorMatrix;
typedef struct
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]