diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-04-24 23:21:16 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-04-24 23:21:16 +0400 |
commit | ee6932aa89c85aca06505f8e77af8a9d4100fdde (patch) | |
tree | 24c5a1c71d489356126545c959b86ac6cbfe822a /source/blender | |
parent | 04c8d8b919eca366cad8b6066e4842a88c91c969 (diff) |
Fix flickering black tiles in preview render, after viewport render commit, it's
nicer when the new preview draws over the old one.
The code was changed so that the render result is freed all the time because
freestyle manipulates render layers. Now it only does it when freestyle is
enabled so cycles and regular blender internal can still avoid it.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/render/intern/source/pipeline.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/source/blender/render/intern/source/pipeline.c b/source/blender/render/intern/source/pipeline.c index 0a92e09e664..8b74381acc2 100644 --- a/source/blender/render/intern/source/pipeline.c +++ b/source/blender/render/intern/source/pipeline.c @@ -463,6 +463,8 @@ void RE_FreePersistentData(void) /* disprect is optional, if NULL it assumes full window render */ void RE_InitState(Render *re, Render *source, RenderData *rd, SceneRenderLayer *srl, int winx, int winy, rcti *disprect) { + bool had_freestyle = (re->r.mode & R_EDGE_FRS); + re->ok = TRUE; /* maybe flag */ re->i.starttime = PIL_check_seconds_timer(); @@ -570,9 +572,22 @@ void RE_InitState(Render *re, Render *source, RenderData *rd, SceneRenderLayer * BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE); if (re->r.scemode & R_PREVIEWBUTS) { - /* always fresh, freestyle layers need it */ - render_result_free(re->result); - re->result = NULL; + if (had_freestyle || (re->r.mode & R_EDGE_FRS)) { + /* freestyle manipulates render layers so always have to free */ + render_result_free(re->result); + re->result = NULL; + } + else if (re->result) { + if (re->result->rectx == re->rectx && re->result->recty == re->recty) { + /* keep render result, this avoids flickering black tiles + * when the preview changes */ + } + else { + /* free because resolution changed */ + render_result_free(re->result); + re->result = NULL; + } + } } else { |