[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [33289] trunk/blender/source/blender: Bugfix #24847

Ton Roosendaal ton at blender.org
Wed Nov 24 17:34:38 CET 2010


Revision: 33289
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=33289
Author:   ton
Date:     2010-11-24 17:34:38 +0100 (Wed, 24 Nov 2010)

Log Message:
-----------
Bugfix #24847

When report error was drawn in info header, using border select
or paint brushes flickered. Was caused by Triple Buffer method
not checking for correct redraw case.

Also made report redraws less aggressive, it was drawing the info
header all over with 50 FPS for 10 seconds. Made it 20 FPS, and 
added code to only send notifiers for actual changes.

As todo note for future: animated UI options could get better
caching to cope with slower refreshes.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_info/info_ops.c
    trunk/blender/source/blender/windowmanager/intern/wm_draw.c
    trunk/blender/source/blender/windowmanager/intern/wm_event_system.c

Modified: trunk/blender/source/blender/editors/space_info/info_ops.c
===================================================================
--- trunk/blender/source/blender/editors/space_info/info_ops.c	2010-11-24 15:57:59 UTC (rev 33288)
+++ trunk/blender/source/blender/editors/space_info/info_ops.c	2010-11-24 16:34:38 UTC (rev 33289)
@@ -312,7 +312,7 @@
 #define INFO_COLOR_TIMEOUT	3.0
 #define ERROR_TIMEOUT		10.0
 #define ERROR_COLOR_TIMEOUT	6.0
-#define COLLAPSE_TIMEOUT	0.2
+#define COLLAPSE_TIMEOUT	0.25
 static int update_reports_display_invoke(bContext *C, wmOperator *UNUSED(op), wmEvent *event)
 {
 	wmWindowManager *wm= CTX_wm_manager(C);
@@ -323,11 +323,12 @@
 	float neutral_col[3] = {0.35, 0.35, 0.35};
 	float neutral_grey= 0.6;
 	float timeout=0.0, color_timeout=0.0;
+	int send_note= 0;
 	
 	/* escape if not our timer */
 	if(reports->reporttimer==NULL || reports->reporttimer != event->customdata)
 		return OPERATOR_PASS_THROUGH;
-	
+
 	report= BKE_reports_last_displayable(reports);
 	rti = (ReportTimerInfo *)reports->reporttimer->customdata;
 	
@@ -366,17 +367,25 @@
 	progress = reports->reporttimer->duration / timeout;
 	color_progress = reports->reporttimer->duration / color_timeout;
 	
-	/* fade colours out sharply according to progress through fade-out duration */
-	interp_v3_v3v3(rti->col, rti->col, neutral_col, color_progress);
-	rti->greyscale = interpf(neutral_grey, rti->greyscale, color_progress);
+	/* save us from too many draws */
+	if(color_progress <= 1.0f) {
+		send_note= 1;
+		
+		/* fade colours out sharply according to progress through fade-out duration */
+		interp_v3_v3v3(rti->col, rti->col, neutral_col, color_progress);
+		rti->greyscale = interpf(neutral_grey, rti->greyscale, color_progress);
+	}
 
 	/* collapse report at end of timeout */
 	if (progress*timeout > timeout - COLLAPSE_TIMEOUT) {
 		rti->widthfac = (progress*timeout - (timeout - COLLAPSE_TIMEOUT)) / COLLAPSE_TIMEOUT;
 		rti->widthfac = 1.0 - rti->widthfac;
+		send_note= 1;
 	}
 	
-	WM_event_add_notifier(C, NC_SPACE|ND_SPACE_INFO, NULL);
+	if(send_note) {
+		WM_event_add_notifier(C, NC_SPACE|ND_SPACE_INFO, NULL);
+	}
 	
 	return (OPERATOR_FINISHED|OPERATOR_PASS_THROUGH);
 }

Modified: trunk/blender/source/blender/windowmanager/intern/wm_draw.c
===================================================================
--- trunk/blender/source/blender/windowmanager/intern/wm_draw.c	2010-11-24 15:57:59 UTC (rev 33288)
+++ trunk/blender/source/blender/windowmanager/intern/wm_draw.c	2010-11-24 16:34:38 UTC (rev 33289)
@@ -620,7 +620,8 @@
 		}
 	}
 
-	if(screen->do_draw_gesture)
+	/* always draw, not only when screen tagged */
+	if(win->gesture.first)
 		wm_gesture_draw(win);
 
 	if(wm->paintcursors.first) {

Modified: trunk/blender/source/blender/windowmanager/intern/wm_event_system.c
===================================================================
--- trunk/blender/source/blender/windowmanager/intern/wm_event_system.c	2010-11-24 15:57:59 UTC (rev 33288)
+++ trunk/blender/source/blender/windowmanager/intern/wm_event_system.c	2010-11-24 16:34:38 UTC (rev 33289)
@@ -426,7 +426,7 @@
 		WM_event_remove_timer(wm, NULL, reports->reporttimer);
 		
 		/* Records time since last report was added */
-		reports->reporttimer= WM_event_add_timer(wm, CTX_wm_window(C), TIMER, 0.02);
+		reports->reporttimer= WM_event_add_timer(wm, CTX_wm_window(C), TIMER, 0.05);
 		
 		rti = MEM_callocN(sizeof(ReportTimerInfo), "ReportTimerInfo");
 		reports->reporttimer->customdata = rti;





More information about the Bf-blender-cvs mailing list