[gimp/soc-2011-seamless-clone2] app: fix image rendering atifacts in rotated views
- From: Clayton Walker <claytonw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/soc-2011-seamless-clone2] app: fix image rendering atifacts in rotated views
- Date: Wed, 8 May 2013 15:17:15 +0000 (UTC)
commit 6cfcf17e602001a48b478c68fef39f8b9963ab53
Author: Michael Natterer <mitch gimp org>
Date: Sun Apr 21 02:08:16 2013 +0200
app: fix image rendering atifacts in rotated views
- stroke around the drawn area to work around the impossibility of
tiling antialiased stuff.
- don't use the display xfer stuff because if we overdraw we must
not have anything in the source pattern outside the drawn region
app/display/gimpdisplayshell-render.c | 36 ++++++++++++++++++++++++++++----
1 files changed, 31 insertions(+), 5 deletions(-)
---
diff --git a/app/display/gimpdisplayshell-render.c b/app/display/gimpdisplayshell-render.c
index 13529f1..bb95546 100644
--- a/app/display/gimpdisplayshell-render.c
+++ b/app/display/gimpdisplayshell-render.c
@@ -85,10 +85,23 @@ gimp_display_shell_render (GimpDisplayShell *shell,
&viewport_offset_y,
&viewport_width,
&viewport_height);
- xfer = gimp_display_xfer_get_surface (shell->xfer,
- w * window_scale,
- h * window_scale,
- &src_x, &src_y);
+ if (shell->rotate_transform)
+ {
+ xfer = cairo_surface_create_similar_image (cairo_get_target (cr),
+ CAIRO_FORMAT_ARGB32,
+ w * window_scale,
+ h * window_scale);
+ cairo_surface_mark_dirty (xfer);
+ src_x = 0;
+ src_y = 0;
+ }
+ else
+ {
+ xfer = gimp_display_xfer_get_surface (shell->xfer,
+ w * window_scale,
+ h * window_scale,
+ &src_x, &src_y);
+ }
stride = cairo_image_surface_get_stride (xfer);
data = cairo_image_surface_get_data (xfer);
@@ -148,7 +161,6 @@ gimp_display_shell_render (GimpDisplayShell *shell,
cairo_save (cr);
cairo_rectangle (cr, x, y, w, h);
- cairo_clip (cr);
cairo_scale (cr, 1.0 / window_scale, 1.0 / window_scale);
@@ -156,6 +168,20 @@ gimp_display_shell_render (GimpDisplayShell *shell,
(x - src_x) * window_scale,
(y - src_y) * window_scale);
+ if (shell->rotate_transform)
+ {
+ cairo_pattern_t *pattern;
+
+ pattern = cairo_get_source (cr);
+ cairo_pattern_set_extend (pattern, CAIRO_EXTEND_PAD);
+
+ cairo_set_line_width (cr, 1.0);
+ cairo_stroke_preserve (cr);
+
+ cairo_surface_destroy (xfer);
+ }
+
+ cairo_clip (cr);
cairo_paint (cr);
#if 0
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]