[packages/blender] - up to 2.80

baggins baggins at pld-linux.org
Sun Oct 13 11:45:42 CEST 2019


commit 4b097357045882f06db60e7078c4decfe9300a26
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Sun Oct 13 11:44:31 2019 +0200

    - up to 2.80

 blender-2.76-droid.patch |  21 ++--
 blender.desktop          |  12 ---
 blender.manpage          |  86 ----------------
 blender.png              | Bin 2135 -> 0 bytes
 blender.spec             |  58 ++++++-----
 ffmpeg4.patch            | 105 -------------------
 format-security.patch    |  10 ++
 gcc8.patch               |  22 ----
 oiio2.patch              | 258 -----------------------------------------------
 9 files changed, 46 insertions(+), 526 deletions(-)
---
diff --git a/blender.spec b/blender.spec
index 93d1691..54bb26a 100644
--- a/blender.spec
+++ b/blender.spec
@@ -4,45 +4,50 @@
 Summary:	3D modeling, rendering, animation and game creation package
 Summary(pl.UTF-8):	Pakiet do tworzenia animacji 3D oraz gier
 Name:		blender
-Version:	2.79b
-Release:	4
+Version:	2.80
+Release:	1
 License:	GPL
 Group:		X11/Applications/Graphics
 Source0:	http://download.blender.org/source/%{name}-%{version}.tar.gz
-# Source0-md5:	cef9a203857dc65076e05c41fc7a7d03
-Source1:	%{name}.desktop
-Source2:	%{name}.png
-Source3:	%{name}.manpage
+# Source0-md5:	30dedaf688741d0d5d6fa1e3c331610c
 Patch0:		%{name}-2.76-droid.patch
-Patch1:		ffmpeg4.patch
-Patch2:		gcc8.patch
-Patch3:		oiio2.patch
+Patch1:		format-security.patch
 URL:		http://www.blender.org/
 BuildRequires:	OpenAL-devel
+BuildRequires:	OpenColorIO-devel
 BuildRequires:	OpenEXR-devel
 BuildRequires:	OpenGL-devel
+BuildRequires:	OpenGL-GLU-devel
 BuildRequires:	OpenImageIO-devel
 BuildRequires:	SDL2-devel
+BuildRequires:	boost-devel
 BuildRequires:	cmake
-#BuildRequires:	esound-devel
 BuildRequires:	ffmpeg-devel >= 0.4.9-4.20080930.1
+BuildRequires:	fftw3-devel
 BuildRequires:	freealut-devel
 BuildRequires:	freetype-devel
 BuildRequires:	ftgl-devel
 BuildRequires:	gcc >= 5:3.4.0
 BuildRequires:	gettext-tools
+BuildRequires:	glew-devel
+BuildRequires:	jack-audio-connection-kit-devel
+BuildRequires:	jemalloc-devel
 BuildRequires:	libjpeg-devel
 BuildRequires:	libpng-devel
+BuildRequires:	libsndfile-devel
+BuildRequires:	libspnav-devel
 BuildRequires:	libstdc++-devel
 BuildRequires:	libtiff-devel
 BuildRequires:	libtool
 BuildRequires:	libvorbis-devel
+BuildRequires:	openjpeg2-devel
 BuildRequires:	openssl-devel >= 0.9.7d
+BuildRequires:	python3
 BuildRequires:	python3-devel
+BuildRequires:	python3-numpy-devel
 BuildRequires:	rpm-pythonprov
 BuildRequires:	rpmbuild(macros) >= 1.385
 BuildRequires:	sed >= 4.0
-#BuildRequires:	smpeg-devel
 BuildRequires:	xorg-lib-libXi-devel
 BuildRequires:	zlib-devel
 Requires(post,postun):	desktop-file-utils
@@ -66,20 +71,20 @@ Blender to darmowy i w pełni funkcjonalny pakiet do tworzenia animacji
 %setup -q
 %patch0 -p1
 %patch1 -p1
-%patch2 -p1
-%patch3 -p1
 
 %build
 install -d build
 cd build
 %cmake \
