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:
authorJeroen Bakker <jeroen@blender.org>2020-11-17 15:12:21 +0300
committerJeroen Bakker <jeroen@blender.org>2020-11-17 15:12:21 +0300
commit03ad2958d3ecc391105baf6c347031e87fa1f41c (patch)
treee581e13861f84f1fc8322a1fb091e89363cc39b9 /source/blender/editors/space_image
parent88de58fd1af9ffb1c6afcc53cf6279aadc51f58c (diff)
parent1e1c39fc89395c5e5a68a7a21500195cd8dc6fd5 (diff)
Merge branch 'blender-v2.91-release'
Diffstat (limited to 'source/blender/editors/space_image')
-rw-r--r--source/blender/editors/space_image/image_draw.c61
1 files changed, 5 insertions, 56 deletions
diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c
index 7934d600cf1..63e5ae64a8c 100644
--- a/source/blender/editors/space_image/image_draw.c
+++ b/source/blender/editors/space_image/image_draw.c
@@ -741,46 +741,6 @@ void draw_image_sample_line(SpaceImage *sima)
}
}
-static void draw_image_paint_helpers(
- const bContext *C, ARegion *region, Scene *scene, float zoomx, float zoomy)
-{
- Brush *brush;
- int x, y;
- ImBuf *ibuf;
-
- brush = BKE_paint_brush(&scene->toolsettings->imapaint.paint);
-
- if (brush && (brush->imagepaint_tool == PAINT_TOOL_CLONE) && brush->clone.image) {
- ibuf = BKE_image_acquire_ibuf(brush->clone.image, NULL, NULL);
-
- if (ibuf) {
- void *cache_handle = NULL;
- float col[4] = {1.0f, 1.0f, 1.0f, brush->clone.alpha};
- UI_view2d_view_to_region(
- &region->v2d, brush->clone.offset[0], brush->clone.offset[1], &x, &y);
-
- uchar *display_buffer = IMB_display_buffer_acquire_ctx(C, ibuf, &cache_handle);
-
- if (!display_buffer) {
- BKE_image_release_ibuf(brush->clone.image, ibuf, NULL);
- IMB_display_buffer_release(cache_handle);
- return;
- }
-
- GPU_blend(GPU_BLEND_ALPHA);
-
- IMMDrawPixelsTexState state = immDrawPixelsTexSetup(GPU_SHADER_2D_IMAGE_COLOR);
- immDrawPixelsTex(
- &state, x, y, ibuf->x, ibuf->y, GPU_RGBA8, false, display_buffer, zoomx, zoomy, col);
-
- GPU_blend(GPU_BLEND_NONE);
-
- BKE_image_release_ibuf(brush->clone.image, ibuf, NULL);
- IMB_display_buffer_release(cache_handle);
- }
- }
-}
-
static void draw_udim_tile_grid(uint pos_attr,
uint color_attr,
ARegion *region,
@@ -1007,24 +967,13 @@ void draw_image_main(const bContext *C, ARegion *region)
void draw_image_main_helpers(const bContext *C, ARegion *region)
{
SpaceImage *sima = CTX_wm_space_image(C);
- Scene *scene = CTX_data_scene(C);
- Image *ima;
- float zoomx, zoomy;
- bool show_viewer, show_render, show_paint;
+ Image *ima = ED_space_image(sima);
- ima = ED_space_image(sima);
- ED_space_image_get_zoom(sima, region, &zoomx, &zoomy);
-
- show_viewer = (ima && ima->source == IMA_SRC_VIEWER) != 0;
- show_render = (show_viewer && ima->type == IMA_TYPE_R_RESULT) != 0;
- show_paint = (ima && (sima->mode == SI_MODE_PAINT) && (show_viewer == false) &&
- (show_render == false));
- /* paint helpers */
- if (show_paint) {
- draw_image_paint_helpers(C, region, scene, zoomx, zoomy);
- }
- /* render info */
+ const bool show_viewer = (ima && ima->source == IMA_SRC_VIEWER) != 0;
+ const bool show_render = (show_viewer && ima->type == IMA_TYPE_R_RESULT) != 0;
if (ima && show_render) {
+ float zoomx, zoomy;
+ ED_space_image_get_zoom(sima, region, &zoomx, &zoomy);
draw_render_info(C, sima->iuser.scene, ima, region, zoomx, zoomy);
}
}