[gtk/wip/baedert/for-master: 2/7] 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: 2/7] gl renderer: Avoid setting modelview to identical values
- Date: Fri, 18 Dec 2020 10:00:56 +0000 (UTC)
commit 38c215440b103ee2d05021dcd61d7d1546f358aa
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]