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.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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]) {
|
||||
|
||||
Reference in New Issue
Block a user