[gtk/wip/baedert/for-master: 7/23] gl renderer: Avoid setting modelview to identical values
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/baedert/for-master: 7/23] gl renderer: Avoid setting modelview to identical values
- Date: Mon, 21 Dec 2020 09:26:11 +0000 (UTC)
commit a8213d7f4529483abe84c96f0c010edf1eacf6f8
Author: Timm Bäder <mail baedert org>
Date: Thu Dec 17 17:24:31 2020 +0100
gl renderer: Avoid setting modelview to identical values
The previous comment here was incorrect. We can save the op itself, we
just can't save us the entry in the modelview stack.
gsk/gl/gskglrenderops.c | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)
---
diff --git a/gsk/gl/gskglrenderops.c b/gsk/gl/gskglrenderops.c
index a6e071f657..20bd178a3f 100644
--- a/gsk/gl/gskglrenderops.c
+++ b/gsk/gl/gskglrenderops.c
@@ -357,19 +357,18 @@ ops_set_modelview_internal (RenderOpBuilder *builder,
GskTransform *transform)
{
ProgramState *current_program_state = get_current_program_state (builder);
- OpMatrix *op;
-
-#if 0
- XXX This is not possible if we want pop() to work.
- if (builder->current_program &&
- gsk_transform_equal (builder->current_program_state->modelview, transform))
- return;
-#endif
- if (!(op = op_buffer_peek_tail_checked (&builder->render_ops, OP_CHANGE_MODELVIEW)))
- op = op_buffer_add (&builder->render_ops, OP_CHANGE_MODELVIEW);
+ if (current_program_state &&
+ gsk_transform_equal (current_program_state->modelview, transform))
+ {
+ /* We can save us this op entirely... */
+ }
+ else
+ {
+ OpMatrix *op = op_buffer_add (&builder->render_ops, OP_CHANGE_MODELVIEW);
- gsk_transform_to_matrix (transform, &op->matrix);
+ gsk_transform_to_matrix (transform, &op->matrix);
+ }
if (builder->current_program != NULL)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]