[gimp/gimp-2-10] app: remove gimp_display_shell_draw_background()



commit 4a7d364062b50fd846c8a21c44c787878560d4c4
Author: Michael Natterer <mitch gimp org>
Date:   Wed May 23 22:55:32 2018 +0200

    app: remove gimp_display_shell_draw_background()
    
    and remove all clipping hacks for drawing the canvas background, turns
    out they never worked and we were relying on the pattern set on the
    window, gah! This optimizes away one entire step of drawing of image
    size, for each expose...

 app/display/gimpdisplayshell-callbacks.c |   26 ++------------------------
 app/display/gimpdisplayshell-draw.c      |   17 -----------------
 app/display/gimpdisplayshell-draw.h      |    2 --
 3 files changed, 2 insertions(+), 43 deletions(-)
---
diff --git a/app/display/gimpdisplayshell-callbacks.c b/app/display/gimpdisplayshell-callbacks.c
index b6bdd96..47ed726 100644
--- a/app/display/gimpdisplayshell-callbacks.c
+++ b/app/display/gimpdisplayshell-callbacks.c
@@ -452,31 +452,11 @@ gimp_display_shell_canvas_draw_image (GimpDisplayShell *shell,
                                            &image_rect.height);
 
 
-  /*  first, clear the exposed part of the region that is outside the
-   *  image, which is the exposed region minus the image rectangle
+  /*  the background has already been cleared by GdkWindow
    */
 
-  cairo_save (cr);
-
-  if (shell->rotate_transform)
-    cairo_transform (cr, shell->rotate_transform);
-
-  cairo_rectangle (cr,
-                   image_rect.x,
-                   image_rect.y,
-                   image_rect.width,
-                   image_rect.height);
-
-  cairo_set_fill_rule (cr, CAIRO_FILL_RULE_EVEN_ODD);
-  cairo_clip (cr);
-
-  if (gdk_cairo_get_clip_rectangle (cr, NULL))
-    gimp_display_shell_draw_background (shell, cr);
 
-  cairo_restore (cr);
-
-
-  /*  then, draw the exposed part of the region that is inside the
+  /*  on top, draw the exposed part of the region that is inside the
    *  image
    */
 
@@ -545,8 +525,6 @@ gimp_display_shell_canvas_draw_drop_zone (GimpDisplayShell *shell,
 {
   cairo_save (cr);
 
-  gimp_display_shell_draw_background (shell, cr);
-
   gimp_cairo_draw_drop_wilber (shell->canvas, cr, shell->blink);
 
   cairo_restore (cr);
diff --git a/app/display/gimpdisplayshell-draw.c b/app/display/gimpdisplayshell-draw.c
index 4afeb2b..ed609dc 100644
--- a/app/display/gimpdisplayshell-draw.c
+++ b/app/display/gimpdisplayshell-draw.c
@@ -81,23 +81,6 @@ gimp_display_shell_draw_selection_in (GimpDisplayShell   *shell,
 }
 
 void
-gimp_display_shell_draw_background (GimpDisplayShell *shell,
-                                    cairo_t          *cr)
-{
-  GdkWindow       *window;
-  cairo_pattern_t *bg_pattern;
-
-  g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
-  g_return_if_fail (cr != NULL);
-
-  window     = gtk_widget_get_window (shell->canvas);
-  bg_pattern = gdk_window_get_background_pattern (window);
-
-  cairo_set_source (cr, bg_pattern);
-  cairo_paint (cr);
-}
-
-void
 gimp_display_shell_draw_checkerboard (GimpDisplayShell *shell,
                                       cairo_t          *cr)
 {
diff --git a/app/display/gimpdisplayshell-draw.h b/app/display/gimpdisplayshell-draw.h
index 5297dd3..b283b45 100644
--- a/app/display/gimpdisplayshell-draw.h
+++ b/app/display/gimpdisplayshell-draw.h
@@ -28,8 +28,6 @@ void   gimp_display_shell_draw_selection_in  (GimpDisplayShell   *shell,
                                               cairo_pattern_t    *mask,
                                               gint                index);
 
-void   gimp_display_shell_draw_background    (GimpDisplayShell   *shell,
-                                              cairo_t            *cr);
 void   gimp_display_shell_draw_checkerboard  (GimpDisplayShell   *shell,
                                               cairo_t            *cr);
 void   gimp_display_shell_draw_image         (GimpDisplayShell   *shell,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]