[Libreoffice-commits] core.git: 3 commits - jpeg/ExternalPackage_jpeg.mk jurt/CustomTarget_jnilib.mk jurt/Package_jnilib.mk vcl/source

David Tardon dtardon at redhat.com
Sun Apr 21 23:17:52 PDT 2013


 jpeg/ExternalPackage_jpeg.mk      |    1 -
 jurt/CustomTarget_jnilib.mk       |   13 +++++++------
 jurt/Package_jnilib.mk            |    6 ++----
 vcl/source/filter/jpeg/transupp.c |   34 +++++++++++++++++++++++-----------
 4 files changed, 32 insertions(+), 22 deletions(-)

New commits:
commit 845456565db945ffd2a1551ab86446fcd1717021
Author: David Tardon <dtardon at redhat.com>
Date:   Mon Apr 22 08:14:46 2013 +0200

    DO NOT use internal headers of jpeg
    
    They ARE NOT available when using system jpeg.
    
    Apart of that, I am not sure if it is all right to include parts of jpeg
    directly into our code.
    
    Change-Id: Ic19a22e73094d452ffd072b819020e4a46256406

diff --git a/jpeg/ExternalPackage_jpeg.mk b/jpeg/ExternalPackage_jpeg.mk
index 66cfc91..c451ed5 100644
--- a/jpeg/ExternalPackage_jpeg.mk
+++ b/jpeg/ExternalPackage_jpeg.mk
@@ -13,7 +13,6 @@ $(eval $(call gb_ExternalPackage_add_unpacked_files,jpeg_inc,inc/external/jpeg,\
 	jconfig.h \
 	jerror.h \
 	jmorecfg.h \
-	jpegint.h \
 	jpeglib.h \
 ))
 
diff --git a/vcl/source/filter/jpeg/transupp.c b/vcl/source/filter/jpeg/transupp.c
index fd2ff37..500b0a2 100644
--- a/vcl/source/filter/jpeg/transupp.c
+++ b/vcl/source/filter/jpeg/transupp.c
@@ -14,11 +14,7 @@
  * interfaces.
  */
 
-/* Although this file really shouldn't have access to the library internals,
- * it's helpful to let it call jround_up() and jcopy_block_row().
- */
-#define JPEG_INTERNALS
-
+#include "jerror.h"
 #include "jinclude.h"
 #include "jpeglib.h"
 #include "transupp.h"       /* My own external interface */
@@ -86,6 +82,22 @@
  *    source buffer it is an undocumented property of jdcoefct.c.
  */
 
