[gtk/another-attempt-to-fix-shadertoy: 1/2] snapshot: Don't flip textures
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/another-attempt-to-fix-shadertoy: 1/2] snapshot: Don't flip textures
- Date: Mon, 28 Sep 2020 14:34:02 +0000 (UTC)
commit e6802b9194d165dd2256c80dd832178b1ff6d645
Author: Benjamin Otte <otte redhat com>
Date: Mon Sep 28 16:09:06 2020 +0200
snapshot: Don't flip textures
... or gradients or borders or shadows. Instead, ensure that affines
have non-negative scale factors. Otherwise add a transform node.
The only place where this check is not necessary is color nodes, but
special casing them seems not worth it.
gtk/gtksnapshot.c | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtksnapshot.c b/gtk/gtksnapshot.c
index 3b7c5173a8..89e4ea9d39 100644
--- a/gtk/gtksnapshot.c
+++ b/gtk/gtksnapshot.c
@@ -697,9 +697,22 @@ gtk_snapshot_ensure_affine (GtkSnapshot *snapshot,
{
gtk_snapshot_autopush_transform (snapshot);
state = gtk_snapshot_get_current_state (snapshot);
+ gsk_transform_to_affine (state->transform, scale_x, scale_y, dx, dy);
+ }
+ else if (gsk_transform_get_category (state->transform) == GSK_TRANSFORM_CATEGORY_2D_AFFINE)
+ {
+ gsk_transform_to_affine (state->transform, scale_x, scale_y, dx, dy);
+ if (*scale_x < 0.0 || *scale_y < 0.0)
+ {
+ gtk_snapshot_autopush_transform (snapshot);
+ state = gtk_snapshot_get_current_state (snapshot);
+ gsk_transform_to_affine (state->transform, scale_x, scale_y, dx, dy);
+ }
+ }
+ else
+ {
+ gsk_transform_to_affine (state->transform, scale_x, scale_y, dx, dy);
}
-
- gsk_transform_to_affine (state->transform, scale_x, scale_y, dx, dy);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]