Fix T43831: Image Editor: Render info not displayed

Issue was caused by b62c2a9 and root of it goes to the fact that text
info is stored in the "main" scene, not the currently rendering one.

This is a bit annoying but making it so text and result are coming
from the same scene is a bit dangerous to do now. Will re-visit this
change after the release and see if it might be done in a more clear
fashion.
This commit is contained in:
2015-03-11 00:01:53 +05:00
parent 56c0a3faef
commit 26d7b6c517
4 changed files with 27 additions and 6 deletions

View File

@@ -68,6 +68,7 @@
#include "ED_gpencil.h"
#include "ED_image.h"
#include "ED_mask.h"
#include "ED_render.h"
#include "ED_screen.h"
#include "UI_interface.h"
@@ -79,20 +80,29 @@
#include "image_intern.h"
static void draw_render_info(Scene *scene, Image *ima, ARegion *ar, float zoomx, float zoomy)
static void draw_render_info(const bContext *C,
Scene *scene,
Image *ima,
ARegion *ar,
float zoomx,
float zoomy)
{
RenderResult *rr;
Render *re = RE_GetRender(scene->id.name);
RenderData *rd = RE_engine_get_render_data(re);
Scene *stats_scene = ED_render_job_get_scene(C);
if (stats_scene == NULL) {
stats_scene = CTX_data_scene(C);
}
rr = BKE_image_acquire_renderresult(scene, ima);
rr = BKE_image_acquire_renderresult(stats_scene, ima);
if (rr && rr->text) {
float fill_color[4] = {0.0f, 0.0f, 0.0f, 0.25f};
ED_region_info_draw(ar, rr->text, 1, fill_color);
}
BKE_image_release_renderresult(scene, ima);
BKE_image_release_renderresult(stats_scene, ima);
if (re) {
int total_tiles;
@@ -851,7 +861,7 @@ void draw_image_main(const bContext *C, ARegion *ar)
/* render info */
if (ima && show_render)
draw_render_info(sima->iuser.scene, ima, ar, zoomx, zoomy);
draw_render_info(C, sima->iuser.scene, ima, ar, zoomx, zoomy);
}
bool ED_space_image_show_cache(SpaceImage *sima)