+static void lcl_jcopy_block_row (JBLOCKROW input_row, JBLOCKROW output_row, JDIMENSION num_blocks)
+/* Copy a row of coefficient blocks from one place to another. */
+{
+#ifdef FMEMCOPY
+  FMEMCOPY(output_row, input_row, num_blocks * (DCTSIZE2 * SIZEOF(JCOEF)));
+#else
+  register JCOEFPTR inptr, outptr;
+  register long count;
+
+  inptr = (JCOEFPTR) input_row;
+  outptr = (JCOEFPTR) output_row;
+  for (count = (long) num_blocks * DCTSIZE2; count > 0; count--) {
+    *outptr++ = *inptr++;
+  }
+#endif
+}
 
 LOCAL(void)
 do_crop (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
@@ -116,7 +128,7 @@ do_crop (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
      dst_blk_y + y_crop_blocks,
      (JDIMENSION) compptr->v_samp_factor, FALSE);
       for (offset_y = 0; offset_y < compptr->v_samp_factor; offset_y++) {
-    jcopy_block_row(src_buffer[offset_y] + x_crop_blocks,
+    lcl_jcopy_block_row(src_buffer[offset_y] + x_crop_blocks,
             dst_buffer[offset_y],
             compptr->width_in_blocks);
       }
@@ -176,12 +188,12 @@ do_flip_h_no_crop (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
     }
     if (x_crop_blocks > 0) {
       /* Now left-justify the portion of the data to be kept.
-       * We can't use a single jcopy_block_row() call because that routine
+       * We can't use a single lcl_jcopy_block_row() call because that routine
        * depends on memcpy(), whose behavior is unspecified for overlapping
        * source and destination areas.  Sigh.
        */
       for (blk_x = 0; blk_x < compptr->width_in_blocks; blk_x++) {
-        jcopy_block_row(buffer[offset_y] + blk_x + x_crop_blocks,
+        lcl_jcopy_block_row(buffer[offset_y] + blk_x + x_crop_blocks,
                 buffer[offset_y] + blk_x,
                 (JDIMENSION) 1);
       }
@@ -243,7 +255,7 @@ do_flip_h (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
         }
       } else {
         /* Copy last partial block(s) verbatim */
-        jcopy_block_row(src_row_ptr + dst_blk_x + x_crop_blocks,
+        lcl_jcopy_block_row(src_row_ptr + dst_blk_x + x_crop_blocks,
                 dst_row_ptr + dst_blk_x,
                 (JDIMENSION) 1);
       }
@@ -324,7 +336,7 @@ do_flip_v (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
       }
     } else {
       /* Just copy row verbatim. */
-      jcopy_block_row(src_buffer[offset_y] + x_crop_blocks,
+      lcl_jcopy_block_row(src_buffer[offset_y] + x_crop_blocks,
               dst_buffer[offset_y],
               compptr->width_in_blocks);
     }
@@ -630,7 +642,7 @@ do_rot_180 (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
           }
         } else {
           /* Any remaining right-edge blocks are only copied. */
-          jcopy_block_row(src_row_ptr + dst_blk_x + x_crop_blocks,
+          lcl_jcopy_block_row(src_row_ptr + dst_blk_x + x_crop_blocks,
                   dst_row_ptr + dst_blk_x,
                   (JDIMENSION) 1);
         }
commit f9c45046f39029a69f6ab90a972459d8c12f065e
Author: David Tardon <dtardon at redhat.com>
Date:   Mon Apr 22 07:33:38 2013 +0200

    create the jnilib in the right dir
    
    macosx-create-bundle creates the .jnilib symlink in the same dir the
    library is in. But we do not want to create stuff directly in $(OUTDIR).
    
    Change-Id: I7fa3380a164c6157ce1c710b9e8a815375ff3a72

diff --git a/jurt/CustomTarget_jnilib.mk b/jurt/CustomTarget_jnilib.mk
index 6364fcb..eb2c3de 100644
--- a/jurt/CustomTarget_jnilib.mk
+++ b/jurt/CustomTarget_jnilib.mk
@@ -31,8 +31,10 @@ $(eval $(call gb_CustomTarget_register_targets,jurt/util,\
 	libjpipe.jnilib \
 ))
 
+# TODO: could this be replaced by defining library jpipe as gb_Library_Bundle?
 $(call gb_CustomTarget_get_workdir,jurt/util)/libjpipe.jnilib : $(call gb_Library_get_target,jpipe)
 	$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),MCB,1)
-	cd $(dir $@) && $(SOLARENV)/bin/macosx-create-bundle $<
+	cp $< $(dir $@)$(notdir $<) && \
+	$(SOLARENV)/bin/macosx-create-bundle $(dir $@)$(notdir $<)
 
 # vim:set shiftwidth=4 tabstop=4 noexpandtab:
commit 02aee3b818e5e22a038043def91dea74ee4d00c6
Author: David Tardon <dtardon at redhat.com>
Date:   Mon Apr 22 07:26:47 2013 +0200

    update makefiles
    
    Change-Id: Id0d02f11a81f32a1ec446f7a44ec995e1788e7dd

diff --git a/jurt/CustomTarget_jnilib.mk b/jurt/CustomTarget_jnilib.mk
index a74cad4..6364fcb 100644
--- a/jurt/CustomTarget_jnilib.mk
+++ b/jurt/CustomTarget_jnilib.mk
@@ -27,12 +27,11 @@
 
 $(eval $(call gb_CustomTarget_CustomTarget,jurt/util))
 
-$(call gb_CustomTarget_get_target,jurt/util) : \
-	$(call gb_CustomTarget_get_workdir,jurt/util)/libjpipe.jnilib
+$(eval $(call gb_CustomTarget_register_targets,jurt/util,\
+	libjpipe.jnilib \
+))
 
-$(call gb_CustomTarget_get_workdir,jurt/util)/libjpipe.jnilib : \
-		$(call gb_Library_get_target,jpipe) \
-		| $(call gb_CustomTarget_get_workdir,jurt/util)/.dir
+$(call gb_CustomTarget_get_workdir,jurt/util)/libjpipe.jnilib : $(call gb_Library_get_target,jpipe)
 	$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),MCB,1)
 	cd $(dir $@) && $(SOLARENV)/bin/macosx-create-bundle $<
 
diff --git a/jurt/Package_jnilib.mk b/jurt/Package_jnilib.mk
index bb713d1..2d33105 100644
--- a/jurt/Package_jnilib.mk
+++ b/jurt/Package_jnilib.mk
@@ -25,10 +25,8 @@
 # in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
 # instead of those above.
 
-$(eval $(call gb_Package_Package,jurt_jnilib,$(WORKDIR)/CustomTarget/jurt/util))
+$(eval $(call gb_Package_Package,jurt_jnilib,$(call gb_CustomTarget_get_workdir,jurt/util)))
 
-$(eval $(call gb_Package_add_files,jurt_jnilib,lib,\
-	$(patsubst %.dylib,%.jnilib,$(call gb_Library_get_filename,jpipe)) \
-))
+$(eval $(call gb_Package_add_files,jurt_jnilib,lib/$(patsubst %.dylib,%.jnilib,$(call gb_Library_get_filename,jpipe)),libjpipe.jnilib))
 
 # vim:set noet sw=4 ts=4:


More information about the Libreoffice-commits mailing list