diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-05-09 00:21:31 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-05-09 00:21:31 +0400 |
commit | f8f4f73cc5e6dfdc2a4f8864a3e1edc2639e6fb2 (patch) | |
tree | 7c48925e16389e296a47d764b74c515794fc918a | |
parent | b43252079953e6eefad092927e578c80f695d788 (diff) |
Bug fix own collection:
- Recreate mipmaps if they're dirty when drawing background image
(this prevents "delayed" update of background image when you're paiting on it
in image editor).
- Mark mipmaps as dirty when inverting image channels.
TODO: there's memory leak caused by IMB_remakemipmap, but it'll be
anuther bugfix commit after discussion with other devs.
-rw-r--r-- | source/blender/editors/space_image/image_ops.c | 3 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_draw.c | 6 |
2 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index 13e855f60b1..17244a5251c 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -1423,6 +1423,9 @@ static int image_invert_exec(bContext *C, wmOperator *op) } ibuf->userflags |= IB_BITMAPDIRTY; + if(ibuf->mipmap[0]) + ibuf->userflags |= IB_MIPMAP_INVALID; + WM_event_add_notifier(C, NC_IMAGE|NA_EDITED, ima); return OPERATOR_FINISHED; } diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 1bbad6220ef..e967e8ed2e7 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -1317,7 +1317,11 @@ static void draw_bgpic(Scene *scene, ARegion *ar, View3D *v3d) float tzoom= MIN2(zoomx, zoomy); int mip= 0; - if(ibuf->mipmap[0]==NULL) + if((ibuf->userflags&IB_MIPMAP_INVALID) != 0) { + IMB_remakemipmap(ibuf, 0); + ibuf->userflags&= ~IB_MIPMAP_INVALID; + } + else if(ibuf->mipmap[0]==NULL) IMB_makemipmap(ibuf, 0); while(tzoom < 1.0f && mip<8 && ibuf->mipmap[mip]) { |