[gimp/goat-invasion: 307/418] app: have the display renderer ask for the projection's format not image_type



commit fb55c7be983f0f01efb06c76e8c830c8d450cc07
Author: Michael Natterer <mitch gimp org>
Date:   Thu Mar 29 18:49:31 2012 +0200

    app: have the display renderer ask for the projection's format not image_type

 app/display/gimpdisplayshell-render.c |   20 +++++++++++---------
 1 files changed, 11 insertions(+), 9 deletions(-)
---
diff --git a/app/display/gimpdisplayshell-render.c b/app/display/gimpdisplayshell-render.c
index f1f8334..cca8878 100644
--- a/app/display/gimpdisplayshell-render.c
+++ b/app/display/gimpdisplayshell-render.c
@@ -134,7 +134,7 @@ gimp_display_shell_render (GimpDisplayShell *shell,
   GimpImage      *image;
   TileManager    *tiles;
   RenderInfo      info;
-  GimpImageType   type;
+  const Babl     *format;
   gint            level;
   gboolean        premult;
 
@@ -157,18 +157,20 @@ gimp_display_shell_render (GimpDisplayShell *shell,
                                        tiles, level, premult);
 
   /* Currently, only RGBA and GRAYA projection types are used. */
-  type = gimp_pickable_get_image_type (GIMP_PICKABLE (projection));
+  format = gimp_pickable_get_format (GIMP_PICKABLE (projection));
 
-  switch (type)
+  if (format == babl_format ("R'G'B'A u8"))
     {
-    case GIMP_RGBA_IMAGE:
       render_image_rgb_a (&info);
-      break;
-    case GIMP_GRAYA_IMAGE:
+    }
+  else if (format == babl_format ("Y'A u8"))
+    {
       render_image_gray_a (&info);
-      break;
-    default:
-      g_warning ("%s: unsupported projection type (%d)", G_STRFUNC, type);
+    }
+  else
+    {
+      g_warning ("%s: unsupported projection type (%s)", G_STRFUNC,
+                 babl_get_name (format));
       g_assert_not_reached ();
     }
 



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