diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-03-27 18:35:34 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-03-27 18:35:34 +0300 |
commit | 57101c4fd26a85f4994d4d4d3f433c37f95367d0 (patch) | |
tree | 09d40feb19a41df0f32a05ff1975653f865b743e /source/blender/editors/space_image/image_draw.c | |
parent | 17777e7cd195318c36a1172647557447330dd3a4 (diff) |
Second attempt at committing the different render slot implementation. This
has a fix that hopefully solves the problem on mac/win. Also fixes #21322,
render slots not working well with FSA.
Diffstat (limited to 'source/blender/editors/space_image/image_draw.c')
-rw-r--r-- | source/blender/editors/space_image/image_draw.c | 59 |
1 files changed, 30 insertions, 29 deletions
diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c index 33dfc99602e..6b2693eb627 100644 --- a/source/blender/editors/space_image/image_draw.c +++ b/source/blender/editors/space_image/image_draw.c @@ -60,6 +60,8 @@ #include "UI_view2d.h" +#include "RE_pipeline.h" + #include "image_intern.h" #define HEADER_HEIGHT 18 @@ -86,37 +88,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 && 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) @@ -659,10 +659,7 @@ void draw_image_main(SpaceImage *sima, ARegion *ar, Scene *scene) /* paint helpers */ draw_image_paint_helpers(sima, ar, scene, zoomx, zoomy); - /* render info */ - if(ima && show_render) - draw_render_info(ima, ar); - + /* XXX integrate this code */ #if 0 if(ibuf) { @@ -681,5 +678,9 @@ void draw_image_main(SpaceImage *sima, ARegion *ar, Scene *scene) #endif ED_space_image_release_buffer(sima, lock); + + /* render info */ + if(ima && show_render) + draw_render_info(scene, ima, ar); } |