Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/space_image/image_draw.c')
-rw-r--r--source/blender/editors/space_image/image_draw.c26
1 files changed, 17 insertions, 9 deletions
diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c
index 27d2a19016d..016143f640b 100644
--- a/source/blender/editors/space_image/image_draw.c
+++ b/source/blender/editors/space_image/image_draw.c
@@ -74,9 +74,6 @@
#include "UI_resources.h"
#include "UI_view2d.h"
-#include "WM_api.h"
-#include "WM_types.h"
-
#include "RE_pipeline.h"
#include "RE_engine.h"
@@ -107,7 +104,7 @@ static void draw_render_info(Scene *scene, Image *ima, ARegion *ar, float zoomx,
rcti *tile;
/* find window pixel coordinates of origin */
- UI_view2d_to_region_no_clip(&ar->v2d, 0.0f, 0.0f, &x, &y);
+ UI_view2d_view_to_region(&ar->v2d, 0.0f, 0.0f, &x, &y);
glPushMatrix();
glTranslatef(x, y, 0.0f);
@@ -509,7 +506,7 @@ static void draw_image_buffer(const bContext *C, SpaceImage *sima, ARegion *ar,
glaDefine2DArea(&ar->winrct);
/* find window pixel coordinates of origin */
- UI_view2d_to_region_no_clip(&ar->v2d, fx, fy, &x, &y);
+ UI_view2d_view_to_region(&ar->v2d, fx, fy, &x, &y);
/* this part is generic image display */
if (sima->flag & SI_SHOW_ALPHA) {
@@ -600,7 +597,7 @@ static void draw_image_buffer_tiled(SpaceImage *sima, ARegion *ar, Scene *scene,
/* draw repeated */
for (sy = 0; sy + dy <= ibuf->y; sy += dy) {
for (sx = 0; sx + dx <= ibuf->x; sx += dx) {
- UI_view2d_to_region_no_clip(&ar->v2d, fx + (float)sx / (float)ibuf->x, fy + (float)sy / (float)ibuf->y, &x, &y);
+ UI_view2d_view_to_region(&ar->v2d, fx + (float)sx / (float)ibuf->x, fy + (float)sy / (float)ibuf->y, &x, &y);
glaDrawPixelsSafe(x, y, dx, dy, dx, GL_RGBA, GL_UNSIGNED_BYTE, rect);
}
@@ -779,7 +776,7 @@ static void draw_image_paint_helpers(const bContext *C, ARegion *ar, Scene *scen
clonerect = get_alpha_clone_image(C, scene, &w, &h);
if (clonerect) {
- UI_view2d_to_region_no_clip(&ar->v2d, brush->clone.offset[0], brush->clone.offset[1], &x, &y);
+ UI_view2d_view_to_region(&ar->v2d, brush->clone.offset[0], brush->clone.offset[1], &x, &y);
glPixelZoom(zoomx, zoomy);
@@ -885,7 +882,18 @@ void draw_image_main(const bContext *C, ARegion *ar)
/* render info */
if (ima && show_render)
- draw_render_info(scene, ima, ar, zoomx, zoomy);
+ draw_render_info(sima->iuser.scene, ima, ar, zoomx, zoomy);
+}
+
+static bool show_image_cache(Image *image, Mask *mask)
+{
+ if (image == NULL && mask == NULL) {
+ return false;
+ }
+ if (mask == NULL) {
+ return ELEM(image->source, IMA_SRC_SEQUENCE, IMA_SRC_MOVIE);
+ }
+ return true;
}
void draw_image_cache(const bContext *C, ARegion *ar)
@@ -900,7 +908,7 @@ void draw_image_cache(const bContext *C, ARegion *ar)
mask = ED_space_image_get_mask(sima);
}
- if (image == NULL && mask == NULL) {
+ if (!show_image_cache(image, mask)) {
return;
}