[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49667] branches/soc-2011-tomato: Merging r49659 through r49666 from trunk into soc-2011-tomato

Sergey Sharybin sergey.vfx at gmail.com
Tue Aug 7 18:48:43 CEST 2012


Revision: 49667
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49667
Author:   nazgul
Date:     2012-08-07 16:48:43 +0000 (Tue, 07 Aug 2012)
Log Message:
-----------
Merging r49659 through r49666 from trunk into soc-2011-tomato

Revision Links:
--------------
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49659
    http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49666

Modified Paths:
--------------
    branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_node.py
    branches/soc-2011-tomato/source/blender/blenkernel/intern/sequencer.c
    branches/soc-2011-tomato/source/blender/editors/space_node/node_intern.h
    branches/soc-2011-tomato/source/blender/editors/space_node/node_ops.c
    branches/soc-2011-tomato/source/blender/editors/space_node/node_view.c
    branches/soc-2011-tomato/source/blender/imbuf/IMB_imbuf.h
    branches/soc-2011-tomato/source/blender/imbuf/intern/imageprocess.c

Property Changed:
----------------
    branches/soc-2011-tomato/
    branches/soc-2011-tomato/source/blender/editors/interface/interface.c
    branches/soc-2011-tomato/source/blender/editors/space_outliner/


Property changes on: branches/soc-2011-tomato
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers:38694-39989
/trunk/blender:36831-49658
   + /branches/ge_harmony:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers:38694-39989
/trunk/blender:36831-49666

Modified: branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_node.py
===================================================================
--- branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_node.py	2012-08-07 16:47:46 UTC (rev 49666)
+++ branches/soc-2011-tomato/release/scripts/startup/bl_ui/space_node.py	2012-08-07 16:48:43 UTC (rev 49667)
@@ -115,6 +115,7 @@
 
         layout.separator()
 
+        layout.operator("node.view_selected")
         layout.operator("node.view_all")
 
         if context.space_data.show_backdrop:

Modified: branches/soc-2011-tomato/source/blender/blenkernel/intern/sequencer.c
===================================================================
--- branches/soc-2011-tomato/source/blender/blenkernel/intern/sequencer.c	2012-08-07 16:47:46 UTC (rev 49666)
+++ branches/soc-2011-tomato/source/blender/blenkernel/intern/sequencer.c	2012-08-07 16:48:43 UTC (rev 49667)
@@ -1577,12 +1577,12 @@
 	}
 }
 
-static void color_balance_byte_byte(Sequence *seq, ImBuf *ibuf, float mul)
+static void color_balance_byte_byte(Sequence *seq, unsigned char *rect, int width, int height, float mul)
 {
 	unsigned char cb_tab[3][256];
 	int c;
-	unsigned char *p = (unsigned char *) ibuf->rect;
-	unsigned char *e = p + ibuf->x * 4 * ibuf->y;
+	unsigned char *p = rect;
+	unsigned char *e = p + width * 4 * height;
 
 	StripColorBalance cb = calc_cb(seq->strip->color_balance);
 
@@ -1600,19 +1600,17 @@
 	}
 }
 
-static void color_balance_byte_float(Sequence *seq, ImBuf *ibuf, float mul)
+static void color_balance_byte_float(Sequence *seq, unsigned char *rect, float *rect_float, int width, int height, float mul)
 {
 	float cb_tab[4][256];
 	int c, i;
-	unsigned char *p = (unsigned char *) ibuf->rect;
-	unsigned char *e = p + ibuf->x * 4 * ibuf->y;
+	unsigned char *p = rect;
+	unsigned char *e = p + width * 4 * height;
 	float *o;
 	StripColorBalance cb;
 
-	imb_addrectfloatImBuf(ibuf);
+	o = rect_float;
 
-	o = ibuf->rect_float;
-
 	cb = calc_cb(seq->strip->color_balance);
 
 	for (c = 0; c < 3; c++) {
@@ -1633,10 +1631,10 @@
 	}
 }
 
-static void color_balance_float_float(Sequence *seq, ImBuf *ibuf, float mul)
+static void color_balance_float_float(Sequence *seq, float *rect_float, int width, int height, float mul)
 {
-	float *p = ibuf->rect_float;
-	float *e = ibuf->rect_float + ibuf->x * 4 * ibuf->y;
+	float *p = rect_float;
+	float *e = rect_float + width * 4 * height;
 	StripColorBalance cb = calc_cb(seq->strip->color_balance);
 
 	while (p < e) {
@@ -1648,19 +1646,99 @@
 	}
 }
 
