[gimp] app: split babl fish creating to a separate function gimp_babl_init_fishes()



commit 0788db4702bf613f3b4b53367bf97558d5bc930e
Author: Michael Natterer <mitch gimp org>
Date:   Fri Nov 11 01:06:14 2016 +0100

    app: split babl fish creating to a separate function gimp_babl_init_fishes()
    
    and call that function later in gimp_real_initialize() so the splash
    is always fully drawn when it's called.

 app/core/gimp.c      |    5 +++++
 app/gegl/gimp-babl.c |   45 ++++++++++++++++++++++++---------------------
 app/gegl/gimp-babl.h |    1 +
 3 files changed, 30 insertions(+), 21 deletions(-)
---
diff --git a/app/core/gimp.c b/app/core/gimp.c
index 2fbf390..4b73eea 100644
--- a/app/core/gimp.c
+++ b/app/core/gimp.c
@@ -29,6 +29,7 @@
 
 #include "config/gimprc.h"
 
+#include "gegl/gimp-babl.h"
 #include "gegl/gimp-gegl.h"
 
 #include "pdb/gimppdb.h"
@@ -606,6 +607,10 @@ gimp_real_initialize (Gimp               *gimp,
 
   gimp_plug_in_manager_initialize (gimp->plug_in_manager, status_callback);
 
+  /*  initialize babl fishes  */
+  status_callback (NULL, "Babl Fishes", 0.9);
+  gimp_babl_init_fishes ();
+
   status_callback (NULL, "", 1.0);
 }
 
diff --git a/app/gegl/gimp-babl.c b/app/gegl/gimp-babl.c
index 7dbc486..64e5add 100644
--- a/app/gegl/gimp-babl.c
+++ b/app/gegl/gimp-babl.c
@@ -251,29 +251,32 @@ gimp_babl_init (void)
                    babl_type ("double"),
                    babl_component ("A"),
                    NULL);
+}
 
-  /* create a bunch of fishes - to decrease the initial lazy intialization cost
-     for some interactions
+void
+gimp_babl_init_fishes (void)
+{
+  /* create a bunch of fishes - to decrease the initial lazy
+   * intialization cost for some interactions
    */
-  babl_fish (babl_format("Y' u8"), babl_format("RaGaBaA float"));
-  babl_fish (babl_format("Y u8"), babl_format("RaGaBaA float"));
-  babl_fish (babl_format("R'G'B'A u8"), babl_format("RaGaBaA float"));
-  babl_fish (babl_format("R'G'B'A float"), babl_format("R'G'B'A u8"));
-  babl_fish (babl_format("R'G'B'A float"), babl_format("R'G'B' u8"));
-  babl_fish (babl_format("R'G'B'A u8"), babl_format("RGBA float"));
-  babl_fish (babl_format("RGBA float"), babl_format("R'G'B'A u8"));
-  babl_fish (babl_format("RGBA float"), babl_format("R'G'B'A u8"));
-  babl_fish (babl_format("RGBA float"), babl_format("R'G'B'A float"));
-  babl_fish (babl_format("Y' u8"), babl_format("R'G'B' u8"));
-  babl_fish (babl_format("Y u8"), babl_format("Y float"));
-  babl_fish (babl_format("R'G'B' u8"), babl_format("cairo-RGB24"));
-  babl_fish (babl_format("R'G'B' u8"), babl_format("R'G'B'A float"));
-  babl_fish (babl_format("R'G'B' u8"), babl_format("R'G'B'A u8"));
-  babl_fish (babl_format("R'G'B'A u8"), babl_format("R'G'B'A float"));
-  babl_fish (babl_format("R'G'B'A u8"), babl_format("cairo-ARGB32"));
-  babl_fish (babl_format("R'G'B'A double"), babl_format("RGBA float"));
-  babl_fish (babl_format("R'G'B'A float"), babl_format("RGBA double"));
-
+  babl_fish (babl_format ("Y' u8"),          babl_format ("RaGaBaA float"));
+  babl_fish (babl_format ("Y u8"),           babl_format ("RaGaBaA float"));
+  babl_fish (babl_format ("R'G'B'A u8"),     babl_format ("RaGaBaA float"));
+  babl_fish (babl_format ("R'G'B'A float"),  babl_format ("R'G'B'A u8"));
+  babl_fish (babl_format ("R'G'B'A float"),  babl_format ("R'G'B' u8"));
+  babl_fish (babl_format ("R'G'B'A u8"),     babl_format ("RGBA float"));
+  babl_fish (babl_format ("RGBA float"),     babl_format ("R'G'B'A u8"));
+  babl_fish (babl_format ("RGBA float"),     babl_format ("R'G'B'A u8"));
+  babl_fish (babl_format ("RGBA float"),     babl_format ("R'G'B'A float"));
+  babl_fish (babl_format ("Y' u8"),          babl_format ("R'G'B' u8"));
+  babl_fish (babl_format ("Y u8"),           babl_format ("Y float"));
+  babl_fish (babl_format ("R'G'B' u8"),      babl_format ("cairo-RGB24"));
+  babl_fish (babl_format ("R'G'B' u8"),      babl_format ("R'G'B'A float"));
+  babl_fish (babl_format ("R'G'B' u8"),      babl_format ("R'G'B'A u8"));
+  babl_fish (babl_format ("R'G'B'A u8"),     babl_format ("R'G'B'A float"));
+  babl_fish (babl_format ("R'G'B'A u8"),     babl_format ("cairo-ARGB32"));
+  babl_fish (babl_format ("R'G'B'A double"), babl_format ("RGBA float"));
+  babl_fish (babl_format ("R'G'B'A float"),  babl_format ("RGBA double"));
 }
 
 static const struct
diff --git a/app/gegl/gimp-babl.h b/app/gegl/gimp-babl.h
index 334f959..bab9298 100644
--- a/app/gegl/gimp-babl.h
+++ b/app/gegl/gimp-babl.h
@@ -23,6 +23,7 @@
 
 
 void                gimp_babl_init                      (void);
+void                gimp_babl_init_fishes               (void);
 
 const gchar       * gimp_babl_format_get_description    (const Babl *format);
 GimpColorProfile  * gimp_babl_format_get_color_profile  (const Babl *format);


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