Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_image/image_draw.c
| Show First 20 Lines • Show All 77 Lines • ▼ Show 20 Lines | |||||
| #include "RE_pipeline.h" | #include "RE_pipeline.h" | ||||
| #include "image_intern.h" | #include "image_intern.h" | ||||
| static void draw_render_info( | static void draw_render_info( | ||||
| const bContext *C, Scene *scene, Image *ima, ARegion *region, float zoomx, float zoomy) | const bContext *C, Scene *scene, Image *ima, ARegion *region, float zoomx, float zoomy) | ||||
| { | { | ||||
| Render *re = RE_GetSceneRender(scene); | Render *re = RE_GetSceneRender(scene); | ||||
| RenderData *rd = RE_engine_get_render_data(re); | |||||
| Scene *stats_scene = ED_render_job_get_scene(C); | Scene *stats_scene = ED_render_job_get_scene(C); | ||||
| if (stats_scene == NULL) { | if (stats_scene == NULL) { | ||||
| stats_scene = CTX_data_scene(C); | stats_scene = CTX_data_scene(C); | ||||
| } | } | ||||
| RenderResult *rr = BKE_image_acquire_renderresult(stats_scene, ima); | RenderResult *rr = BKE_image_acquire_renderresult(stats_scene, ima); | ||||
| if (rr && rr->text) { | if (rr && rr->text) { | ||||
| Show All 12 Lines | if (total_tiles) { | ||||
| /* find window pixel coordinates of origin */ | /* find window pixel coordinates of origin */ | ||||
| int x, y; | int x, y; | ||||
| UI_view2d_view_to_region(®ion->v2d, 0.0f, 0.0f, &x, &y); | UI_view2d_view_to_region(®ion->v2d, 0.0f, 0.0f, &x, &y); | ||||
| GPU_matrix_push(); | GPU_matrix_push(); | ||||
| GPU_matrix_translate_2f(x, y); | GPU_matrix_translate_2f(x, y); | ||||
| GPU_matrix_scale_2f(zoomx, zoomy); | GPU_matrix_scale_2f(zoomx, zoomy); | ||||
| RenderData *rd = RE_engine_get_render_data(re); | |||||
| if (rd->mode & R_BORDER) { | if (rd->mode & R_BORDER) { | ||||
| /* TODO: round or floor instead of casting to int */ | /* TODO: round or floor instead of casting to int */ | ||||
| GPU_matrix_translate_2f((int)(-rd->border.xmin * rd->xsch * rd->size * 0.01f), | GPU_matrix_translate_2f((int)(-rd->border.xmin * rd->xsch * rd->size * 0.01f), | ||||
| (int)(-rd->border.ymin * rd->ysch * rd->size * 0.01f)); | (int)(-rd->border.ymin * rd->ysch * rd->size * 0.01f)); | ||||
| } | } | ||||
| uint pos = GPU_vertformat_attr_add( | uint pos = GPU_vertformat_attr_add( | ||||
| immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); | ||||
| ▲ Show 20 Lines • Show All 929 Lines • Show Last 20 Lines | |||||