-	-DCMAKE_SKIP_RPATH=ON \
-	-DBUILD_SHARED_LIBS=OFF \
+	-DCMAKE_SKIP_RPATH:BOOL=ON \
+	-DBUILD_SHARED_LIBS:BOOL=OFF \
 	-DWITH_FFTW3:BOOL=ON \
 	-DWITH_JACK:BOOL=ON \
+	-DWITH_JACK_DYNLOAD:BOOL=ON \
 	-DWITH_CODEC_SNDFILE:BOOL=ON \
 	-DWITH_IMAGE_OPENJPEG:BOOL=ON \
 	-DWITH_OPENCOLLADA:BOOL=ON \
+	-DWITH_OPENCOLORIO:BOOL=ON \
 	-DWITH_CYCLES:BOOL=ON \
 	-DWITH_FFTW3:BOOL=ON \
 	-DWITH_MOD_OCEANSIM:BOOL=ON \
@@ -90,14 +95,15 @@ cd build
 	-DWITH_CODEC_FFMPEG:BOOL=ON \
 	-DWITH_GAMEENGINE:BOOL=ON \
 	-DWITH_CXX_GUARDEDALLOC:BOOL=OFF \
-	-DWITH_BUILTIN_GLEW=OFF \
-	-DWITH_INSTALL_PORTABLE=OFF \
-	-DWITH_PYTHON_SAFETY=ON \
-	-DWITH_PLAYER=ON \
-	-DWITH_MEM_JEMALLOC=ON \
+	-DWITH_INSTALL_PORTABLE:BOOL=OFF \
+	-DWITH_PYTHON_SAFETY:BOOL=ON \
+	-DWITH_PLAYER:BOOL=ON \
+	-DWITH_MEM_JEMALLOC:BOOL=ON \
+	-DWITH_SYSTEM_GLEW:BOOL=ON \
 	-DBOOST_ROOT=%{_prefix} \
-	-DWITH_INPUT_NDOF=ON \
+	-DWITH_INPUT_NDOF:BOOL=ON \
 	-DWITH_SDL:BOOL=ON \
+	-DWITH_SDL_DYNLOAD:BOOL=ON \
 	..
 
 %{__make} V=1
@@ -110,9 +116,7 @@ install -d $RPM_BUILD_ROOT{%{_desktopdir},%{_pixmapsdir},%{_mandir}/man1}
 %{__make} -C build install \
 	DESTDIR=$RPM_BUILD_ROOT
 
-cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_desktopdir}
-cp -p %{SOURCE2} $RPM_BUILD_ROOT%{_pixmapsdir}
-cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_mandir}/man1/blender.1
+./doc/manpage/blender.1.py $RPM_BUILD_ROOT%{_bindir}/blender $RPM_BUILD_ROOT%{_mandir}/man1/blender.1
 
 #%find_lang %{name}
 