-static void color_balance(Sequence *seq, ImBuf *ibuf, float mul)
+typedef struct ColorBalanceInitData {
+	Sequence *seq;
+	ImBuf *ibuf;
+	float mul;
+} ColorBalanceInitData;
+
+typedef struct ColorBalanceThread {
+	Sequence *seq;
+	float mul;
+
+	int width, height;
+
+	unsigned char *rect;
+	float *rect_float;
+} ColorBalanceThread;
+
+static void color_balance_init_handle(void *handle_v, int start_line, int tot_line, void *init_data_v)
 {
-	if (ibuf->rect_float) {
-		color_balance_float_float(seq, ibuf, mul);
+	ColorBalanceThread *handle = (ColorBalanceThread *) handle_v;
+	ColorBalanceInitData *init_data = (ColorBalanceInitData *) init_data_v;
+	ImBuf *ibuf = init_data->ibuf;
+
+	int offset = 4 * start_line * ibuf->x;
+
+	memset(handle, 0, sizeof(ColorBalanceThread));
+
+	handle->seq = init_data->seq;
+	handle->mul = init_data->mul;
+	handle->width = ibuf->x;
+	handle->height = tot_line;
+
+	if (ibuf->rect)
+		handle->rect = (unsigned char *) ibuf->rect + offset;
+
+	if (ibuf->rect_float)
+		handle->rect_float = ibuf->rect_float + offset;
+}
+
+static void *color_balance_do_thread(void *thread_data_v)
+{
+	ColorBalanceThread *thread_data = (ColorBalanceThread *) thread_data_v;
+	Sequence *seq = thread_data->seq;
+	int width = thread_data->width, height = thread_data->height;
+	unsigned char *rect = thread_data->rect;
+	float *rect_float = thread_data->rect_float;
+	float mul = thread_data->mul;
+
+	if (rect_float) {
+		color_balance_float_float(seq, rect_float, width, height, mul);
 	}
 	else if (seq->flag & SEQ_MAKE_FLOAT) {
-		color_balance_byte_float(seq, ibuf, mul);
+		color_balance_byte_float(seq, rect, rect_float, width, height, mul);
 	}
 	else {
-		color_balance_byte_byte(seq, ibuf, mul);
+		color_balance_byte_byte(seq, rect, width, height, mul);
 	}
+
+	return NULL;
 }
 
+static void color_balance(Sequence *seq, ImBuf *ibuf, float mul)
+{
+	if (!ibuf->rect_float && seq->flag & SEQ_MAKE_FLOAT)
+		imb_addrectfloatImBuf(ibuf);
+
+	if (BLI_thread_is_main()) {
+		/* color balance could have been called from prefetching job which
+		 * is already multithreaded, so doing threading here makes no sense
+		 */
+		ColorBalanceInitData init_data;
+
+		init_data.seq = seq;
+		init_data.ibuf = ibuf;
+		init_data.mul = mul;
+
+		IMB_processor_apply_threaded(ibuf->y, sizeof(ColorBalanceThread), &init_data,
+	                                 color_balance_init_handle, color_balance_do_thread);
+
+	}
+	else {
+		ColorBalanceThread handle;
+
+		handle.seq = seq;
+		handle.mul = mul;
+		handle.width = ibuf->x;
+		handle.height = ibuf->y;
+		handle.rect = (unsigned char *)ibuf->rect;
+		handle.rect_float = ibuf->rect_float;
+
+		color_balance_do_thread(&handle);
+}	}
+
+
 /*
  *  input preprocessing for SEQ_TYPE_IMAGE, SEQ_TYPE_MOVIE, SEQ_TYPE_MOVIECLIP and SEQ_TYPE_SCENE
  *


Property changes on: branches/soc-2011-tomato/source/blender/editors/interface/interface.c
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/ge_candy/source/blender/editors/interface/interface.c:45070-46163
/branches/ge_harmony/source/blender/editors/interface/interface.c:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber/source/blender/editors/interface/interface.c:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers/source/blender/editors/interface/interface.c:38694-39989
/trunk/blender/source/blender/editors/interface/interface.c:36831-49658
   + /branches/ge_candy/source/blender/editors/interface/interface.c:45070-46163
/branches/ge_harmony/source/blender/editors/interface/interface.c:42255,42279-42282,42286,42302,42338,42349,42616,42620,42698-42699,42739,42753,42773-42774,42832,44568,44597-44598,44793-44794
/branches/soc-2011-cucumber/source/blender/editors/interface/interface.c:37517,38166-38167,38177,38179-38180,38187,38242,38384,38387,38403-38404,38407,38968,38970,38973,39045,40845,42997-42998,43439
/branches/vgroup_modifiers/source/blender/editors/interface/interface.c:38694-39989
/trunk/blender/source/blender/editors/interface/interface.c:36831-49666

Modified: branches/soc-2011-tomato/source/blender/editors/space_node/node_intern.h
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/space_node/node_intern.h	2012-08-07 16:47:46 UTC (rev 49666)
+++ branches/soc-2011-tomato/source/blender/editors/space_node/node_intern.h	2012-08-07 16:48:43 UTC (rev 49667)
@@ -113,6 +113,7 @@
 
 /* node_view.c */
 void NODE_OT_view_all(struct wmOperatorType *ot);
+void NODE_OT_view_selected(struct wmOperatorType *ot);
 
 void NODE_OT_backimage_move(struct wmOperatorType *ot);
 void NODE_OT_backimage_zoom(struct wmOperatorType *ot);

Modified: branches/soc-2011-tomato/source/blender/editors/space_node/node_ops.c
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/space_node/node_ops.c	2012-08-07 16:47:46 UTC (rev 49666)
+++ branches/soc-2011-tomato/source/blender/editors/space_node/node_ops.c	2012-08-07 16:48:43 UTC (rev 49667)
@@ -60,6 +60,7 @@
 	WM_operatortype_append(NODE_OT_select_same_type_prev);
 
 	WM_operatortype_append(NODE_OT_view_all);
+	WM_operatortype_append(NODE_OT_view_selected);
 
 	WM_operatortype_append(NODE_OT_mute_toggle);
 	WM_operatortype_append(NODE_OT_hide_toggle);
@@ -255,6 +256,7 @@
 	WM_keymap_add_item(keymap, "NODE_OT_show_cyclic_dependencies", CKEY, KM_PRESS, 0, 0);
 	
 	WM_keymap_add_item(keymap, "NODE_OT_view_all", HOMEKEY, KM_PRESS, 0, 0);
+	WM_keymap_add_item(keymap, "NODE_OT_view_selected", PADPERIOD, KM_PRESS, 0, 0);
 
 	kmi = WM_keymap_add_item(keymap, "NODE_OT_select_border", BKEY, KM_PRESS, 0, 0);
 	RNA_boolean_set(kmi->ptr, "tweak", FALSE);

Modified: branches/soc-2011-tomato/source/blender/editors/space_node/node_view.c
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/space_node/node_view.c	2012-08-07 16:47:46 UTC (rev 49666)
+++ branches/soc-2011-tomato/source/blender/editors/space_node/node_view.c	2012-08-07 16:48:43 UTC (rev 49667)
@@ -60,54 +60,52 @@
 
 /* **************** View All Operator ************** */
 
-static void snode_home(ScrArea *UNUSED(sa), ARegion *ar, SpaceNode *snode)
+static int snode_home(ScrArea *UNUSED(sa), ARegion *ar, SpaceNode *snode, const int node_flag)
 {
 	bNode *node;
-	rctf *cur;
+	rctf cur_new;
 	float oldwidth, oldheight, width, height;
-	int first = 1;
+	int change = FALSE;
 	
-	cur = &ar->v2d.cur;
 	
-	oldwidth = cur->xmax - cur->xmin;
-	oldheight = cur->ymax - cur->ymin;
-	
-	cur->xmin = cur->ymin = 0.0f;
-	cur->xmax = ar->winx;
-	cur->ymax = ar->winy;
-	
+	oldwidth = ar->v2d.cur.xmax - ar->v2d.cur.xmin;
+	oldheight = ar->v2d.cur.ymax - ar->v2d.cur.ymin;
+
+	BLI_rctf_init_minmax(&cur_new);
+
 	if (snode->edittree) {

@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list