[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [28891] branches/render25/source/blender: Render Branch: svn merge https://svn.blender.org/svnroot/bf-blender/trunk/ blender -r28888:28890 (sorry about the merge-noise)

Campbell Barton ideasman42 at gmail.com
Thu May 20 18:12:23 CEST 2010


Revision: 28891
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=28891
Author:   campbellbarton
Date:     2010-05-20 18:12:22 +0200 (Thu, 20 May 2010)

Log Message:
-----------
Render Branch: svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender  -r28888:28890 (sorry about the merge-noise)

Modified Paths:
--------------
    branches/render25/source/blender/editors/space_view3d/view3d_draw.c
    branches/render25/source/blender/gpu/GPU_draw.h
    branches/render25/source/blender/gpu/intern/gpu_draw.c

Modified: branches/render25/source/blender/editors/space_view3d/view3d_draw.c
===================================================================
--- branches/render25/source/blender/editors/space_view3d/view3d_draw.c	2010-05-20 16:08:06 UTC (rev 28890)
+++ branches/render25/source/blender/editors/space_view3d/view3d_draw.c	2010-05-20 16:12:22 UTC (rev 28891)
@@ -1965,8 +1965,11 @@
 
 	/* set flags */
 	G.f |= G_RENDER_OGL;
-	GPU_free_images();
 
+	/* free images which can have changed on frame-change
+	 * warning! can be slow so only free animated images - campbell */
+	GPU_free_images_anim();
+
 	/* set background color, fallback on the view background color */
 	if(scene->world) {
 		glClearColor(scene->world->horr, scene->world->horg, scene->world->horb, 0.0);
@@ -2030,7 +2033,8 @@
 	/* draw grease-pencil stuff - needed to get paint-buffer shown too (since it's 2D) */
 	draw_gpencil_view3d_ext(scene, ar, 0);
 
-	GPU_free_images();
+	/* freeing the images again here could be done after the operator runs, leaving for now */
+	GPU_free_images_anim();
 
 	/* restore size */
 	ar->winx= bwinx;

Modified: branches/render25/source/blender/gpu/GPU_draw.h
===================================================================
--- branches/render25/source/blender/gpu/GPU_draw.h	2010-05-20 16:08:06 UTC (rev 28890)
+++ branches/render25/source/blender/gpu/GPU_draw.h	2010-05-20 16:12:22 UTC (rev 28891)
@@ -117,6 +117,7 @@
 int GPU_verify_image(struct Image *ima, struct ImageUser *iuser, int tftile, int tfmode, int compare, int mipmap);
 void GPU_free_image(struct Image *ima);
 void GPU_free_images(void);
+void GPU_free_images_anim(void);
 
 /* smoke drawing functions */
 void GPU_free_smoke(struct SmokeModifierData *smd);

Modified: branches/render25/source/blender/gpu/intern/gpu_draw.c
===================================================================
--- branches/render25/source/blender/gpu/intern/gpu_draw.c	2010-05-20 16:08:06 UTC (rev 28890)
+++ branches/render25/source/blender/gpu/intern/gpu_draw.c	2010-05-20 16:12:22 UTC (rev 28891)
@@ -851,6 +851,17 @@
 			GPU_free_image(ima);
 }
 
+/* same as above but only free animated images */
+void GPU_free_images_anim(void)
+{
+	Image* ima;
+
+	if(G.main)
+		for(ima=G.main->image.first; ima; ima=ima->id.next)
+			if(ELEM(ima->type, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE))
+				GPU_free_image(ima);
+}
+
 /* OpenGL Materials */
 
 #define FIXEDMAT	8





More information about the Bf-blender-cvs mailing list