@@ -131,10 +135,8 @@ rm -rf $RPM_BUILD_ROOT
 %doc doc/license/bf-members.txt doc/guides/*.txt
 %attr(755,root,root) %{_bindir}/blender
 %attr(755,root,root) %{_bindir}/blender-thumbnailer.py
-%attr(755,root,root) %{_bindir}/blenderplayer
 %attr(755,root,root) %{_datadir}/%{name}
 %{_desktopdir}/*.desktop
-%{_pixmapsdir}/*.png
-%{_iconsdir}/*/*x*/apps/blender.png
-%{_iconsdir}/*/scalable/apps/blender.svg
+%{_iconsdir}/hicolor/scalable/apps/blender.svg
+%{_iconsdir}/hicolor/symbolic/apps/blender-symbolic.svg
 %{_mandir}/man1/*
diff --git a/blender-2.76-droid.patch b/blender-2.76-droid.patch
index e351dbe..f485ddc 100644
--- a/blender-2.76-droid.patch
+++ b/blender-2.76-droid.patch
@@ -2,20 +2,11 @@ diff -uNr blender-2.76.orig/source/blender/blenfont/intern/blf_font_i18n.c blend
 --- blender-2.76.orig/source/blender/blenfont/intern/blf_font_i18n.c	2015-10-10 10:20:56.000000000 +0200
 +++ blender-2.76/source/blender/blenfont/intern/blf_font_i18n.c	2015-10-12 16:40:42.225473358 +0200
 @@ -57,7 +57,7 @@
- {
- #ifdef WITH_INTERNATIONAL
- 	if (unifont_ttf == NULL) {
--		const char * const fontpath = BKE_appdir_folder_id(BLENDER_DATAFILES, "fonts");
-+		const char * const fontpath = "/usr/share/fonts/blender";
- 		if (fontpath) {
- 			char unifont_path[1024];
  
-@@ -92,7 +92,7 @@
+ static void fontbuf_load(struct FontBuf *fb)
  {
- #ifdef WITH_INTERNATIONAL
- 	if (unifont_mono_ttf == NULL) {
--		const char *fontpath = BKE_appdir_folder_id(BLENDER_DATAFILES, "fonts");
-+		const char *fontpath = "/usr/share/fonts/blender";
- 		if (fontpath) {
- 			char unifont_path[1024];
- 
+-  const char *fontpath = BKE_appdir_folder_id(BLENDER_DATAFILES, "fonts");
++  const char *fontpath = "/usr/share/fonts/blender";
+   if (fontpath) {
+     char unifont_path[1024];
+     BLI_snprintf(unifont_path, sizeof(unifont_path), "%s/%s", fontpath, fb->filename);
diff --git a/blender.desktop b/blender.desktop
deleted file mode 100644
index 11ea184..0000000
--- a/blender.desktop
+++ /dev/null
@@ -1,12 +0,0 @@
-[Desktop Entry]
-Name=Blender
-Comment=3D modeling, rendering, animation and game creation package
-Comment[pl]=Pakiet do tworzenia animacji 3D oraz gier
-Exec=blender
-Terminal=false
-Type=Application
-Icon=blender
-StartupNotify=false
-Categories=Graphics;3DGraphics;
-MimeType=application/x-blender;
-# vi: encoding=utf-8
diff --git a/blender.manpage b/blender.manpage
deleted file mode 100644
index 7fe5619..0000000
--- a/blender.manpage
+++ /dev/null
@@ -1,86 +0,0 @@
-.TH BLENDER 1 "December  8, 1999"
-.SH NAME
-blender \- a 3D modelling and rendering package
-.SH SYNOPSIS
-.B blender [\-b <file>] [\-S <name>] [\-f <frame>] [\-s <frame>] [\-e <frame>] [\-a [<file(s)>] [\-m] [\-w] [\-H] [\-p <sx> <sy> <w> <h>] [\-f] [\-d] [\-h] [\-y]   
-
-
-.br
-.SH DESCRIPTION
-.PP
-\fBblender\fP is a 3D modelling and rendering package. It is the in-house software of a high quality animation studio, Blender has proven to be an extremely fast and versatile design instrument. The software has a personal touch, offering a unique approach to the world of Three Dimensions.
-Use Blender to create TV commercials, to make technical visualizations, business graphics, to do some morphing, or design user interfaces. You can easy build and manage complex environments. The renderer is versatile and extremely fast. All basic animation principles (curves & keys) are well implemented.
-
-http://www.blender3d.org
-.SH OPTIONS
-.B Render options:
-.br
-.br
-.B \-b <file>
-Render <file> in background
-.TP
-.B \-S <name>
-Set scene <name>
-.TP
-.B \-f <frame>
-Render frame <frame> and save it
-.TP
-.B \-s <frame>
-Set start to frame <frame> (use with -a)
-.TP
-.B \-e <frame>
-Set end to frame <frame> (use with -a)
-.TP
-.B \-a
-Render animation
-.TP
-.br
-.B Animation options:
-.TP
-.br
-.B \-a <file(s)>
-Playback <file(s)>
-.TP
-.B \-m
-Read from disk (Don't buffer)
-.TP
-.br
-.B Window options:
-.TP
-.br
-.B \-w
-Force opening with borders
-.TP
-.B \-H
-Patch for versions with hardware accelerated Mesa
-.TP
-.B \-p <sx> <sy> <w> <h>
-Open with lower left corner at <sx>, <sy> and width and height <w>, <h>
-.TP
-.br
-.B Misc options:
-.TP
-.br
-.B \-f
-Prevent forking in foreground mode
-.TP
-.B \-d
-Turn debugging on
-.TP
-.B \-h, 
-Show summary of options.
-.TP
-.B \-y
-Disable OnLoad scene scripts
-.br
-
-.SH SEE ALSO
-\fBpovray\fP(1)
-
-.br
-.SH AUTHOR
-Daniel Mester				<mester at uni-bremen.de>
-
-This manpage was written for a Debian GNU/Linux system.
-
-
diff --git a/blender.png b/blender.png
deleted file mode 100644
index 8339e06..0000000
Binary files a/blender.png and /dev/null differ
diff --git a/ffmpeg4.patch b/ffmpeg4.patch
deleted file mode 100644
index a60e35f..0000000
--- a/ffmpeg4.patch
+++ /dev/null
@@ -1,105 +0,0 @@
---- blender-2.78b/intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp~	2017-02-01 15:31:02.000000000 +0100
-+++ blender-2.78b/intern/audaspace/ffmpeg/AUD_FFMPEGReader.cpp	2018-04-29 09:24:32.089075737 +0200
-@@ -264,9 +264,9 @@
- 		m_membuffer(buffer),
- 		m_membufferpos(0)
- {
--	m_membuf = reinterpret_cast<data_t*>(av_malloc(FF_MIN_BUFFER_SIZE + FF_INPUT_BUFFER_PADDING_SIZE));
-+	m_membuf = reinterpret_cast<data_t*>(av_malloc(AV_INPUT_BUFFER_MIN_SIZE + AV_INPUT_BUFFER_PADDING_SIZE));
- 
--	m_aviocontext = avio_alloc_context(m_membuf, FF_MIN_BUFFER_SIZE, 0, this,
-+	m_aviocontext = avio_alloc_context(m_membuf, AV_INPUT_BUFFER_MIN_SIZE, 0, this,
- 									   read_packet, NULL, seek_packet);
- 
- 	if(!m_aviocontext)
---- blender-2.78b/intern/audaspace/ffmpeg/AUD_FFMPEGWriter.cpp~	2017-02-01 15:31:02.000000000 +0100
-+++ blender-2.78b/intern/audaspace/ffmpeg/AUD_FFMPEGWriter.cpp	2018-04-29 09:25:53.749932836 +0200
-@@ -163,7 +163,7 @@
- 		try
- 		{
- 			if(m_formatCtx->oformat->flags & AVFMT_GLOBALHEADER)
--				m_codecCtx->flags |= CODEC_FLAG_GLOBAL_HEADER;
-+				m_codecCtx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
- 
- 			AVCodec* codec = avcodec_find_encoder(m_codecCtx->codec_id);
- 			if(!codec)
-@@ -185,11 +185,11 @@
- 			if(avcodec_open2(m_codecCtx, codec, NULL))
- 				AUD_THROW(AUD_ERROR_FFMPEG, codec_error);
- 
--			m_output_buffer.resize(FF_MIN_BUFFER_SIZE);
-+			m_output_buffer.resize(AV_INPUT_BUFFER_MIN_SIZE);
- 			int samplesize = AUD_MAX(AUD_SAMPLE_SIZE(m_specs), AUD_DEVICE_SAMPLE_SIZE(m_specs));
- 
- 			if(m_codecCtx->frame_size <= 1) {
--				m_input_size = FF_MIN_BUFFER_SIZE * 8 / m_codecCtx->bits_per_coded_sample / m_codecCtx->channels;
-+				m_input_size = AV_INPUT_BUFFER_MIN_SIZE * 8 / m_codecCtx->bits_per_coded_sample / m_codecCtx->channels;
- 				m_input_buffer.resize(m_input_size * samplesize);
- 			}
- 			else
---- blender-2.78b/source/blender/blenkernel/intern/writeffmpeg.c~	2017-02-09 10:49:32.000000000 +0100
-+++ blender-2.78b/source/blender/blenkernel/intern/writeffmpeg.c	2018-04-29 09:33:21.568228587 +0200
-@@ -573,8 +573,6 @@
- 	c->rc_buffer_aggressivity = 1.0;
- #endif
- 
--	c->me_method = ME_EPZS;
--	
- 	codec = avcodec_find_encoder(c->codec_id);
- 	if (!codec)
- 		return NULL;
-@@ -636,14 +634,14 @@
- 	    )
- 	{
- 		PRINT("Using global header\n");
--		c->flags |= CODEC_FLAG_GLOBAL_HEADER;
-+		c->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
- 	}
- 	
- 	/* Determine whether we are encoding interlaced material or not */
- 	if (rd->mode & R_FIELDS) {
- 		PRINT("Encoding interlaced video\n");
--		c->flags |= CODEC_FLAG_INTERLACED_DCT;
--		c->flags |= CODEC_FLAG_INTERLACED_ME;
-+		c->flags |= AV_CODEC_FLAG_INTERLACED_DCT;
-+		c->flags |= AV_CODEC_FLAG_INTERLACED_ME;
- 	}
- 
- 	/* xasp & yasp got float lately... */
-@@ -732,7 +730,7 @@
- 	}
- 
- 	if (of->oformat->flags & AVFMT_GLOBALHEADER) {
--		c->flags |= CODEC_FLAG_GLOBAL_HEADER;
-+		c->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
- 	}
- 
- 	set_ffmpeg_properties(rd, c, "audio", &opts);
-@@ -751,14 +749,14 @@
- 	st->codec->time_base.den = st->codec->sample_rate;
- 
- #ifndef FFMPEG_HAVE_ENCODE_AUDIO2
--	context->audio_outbuf_size = FF_MIN_BUFFER_SIZE;
-+	context->audio_outbuf_size = AV_INPUT_BUFFER_MIN_SIZE;
- #endif
- 
- 	if (c->frame_size == 0)
- 		// used to be if ((c->codec_id >= CODEC_ID_PCM_S16LE) && (c->codec_id <= CODEC_ID_PCM_DVD))
- 		// not sure if that is needed anymore, so let's try out if there are any
- 		// complaints regarding some ffmpeg versions users might have
--		context->audio_input_samples = FF_MIN_BUFFER_SIZE * 8 / c->bits_per_coded_sample / c->channels;
-+		context->audio_input_samples = AV_INPUT_BUFFER_MIN_SIZE * 8 / c->bits_per_coded_sample / c->channels;
- 	else {
- 		context->audio_input_samples = c->frame_size;
- #ifndef FFMPEG_HAVE_ENCODE_AUDIO2
---- blender-2.78b/source/blender/imbuf/intern/indexer.c~	2017-02-01 15:31:02.000000000 +0100
-+++ blender-2.78b/source/blender/imbuf/intern/indexer.c	2018-04-29 09:36:08.866822011 +0200
-@@ -537,7 +537,7 @@
- 	av_opt_set_int(rv->c, "qmax", ffmpeg_quality, 0);
- 
- 	if (rv->of->flags & AVFMT_GLOBALHEADER) {
--		rv->c->flags |= CODEC_FLAG_GLOBAL_HEADER;
-+		rv->c->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
- 	}
- 
- 	if (avio_open(&rv->of->pb, fname, AVIO_FLAG_WRITE) < 0) {
diff --git a/format-security.patch b/format-security.patch
new file mode 100644
index 0000000..e8675b2
--- /dev/null
+++ b/format-security.patch
@@ -0,0 +1,10 @@
+--- blender-2.80/CMakeLists.txt~	2019-07-24 09:41:38.000000000 +0200
++++ blender-2.80/CMakeLists.txt	2019-10-13 10:58:34.903159798 +0200
+@@ -1460,7 +1460,6 @@
+   ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_UNUSED_FUNCTION         -Wno-unused-function)
+   ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_TYPE_LIMITS             -Wno-type-limits)
+   ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_INT_IN_BOOL_CONTEXT     -Wno-int-in-bool-context)
+-  ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_FORMAT                  -Wno-format)
+   ADD_CHECK_C_COMPILER_FLAG(C_REMOVE_STRICT_FLAGS C_WARN_NO_SWITCH                  -Wno-switch)
+ 
+   ADD_CHECK_CXX_COMPILER_FLAG(CXX_REMOVE_STRICT_FLAGS CXX_WARN_NO_CLASS_MEMACCESS     -Wno-class-memaccess)
diff --git a/gcc8.patch b/gcc8.patch
deleted file mode 100644
index c86d7f4..0000000
--- a/gcc8.patch
+++ /dev/null
@@ -1,22 +0,0 @@
---- blender-2.79b/intern/itasc/kdl/tree.hpp~	2018-03-23 16:22:25.000000000 +0100
-+++ blender-2.79b/intern/itasc/kdl/tree.hpp	2019-04-07 14:56:10.531752354 +0200
-@@ -34,7 +34,7 @@
-     //Forward declaration
-     class TreeElement;
-     // Eigen allocator is needed for alignment of Eigen data types
--    typedef std::map<std::string,TreeElement, std::less<std::string>, Eigen::aligned_allocator<std::pair<std::string, TreeElement> > > SegmentMap;
-+    typedef std::map<std::string,TreeElement, std::less<std::string>, Eigen::aligned_allocator<std::pair<const std::string, TreeElement> > > SegmentMap;
- 
-     class TreeElement
-     {
---- blender-2.79b/intern/cycles/util/util_sseb.h~	2018-03-23 16:22:25.000000000 +0100
-+++ blender-2.79b/intern/cycles/util/util_sseb.h	2019-04-07 15:00:05.901328020 +0200
-@@ -116,7 +116,7 @@
- __forceinline const sseb unpackhi( const sseb& a, const sseb& b ) { return _mm_unpackhi_ps(a, b); }
- 
- template<size_t i0, size_t i1, size_t i2, size_t i3> __forceinline const sseb shuffle( const sseb& a ) {
--	return _mm_shuffle_epi32(a, _MM_SHUFFLE(i3, i2, i1, i0));
-+	return _mm_castsi128_ps(_mm_shuffle_epi32(a, _MM_SHUFFLE(i3, i2, i1, i0)));
- }
- 
- template<> __forceinline const sseb shuffle<0, 1, 0, 1>( const sseb& a ) {
diff --git a/oiio2.patch b/oiio2.patch
deleted file mode 100644
index a85fddf..0000000
--- a/oiio2.patch
+++ /dev/null
@@ -1,258 +0,0 @@
---- a/intern/cycles/blender/blender_python.cpp
-+++ b/intern/cycles/blender/blender_python.cpp
-@@ -493,7 +493,7 @@ static PyObject *osl_update_node_func(Py
- 				socket_type = "NodeSocketString";
- 				data_type = BL::NodeSocket::type_STRING;
- 				if(param->validdefault)
--					default_string = param->sdefault[0];
-+					default_string = param->sdefault[0].string();
- 			}
- 			else
- 				continue;
---- a/intern/cycles/graph/node_xml.cpp
-+++ b/intern/cycles/graph/node_xml.cpp
-@@ -250,7 +250,7 @@ void xml_read_node(XMLReader& reader, No
- 		}
- 	}
- 
--	if(node->name)
-+	if(!node->name.empty())
- 		reader.node_map[node->name] = node;
- }
- 
---- a/intern/cycles/render/buffers.cpp
-+++ b/intern/cycles/render/buffers.cpp
-@@ -27,6 +27,7 @@
- #include "util/util_opengl.h"
- #include "util/util_time.h"
- #include "util/util_types.h"
-+#include "util/util_unique_ptr.h"
- 
- CCL_NAMESPACE_BEGIN
- 
-@@ -453,7 +454,7 @@ void DisplayBuffer::write(Device *device
- 	device->pixels_copy_from(rgba, 0, w, h);
- 
- 	/* write image */
--	ImageOutput *out = ImageOutput::create(filename);
-+	unique_ptr<ImageOutput> out(ImageOutput::create(filename));
- 	ImageSpec spec(w, h, 4, TypeDesc::UINT8);
- 	int scanlinesize = w*4*sizeof(uchar);
- 
-@@ -467,8 +468,6 @@ void DisplayBuffer::write(Device *device
- 		AutoStride);
- 
- 	out->close();
--
--	delete out;
- }
- 
- device_memory& DisplayBuffer::rgba_data()
---- a/intern/cycles/render/image.cpp
-+++ b/intern/cycles/render/image.cpp
-@@ -23,6 +23,7 @@
- #include "util/util_path.h"
- #include "util/util_progress.h"
- #include "util/util_texture.h"
-+#include "util/util_unique_ptr.h"
- 
- #ifdef WITH_OSL
- #include <OSL/oslexec.h>
-@@ -148,7 +149,7 @@ ImageDataType ImageManager::get_image_me
- 		return IMAGE_DATA_TYPE_BYTE4;
- 	}
- 
--	ImageInput *in = ImageInput::create(filename);
-+	unique_ptr<ImageInput> in(ImageInput::create(filename));
- 
- 	if(in) {
- 		ImageSpec spec;
-@@ -193,8 +194,6 @@ ImageDataType ImageManager::get_image_me
- 
- 			in->close();
- 		}
--
--		delete in;
- 	}
- 
- 	if(is_half) {
-@@ -449,7 +448,7 @@ void ImageManager::tag_reload_image(cons
- }
- 
- bool ImageManager::file_load_image_generic(Image *img,
--                                           ImageInput **in,
-+                                           unique_ptr<ImageInput> *in,
-                                            int &width,
-                                            int &height,
-                                            int &depth,
-@@ -465,7 +464,7 @@ bool ImageManager::file_load_image_gener
- 		}
- 
- 		/* load image from file through OIIO */
--		*in = ImageInput::create(img->filename);
-+		*in = unique_ptr<ImageInput>(ImageInput::create(img->filename));
- 
- 		if(!*in)
- 			return false;
-@@ -477,8 +476,6 @@ bool ImageManager::file_load_image_gener
- 			config.attribute("oiio:UnassociatedAlpha", 1);
- 
- 		if(!(*in)->open(img->filename, spec, config)) {
--			delete *in;
--			*in = NULL;
- 			return false;
- 		}
- 
-@@ -500,10 +497,7 @@ bool ImageManager::file_load_image_gener
- 	if(!(components >= 1 && components <= 4)) {
- 		if(*in) {
- 			(*in)->close();
--			delete *in;
--			*in = NULL;
- 		}
--
- 		return false;
- 	}
- 
-@@ -519,7 +513,7 @@ bool ImageManager::file_load_image(Image
-                                    device_vector<DeviceType>& tex_img)
- {
- 	const StorageType alpha_one = (FileFormat == TypeDesc::UINT8)? 255 : 1;
--	ImageInput *in = NULL;
-+	unique_ptr<ImageInput> in = NULL;
- 	int width, height, depth, components;
- 	if(!file_load_image_generic(img, &in, width, height, depth, components)) {
- 		return false;
-@@ -575,7 +569,6 @@ bool ImageManager::file_load_image(Image
- 		}
- 		cmyk = strcmp(in->format_name(), "jpeg") == 0 && components == 4;
- 		in->close();
--		delete in;
- 	}
- 	else {
- 		if(FileFormat == TypeDesc::FLOAT) {
---- a/intern/cycles/render/image.h
-+++ b/intern/cycles/render/image.h
-@@ -23,6 +23,7 @@
- #include "util/util_image.h"
- #include "util/util_string.h"
- #include "util/util_thread.h"
-+#include "util/util_unique_ptr.h"
- #include "util/util_vector.h"
- 
- CCL_NAMESPACE_BEGIN
-@@ -133,7 +134,7 @@ private:
- 	bool pack_images;
- 
- 	bool file_load_image_generic(Image *img,
--	                             ImageInput **in,
-+	                             unique_ptr<ImageInput> *in,
- 	                             int &width,
- 	                             int &height,
- 	                             int &depth,
---- /dev/null
-+++ b/intern/cycles/util/util_unique_ptr.h
-@@ -0,0 +1,28 @@
-+/*
-+ * Copyright 2011-2013 Blender Foundation
-+ *
-+ * Licensed under the Apache License, Version 2.0 (the "License");
-+ * you may not use this file except in compliance with the License.
-+ * You may obtain a copy of the License at
-+ *
-+ * http://www.apache.org/licenses/LICENSE-2.0
-+ *
-+ * Unless required by applicable law or agreed to in writing, software
-+ * distributed under the License is distributed on an "AS IS" BASIS,
-+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-+ * See the License for the specific language governing permissions and
-+ * limitations under the License.
-+ */
-+
-+#ifndef __UTIL_UNIQUE_PTR_H__
-+#define __UTIL_UNIQUE_PTR_H__
-+
-+#include <memory>
-+
-+CCL_NAMESPACE_BEGIN
-+
-+using std::unique_ptr;
-+
-+CCL_NAMESPACE_END
-+
-+#endif  /* __UTIL_UNIQUE_PTR_H__ */
---- a/source/blender/imbuf/intern/oiio/openimageio_api.cpp
-+++ b/source/blender/imbuf/intern/oiio/openimageio_api.cpp
-@@ -35,6 +35,11 @@
- #include "utfconv.h"
- #endif
- 
-+// NOTE: Keep first, BLI_path_util conflicts with OIIO's format.
-+#include <memory>
-+#include <openimageio_api.h>
-+#include <OpenImageIO/imageio.h>
-+
- extern "C"
- {
- #include "MEM_guardedalloc.h"
-@@ -48,12 +53,10 @@ extern "C"
- #include "IMB_colormanagement_intern.h"
- }
- 
--#include <openimageio_api.h>
--#include <OpenImageIO/imageio.h>
--
- OIIO_NAMESPACE_USING
- 
- using std::string;
-+using std::unique_ptr;
- 
- typedef unsigned char uchar;
- 
-@@ -197,7 +200,6 @@ int imb_save_photoshop(struct ImBuf *ibu
- 
- struct ImBuf *imb_load_photoshop(const char *filename, int flags, char colorspace[IM_MAX_SPACE])
- {
--	ImageInput *in = NULL;
- 	struct ImBuf *ibuf = NULL;
- 	int width, height, components;
- 	bool is_float, is_alpha;
-@@ -210,7 +212,7 @@ struct ImBuf *imb_load_photoshop(const c
- 
- 	colorspace_set_default_role(colorspace, IM_MAX_SPACE, COLOR_ROLE_DEFAULT_BYTE);
- 
--	in = ImageInput::create(filename);
-+	unique_ptr<ImageInput> in(ImageInput::create(filename));
- 	if (!in) {
- 		std::cerr << __func__ << ": ImageInput::create() failed:" << std::endl
- 		          << OIIO_NAMESPACE::geterror() << std::endl;
-@@ -223,7 +225,6 @@ struct ImBuf *imb_load_photoshop(const c
- 	if (!in->open(filename, spec, config)) {
- 		std::cerr << __func__ << ": ImageInput::open() failed:" << std::endl
- 		          << in->geterror() << std::endl;
--		delete in;
- 		return NULL;
- 	}
- 
-@@ -249,19 +250,17 @@ struct ImBuf *imb_load_photoshop(const c
- 	if (!(components >= 1 && components <= 4)) {
- 		if (in) {
- 			in->close();
--			delete in;
- 		}
- 		return NULL;
- 	}
- 
- 	if (is_float)
--		ibuf = imb_oiio_load_image_float(in, width, height, components, flags, is_alpha);
-+		ibuf = imb_oiio_load_image_float(in.get(), width, height, components, flags, is_alpha);
- 	else
--		ibuf = imb_oiio_load_image(in, width, height, components, flags, is_alpha);
-+		ibuf = imb_oiio_load_image(in.get(), width, height, components, flags, is_alpha);
- 
- 	if (in) {
- 		in->close();
--		delete in;
- 	}
- 
- 	if (!ibuf)
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/blender.git/commitdiff/4b097357045882f06db60e7078c4decfe9300a26



More information about the pld-cvs-commit mailing list