[gtk+/wip/baedert/gl: 67/95] gl renderer: Avoid consecutive opacity ops
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/baedert/gl: 67/95] gl renderer: Avoid consecutive opacity ops
- Date: Sun, 10 Dec 2017 21:28:36 +0000 (UTC)
commit dae83fa98a0b9671e412c5cf4479c9bbfd45857d
Author: Timm Bäder <mail baedert org>
Date: Sun Dec 3 16:58:01 2017 +0100
gl renderer: Avoid consecutive opacity ops
gsk/gl/gskglrenderops.c | 16 +++++++++++++---
1 files changed, 13 insertions(+), 3 deletions(-)
---
diff --git a/gsk/gl/gskglrenderops.c b/gsk/gl/gskglrenderops.c
index 2741320..3c97d94 100644
--- a/gsk/gl/gskglrenderops.c
+++ b/gsk/gl/gskglrenderops.c
@@ -207,13 +207,23 @@ ops_set_opacity (RenderOpBuilder *builder,
{
RenderOp op;
float prev_opacity;
+ RenderOp *last_op;
if (builder->current_opacity == opacity)
return opacity;
- op.op = OP_CHANGE_OPACITY;
- op.opacity = opacity;
- g_array_append_val (builder->render_ops, op);
+ last_op = &g_array_index (builder->render_ops, RenderOp, builder->render_ops->len - 1);
+
+ if (last_op->op == OP_CHANGE_OPACITY)
+ {
+ last_op->opacity = opacity;
+ }
+ else
+ {
+ op.op = OP_CHANGE_OPACITY;
+ op.opacity = opacity;
+ g_array_append_val (builder->render_ops, op);
+ }
prev_opacity = builder->current_opacity;
builder->current_opacity = opacity;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]