diff options
author | Matthias Clasen <mclasen@redhat.com> | 2017-10-07 23:31:47 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2017-10-07 23:31:47 -0400 |
commit | f597de817ead93c78a7ea110a7a22493fa13c067 (patch) | |
tree | 5f9c37183f935ae63c017342e6304324dc0be92f /gtk/gtksnapshot.c | |
parent | 515f5268c25de89aecb86d89c8170c875b64d145 (diff) | |
download | gtk+-f597de817ead93c78a7ea110a7a22493fa13c067.tar.gz |
snapshot: Fix blend mode handling
We were getting out states confused and were always creating
a blend mode node with mode NORMAL.
Diffstat (limited to 'gtk/gtksnapshot.c')
-rw-r--r-- | gtk/gtksnapshot.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/gtk/gtksnapshot.c b/gtk/gtksnapshot.c index d846d7b0fb..a9a428db9f 100644 --- a/gtk/gtksnapshot.c +++ b/gtk/gtksnapshot.c @@ -772,7 +772,7 @@ gtk_snapshot_collect_blend_bottom (GtkSnapshot *snapshot, guint n_nodes, const char *name) { - GtkSnapshotState *prev_state = gtk_snapshot_get_current_state (snapshot); + GtkSnapshotState *prev_state = gtk_snapshot_get_previous_state (snapshot); g_assert (prev_state->collect_func == gtk_snapshot_collect_blend_top); @@ -803,7 +803,6 @@ gtk_snapshot_push_blend (GtkSnapshot *snapshot, ...) { GtkSnapshotState *current_state = gtk_snapshot_get_current_state (snapshot); - GtkSnapshotState *bottom_state; GtkSnapshotState *top_state; char *str; @@ -818,19 +817,19 @@ gtk_snapshot_push_blend (GtkSnapshot *snapshot, else str = NULL; - bottom_state = gtk_snapshot_push_state (snapshot, - str, - current_state->clip_region, - current_state->translate_x, - current_state->translate_y, - gtk_snapshot_collect_blend_top); - top_state = gtk_snapshot_push_state (snapshot, - g_strdup (str), - bottom_state->clip_region, - bottom_state->translate_x, - bottom_state->translate_y, - gtk_snapshot_collect_blend_bottom); + str, + current_state->clip_region, + current_state->translate_x, + current_state->translate_y, + gtk_snapshot_collect_blend_top); + + gtk_snapshot_push_state (snapshot, + g_strdup (str), + top_state->clip_region, + top_state->translate_x, + top_state->translate_y, + gtk_snapshot_collect_blend_bottom); top_state->data.blend.blend_mode = blend_mode; } |