Added WM Jobs manager
- WM can manage threaded jobs for you; just provide a couple
  of components to get it work:
  - customdata, free callback for it
  - timer step, notifier code
  - start callback, update callback
- Once started, each job runs an own timer, and will for
  every time step check necessary updates, or close the
  job when ready. 
- No drawing happens in jobs, that's for notifiers!
- Every job stores an owner pointer, and based on this owner
  it will prevent multiple jobs to enter the stack. 
  Instead it will re-use a running job, signal it to stop
  and allow caller to re-initialize it even.
- Check new wm_jobs.c for more explanation. Jobs API is still
  under construction. 
  Fun: BLI_addtail(&wm->jobs, steve); :)

Put Node shader previews back using wmJobs
- Preview calculating is now fully threaded (1 thread still)
- Thanks to new event system + notifiers, you can see 
  previews update even while dragging sliders!
- Currently it only starts when you change a node setting.

Warning: the thread render shares Node data, so don't delete
nodes while it renders! This topic is on the todo to make safe.

Also:
- bug in region initialize (do_versions) showed channel list in
  node editor wrong.
- flagged the channel list 'hidden' now, it was really in the
  way! This is for later to work on anyway. 
- recoded Render API callbacks so it gets handlers passed on, 
  no globals to use anymore, remember?
- previewrender code gets now so much nicer! Will remove a lot
  of stuff from code soon.
This commit is contained in:
2009-01-22 14:59:49 +00:00
parent a017982074
commit 9cc59fb0c3
38 changed files with 14714 additions and 254 deletions

View File

@@ -121,7 +121,7 @@ static void imagewindow_progress(ScrArea *sa, RenderResult *rr, volatile rcti *r
/* in render window; display a couple of scanlines of rendered image */
/* NOTE: called while render, so no malloc allowed! */
static void imagewindow_progress_display_cb(RenderResult *rr, volatile rcti *rect)
static void imagewindow_progress_display_cb(void *handle, RenderResult *rr, volatile rcti *rect)
{
if (image_area) {
imagewindow_progress(image_area, rr, rect);
@@ -132,7 +132,7 @@ static void imagewindow_progress_display_cb(RenderResult *rr, volatile rcti *rec
}
/* unused, init_display_cb is called on each render */
static void imagewindow_clear_display_cb(RenderResult *rr)
static void imagewindow_clear_display_cb(void *handle, RenderResult *rr)
{
if (image_area) {
}
@@ -257,7 +257,7 @@ static ScrArea *imagewindow_set_render_display(bContext *C)
return sa;
}
static void imagewindow_init_display_cb(RenderResult *rr)
static void imagewindow_init_display_cb(void *handle, RenderResult *rr)
{
bContext *C= NULL; // XXX
@@ -313,7 +313,7 @@ void imagewindow_toggle_render(bContext *C)
}
/* NOTE: called while render, so no malloc allowed! */
static void imagewindow_renderinfo_cb(RenderStats *rs)
static void imagewindow_renderinfo_cb(void *handle, RenderStats *rs)
{
if(image_area) {
// XXX BIF_make_render_text(rs);
@@ -327,9 +327,10 @@ static void imagewindow_renderinfo_cb(RenderStats *rs)
void imagewindow_render_callbacks(Render *re)
{
RE_display_init_cb(re, imagewindow_init_display_cb);
RE_display_draw_cb(re, imagewindow_progress_display_cb);
RE_display_clear_cb(re, imagewindow_clear_display_cb);
RE_stats_draw_cb(re, imagewindow_renderinfo_cb);
/* XXX fill in correct handler */
RE_display_init_cb(re, NULL, imagewindow_init_display_cb);
RE_display_draw_cb(re, NULL, imagewindow_progress_display_cb);
RE_display_clear_cb(re, NULL, imagewindow_clear_display_cb);
RE_stats_draw_cb(re, NULL, imagewindow_renderinfo_cb);
}