From owner-svn-ports-head@FreeBSD.ORG Thu Dec 25 12:30:51 2014 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 47990C74; Thu, 25 Dec 2014 12:30:51 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 336BE2C55; Thu, 25 Dec 2014 12:30:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sBPCUpaK082016; Thu, 25 Dec 2014 12:30:51 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sBPCUobN082013; Thu, 25 Dec 2014 12:30:50 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201412251230.sBPCUobN082013@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Thu, 25 Dec 2014 12:30:50 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r375540 - in head/graphics/simpleviewer: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Dec 2014 12:30:51 -0000 Author: bapt Date: Thu Dec 25 12:30:49 2014 New Revision: 375540 URL: https://svnweb.freebsd.org/changeset/ports/375540 QAT: https://qat.redports.org/buildarchive/r375540/ Log: Properly support png 1.5 Added: head/graphics/simpleviewer/files/patch-src_formats_formatpng.cpp (contents, props changed) Deleted: head/graphics/simpleviewer/files/patch-formatpng.cpp Modified: head/graphics/simpleviewer/Makefile head/graphics/simpleviewer/files/patch-src_fileslist.cpp Modified: head/graphics/simpleviewer/Makefile ============================================================================== --- head/graphics/simpleviewer/Makefile Thu Dec 25 12:18:54 2014 (r375539) +++ head/graphics/simpleviewer/Makefile Thu Dec 25 12:30:49 2014 (r375540) @@ -14,14 +14,13 @@ COMMENT= Small and simple OpenGL image v LICENSE= GPLv2 LIB_DEPENDS= libjpeg.so:${PORTSDIR}/graphics/jpeg \ - libpng15.so:${PORTSDIR}/graphics/png \ + libpng.so:${PORTSDIR}/graphics/png \ libgif.so:${PORTSDIR}/graphics/giflib USES= tar:bzip2 USE_EFL= imlib2 USE_GL= glut WRKSRC= ${WRKDIR}/sviewgl-src -CFLAGS+= -I${LOCALBASE}/include/libpng15 MAKE_ARGS= CC="${CXX}" PLIST_FILES= bin/sviewgl Modified: head/graphics/simpleviewer/files/patch-src_fileslist.cpp ============================================================================== --- head/graphics/simpleviewer/files/patch-src_fileslist.cpp Thu Dec 25 12:18:54 2014 (r375539) +++ head/graphics/simpleviewer/files/patch-src_fileslist.cpp Thu Dec 25 12:30:49 2014 (r375540) @@ -1,4 +1,4 @@ ---- src/fileslist.cpp.orig 2010-05-13 07:15:11.000000000 +0000 +--- src/fileslist.cpp.orig 2010-05-13 07:15:11 UTC +++ src/fileslist.cpp @@ -8,6 +8,7 @@ #include "fileslist.h" Added: head/graphics/simpleviewer/files/patch-src_formats_formatpng.cpp ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/graphics/simpleviewer/files/patch-src_formats_formatpng.cpp Thu Dec 25 12:30:49 2014 (r375540) @@ -0,0 +1,68 @@ +--- src/formats/formatpng.cpp.orig 2010-08-29 14:33:33 UTC ++++ src/formats/formatpng.cpp +@@ -57,9 +57,9 @@ bool CFormatPng::Load(const char* filena + png_read_info(png, info); + + // get real bits per pixel +- m_bppImage = info->pixel_depth; ++ m_bppImage = png_get_bit_depth(png, info) * png_get_channels(png, info); + +- if(info->color_type == PNG_COLOR_TYPE_PALETTE) { ++ if(png_get_color_type(png, info) == PNG_COLOR_TYPE_PALETTE) { + png_set_palette_to_rgb(png); + } + +@@ -73,20 +73,20 @@ bool CFormatPng::Load(const char* filena + if(png_get_valid(png, info, PNG_INFO_tRNS)) { + png_set_tRNS_to_alpha(png); + } +- if(info->bit_depth == 16) { ++ if(png_get_bit_depth(png, info) == 16) { + png_set_strip_16(png); + } +- if(info->color_type == PNG_COLOR_TYPE_GRAY || info->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) { ++ if(png_get_color_type(png, info) == PNG_COLOR_TYPE_GRAY || png_get_color_type(png, info) == PNG_COLOR_TYPE_GRAY_ALPHA) { + png_set_gray_to_rgb(png); + } + + // int number_of_passes = png_set_interlace_handling(png); + png_read_update_info(png, info); + +- m_width = info->width; +- m_height = info->height; +- m_pitch = info->rowbytes; +- m_bpp = info->pixel_depth; ++ m_width = png_get_image_width(png, info); ++ m_height = png_get_image_height(png, info); ++ m_pitch = png_get_rowbytes(png, info); ++ m_bpp = png_get_bit_depth(png, info) * png_get_channels(png, info); + + // read file + if(setjmp(png_jmpbuf(png)) != 0) { +@@ -98,7 +98,7 @@ bool CFormatPng::Load(const char* filena + // create buffer and read data + png_bytep* row_pointers = new png_bytep[m_height]; + for(int y = 0; y < m_height; y++) { +- row_pointers[y] = new png_byte[info->rowbytes]; ++ row_pointers[y] = new png_byte[png_get_rowbytes(png, info)]; + } + png_read_image(png, row_pointers); + +@@ -106,7 +106,7 @@ bool CFormatPng::Load(const char* filena + m_sizeMem = m_pitch * m_height; + m_bitmap = new unsigned char[m_sizeMem]; + +- if(info->color_type == PNG_COLOR_TYPE_RGB) { ++ if(png_get_color_type(png, info) == PNG_COLOR_TYPE_RGB) { + m_format = GL_RGB; + for(int y = 0; y < m_height; y++) { + int dst = y * m_pitch; +@@ -123,7 +123,7 @@ bool CFormatPng::Load(const char* filena + delete[] row_pointers[y]; + } + } +- else if(info->color_type == PNG_COLOR_TYPE_RGB_ALPHA) { ++ else if(png_get_color_type(png, info) == PNG_COLOR_TYPE_RGB_ALPHA) { + m_format = GL_RGBA; + for(int y = 0; y < m_height; y++) { + int dst = y * m_pitch;