[babl] babl: use memcpy dpsatch path for all identity transforms



commit 13c1dea65943be7d2a0104e43ca7fead03ee25f5
Author: Øyvind Kolås <pippin gimp org>
Date:   Mon Jan 15 22:41:03 2018 +0100

    babl: use memcpy dpsatch path for all identity transforms

 babl/babl-fish-path.c |   21 +++++++++------------
 1 files changed, 9 insertions(+), 12 deletions(-)
---
diff --git a/babl/babl-fish-path.c b/babl/babl-fish-path.c
index 19d7f14..8b614e8 100644
--- a/babl/babl-fish-path.c
+++ b/babl/babl-fish-path.c
@@ -668,19 +668,18 @@ babl_fish_memcpy_process (const Babl *babl,
 void
 _babl_fish_rig_dispatch (Babl *babl)
 {
+  babl->fish.data     = (void*)&(babl->fish.data);
+
+  if (babl->fish.source == babl->fish.destination)
+    {
+      babl->fish.dispatch = babl_fish_memcpy_process;
+      return;
+    }
+
   switch (babl->class_type)
     {
       case BABL_FISH_REFERENCE:
-        if (babl->fish.source == babl->fish.destination)
-          {
-            babl->fish.dispatch = babl_fish_memcpy_process;
-            babl->fish.data     = (void*)&(babl->fish.data);
-          }
-        else
-          {
-            babl->fish.dispatch = babl_fish_reference_process;
-            babl->fish.data     = (void*)&(babl->fish.data);
-          }
+        babl->fish.dispatch = babl_fish_reference_process;
         break;
 
       case BABL_FISH_SIMPLE:
@@ -706,12 +705,10 @@ _babl_fish_rig_dispatch (Babl *babl)
           /* do same short-circuit optimization as for simple fishes */
 
           babl->fish.dispatch = conversion->dispatch;
-          babl->fish.data     = &conversion->data;
         }
         else
         {
           babl->fish.dispatch = babl_fish_path_process;
-          babl->fish.data     = (void*)&(babl->fish.data);
         }
         break;
 


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