diff options
Diffstat (limited to 'source/blender/editors/space_image/image_draw.c')
-rw-r--r-- | source/blender/editors/space_image/image_draw.c | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c index cb942472b9e..bc07222c9fb 100644 --- a/source/blender/editors/space_image/image_draw.c +++ b/source/blender/editors/space_image/image_draw.c @@ -64,6 +64,8 @@ #include "WM_api.h" +#include "RE_pipeline.h" + #include "image_intern.h" #define HEADER_HEIGHT 18 @@ -90,37 +92,35 @@ static void image_verify_buffer_float(SpaceImage *sima, Image *ima, ImBuf *ibuf, } } -static void draw_render_info(Image *ima, ARegion *ar) +static void draw_render_info(Scene *scene, Image *ima, ARegion *ar) { + RenderResult *rr; rcti rect; float colf[3]; - int showspare= 0; // XXX BIF_show_render_spare(); - - if(ima->render_text==NULL) - return; - - rect= ar->winrct; - rect.xmin= 0; - rect.ymin= ar->winrct.ymax - ar->winrct.ymin - HEADER_HEIGHT; - rect.xmax= ar->winrct.xmax - ar->winrct.xmin; - rect.ymax= ar->winrct.ymax - ar->winrct.ymin; - - /* clear header rect */ - UI_GetThemeColor3fv(TH_BACK, colf); - glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); - glColor4f(colf[0]+0.1f, colf[1]+0.1f, colf[2]+0.1f, 0.5f); - glRecti(rect.xmin, rect.ymin, rect.xmax, rect.ymax+1); - glDisable(GL_BLEND); - UI_ThemeColor(TH_TEXT_HI); + rr= BKE_image_acquire_renderresult(scene, ima); + + if(rr->text) { + rect= ar->winrct; + rect.xmin= 0; + rect.ymin= ar->winrct.ymax - ar->winrct.ymin - HEADER_HEIGHT; + rect.xmax= ar->winrct.xmax - ar->winrct.xmin; + rect.ymax= ar->winrct.ymax - ar->winrct.ymin; + + /* clear header rect */ + UI_GetThemeColor3fv(TH_BACK, colf); + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); + glColor4f(colf[0]+0.1f, colf[1]+0.1f, colf[2]+0.1f, 0.5f); + glRecti(rect.xmin, rect.ymin, rect.xmax, rect.ymax+1); + glDisable(GL_BLEND); + + UI_ThemeColor(TH_TEXT_HI); - if(showspare) { - UI_DrawString(12, rect.ymin + 5, "(Previous)"); - UI_DrawString(72, rect.ymin + 5, ima->render_text); + UI_DrawString(12, rect.ymin + 5, rr->text); } - else - UI_DrawString(12, rect.ymin + 5, ima->render_text); + + BKE_image_release_renderresult(scene, ima); } void draw_image_info(ARegion *ar, int channels, int x, int y, char *cp, float *fp, int *zp, float *zpf) @@ -654,7 +654,7 @@ void draw_image_main(SpaceImage *sima, ARegion *ar, Scene *scene) /* render info */ if(ibuf && ima && show_render) - draw_render_info(ima, ar); + draw_render_info(scene, ima, ar); /* XXX integrate this code */ #if 0 |