From 6343499375ffac770323b853429def4fae1052ce Mon Sep 17 00:00:00 2001 From: "jiyong.min" Date: Wed, 15 Jan 2020 10:42:46 +0900 Subject: [PATCH] Remove '_PNG_COLOR_PICK_ENABLED_' and add '__TIZEN__' '__TIZEN__' is added because of difference with opensource Change-Id: I4940ee2f0d063c944d7625c0cbe143e2a0c877b0 --- packaging/libpng.spec | 4 ---- png.h | 7 ++++--- pngread.c | 12 ++++++------ pngrutil.c | 14 +++++++------- 4 files changed, 17 insertions(+), 20 deletions(-) diff --git a/packaging/libpng.spec b/packaging/libpng.spec index dbeb04c..f8b635b 100644 --- a/packaging/libpng.spec +++ b/packaging/libpng.spec @@ -38,10 +38,6 @@ cp %{SOURCE1001} . CFLAGS+=" -D_ARCH_ARM_ -mfpu=neon" %endif -%if "%{tizen_profile_name}" == "tv" -CFLAGS+=" -D_PNG_COLOR_PICK_ENABLED_ -D_PNG_SEQUENTIAL_READ_SUPPORTED_" -%endif - %configure \ --disable-static \ %ifarch %arm armv7l armv7el aarch64 diff --git a/png.h b/png.h index ed74ca1..8914ebe 100644 --- a/png.h +++ b/png.h @@ -3249,14 +3249,15 @@ PNG_EXPORT(244, int, png_set_option, (png_structrp png_ptr, int option, int onoff)); #endif /* SET_OPTION */ -/* VD_TIZEN_ONLY */ -#ifdef _PNG_COLOR_PICK_ENABLED_ +#ifndef __TIZEN__ +#define __TIZEN__ +#endif +#ifdef __TIZEN__ /* Read the whole image into memory at once. */ PNG_EXPORT(250, void, png_read_image_with_pick_color, (png_structp png_ptr, png_bytepp image, PngPickColor *pickcolor)); #endif -/* VD_TIZEN_ONLY_END */ /******************************************************************************* * END OF HARDWARE AND SOFTWARE OPTIONS diff --git a/pngread.c b/pngread.c index 86a1200..ab6ba49 100644 --- a/pngread.c +++ b/pngread.c @@ -756,7 +756,7 @@ png_read_image(png_structrp png_ptr, png_bytepp image) } } -#ifdef _PNG_COLOR_PICK_ENABLED_ +#ifdef __TIZEN__ void PNGAPI png_read_image_with_pick_color(png_structp png_ptr, png_bytepp image, PngPickColor *pickcolor) { @@ -807,10 +807,10 @@ png_read_image_with_pick_color(png_structp png_ptr, png_bytepp image, PngPickCol #endif image_height=png_ptr->height; - image_bpp=png_ptr->rowbytes; + image_bpp=png_ptr->rowbytes; image_width=png_ptr->width; png_ptr->user_chunk_ptr = pickcolor; - + if(pickcolor->perc < 0) { png_error(png_ptr, "ColorPick percentage is negative"); @@ -878,7 +878,7 @@ png_read_image_with_pick_color(png_structp png_ptr, png_bytepp image, PngPickCol pickcolor->sumB = pickcolor->sumB/npixels; } } -#endif /* _PNG_COLOR_PICK_ENABLED_ */ +#endif /* __TIZEN__ */ #endif /* SEQUENTIAL_READ */ #ifdef PNG_SEQUENTIAL_READ_SUPPORTED @@ -3883,13 +3883,13 @@ png_image_read_direct(png_voidp argument) mode = PNG_ALPHA_PNG; output_gamma = PNG_DEFAULT_sRGB; } - + if ((change & PNG_FORMAT_FLAG_ASSOCIATED_ALPHA) != 0) { mode = PNG_ALPHA_OPTIMIZED; change &= ~PNG_FORMAT_FLAG_ASSOCIATED_ALPHA; } - + /* If 'do_local_background' is set check for the presence of gamma * correction; this is part of the work-round for the libpng bug * described above. diff --git a/pngrutil.c b/pngrutil.c index b9fb8ea..c190e10 100644 --- a/pngrutil.c +++ b/pngrutil.c @@ -3192,10 +3192,10 @@ png_check_chunk_length(png_const_structrp png_ptr, png_uint_32 length) } } -#ifdef _PNG_COLOR_PICK_ENABLED_ +#ifdef __TIZEN__ #ifdef _ARCH_ARM_ -void -copy_src_to_dst(png_bytep dp, png_bytep sp, int width, +void +copy_src_to_dst(png_bytep dp, png_bytep sp, int width, int row_stride, int nplanes, PngPickColor *png_pickcolor) { int j; @@ -3293,7 +3293,7 @@ copy_src_to_dst(png_bytep dp, png_bytep sp, int width, uint64x2_t sumR_64x2 = vpaddlq_u32 ( sumR_32x4 ); uint64x2_t sumG_64x2 = vpaddlq_u32 ( sumG_32x4 ); - uint64x2_t sumB_64x2 = vpaddlq_u32 ( sumB_32x4 ); + uint64x2_t sumB_64x2 = vpaddlq_u32 ( sumB_32x4 ); uint64x1_t sumR_Lo_64x1 = vget_low_u64 ( sumR_64x2 ); uint64x1_t sumR_Hi_64x1 = vget_high_u64 ( sumR_64x2 ); @@ -3311,8 +3311,8 @@ copy_src_to_dst(png_bytep dp, png_bytep sp, int width, vst3_u64( sumRGBA, sumRGB_64x1); png_pickcolor->sumR += sumRGBA[0]; - png_pickcolor->sumG += sumRGBA[1]; - png_pickcolor->sumB += sumRGBA[2]; + png_pickcolor->sumG += sumRGBA[1]; + png_pickcolor->sumB += sumRGBA[2]; } memcpy(dst, src, (width-j)*nplanes); @@ -3351,7 +3351,7 @@ void copy_row(png_bytep dp, png_bytep sp, int width, int pixel_bits, PngPickColo } #endif -#endif +#endif /* __TIZEN__ */ /* Combines the row recently read in with the existing pixels in the row. This * routine takes care of alpha and transparency if requested. This routine also -- 2.7.4