[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [50175] branches/soc-2011-tomato/source/ blender/imbuf/intern/colormanagement.c: Color management: fix regression with updating image while painting

Sergey Sharybin sergey.vfx at gmail.com
Fri Aug 24 13:02:01 CEST 2012


Revision: 50175
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=50175
Author:   nazgul
Date:     2012-08-24 11:02:01 +0000 (Fri, 24 Aug 2012)
Log Message:
-----------
Color management: fix regression with updating image while painting

It'll update image properly but it seems it behaves slower then in trunk,
would investigate further.

Modified Paths:
--------------
    branches/soc-2011-tomato/source/blender/imbuf/intern/colormanagement.c

Modified: branches/soc-2011-tomato/source/blender/imbuf/intern/colormanagement.c
===================================================================
--- branches/soc-2011-tomato/source/blender/imbuf/intern/colormanagement.c	2012-08-24 09:45:42 UTC (rev 50174)
+++ branches/soc-2011-tomato/source/blender/imbuf/intern/colormanagement.c	2012-08-24 11:02:01 UTC (rev 50175)
@@ -1164,9 +1164,12 @@
 	 */
 	BLI_lock_thread(LOCK_COLORMANAGE);
 
-	if (ibuf->rect_float && (ibuf->rect == NULL || (ibuf->userflags & IB_RECT_INVALID)))
+	if (ibuf->rect_float && (ibuf->rect == NULL || (ibuf->userflags & IB_RECT_INVALID))) {
 		IMB_rect_from_float(ibuf);
 
+		ibuf->userflags &= ~IB_RECT_INVALID;
+	}
+
 	BLI_unlock_thread(LOCK_COLORMANAGE);
 }
 
@@ -1232,6 +1235,22 @@
 		ColormanageCacheViewSettings cache_view_settings;
 		ColormanageCacheDisplaySettings cache_display_settings;
 
+		if (ibuf->userflags & IB_RECT_INVALID) {
+			/* if byte buffer is marked as invalid, it means that float buffer was modified
+			 * and display buffer should be updated
+			 * mark all existing color managed display buffers as invalid, also free
+			 * legacy byte buffer to be sure all users would re-calculate display buffers
+			 * after removing RECT_INVALID flag
+			 */
+
+			IMB_display_buffer_invalidate(ibuf);
+
+			if (ibuf->rect)
+				imb_freerectImBuf(ibuf);
+
+			ibuf->userflags &= ~IB_RECT_INVALID;
+		}
+
 		colormanage_view_settings_to_cache(&cache_view_settings, view_settings);
 		colormanage_display_settings_to_cache(&cache_display_settings, display_settings);
 




More information about the Bf-blender-cvs mailing list