Bugfixing #4580 "RT 5.4 on Windows 8.1 x64 crashes while in editor"
Wrong placement of Mutex protecting the CropHandler's pixbufs in cropwindow.cc + mixup between cropPixbuf & cropPixbuftrue
This commit is contained in:
@@ -30,13 +30,13 @@ class Settings
|
|||||||
public:
|
public:
|
||||||
Glib::ustring iccDirectory; ///< The directory containing the possible output icc profiles
|
Glib::ustring iccDirectory; ///< The directory containing the possible output icc profiles
|
||||||
int viewingdevice; // white of output device (D50...D65..)
|
int viewingdevice; // white of output device (D50...D65..)
|
||||||
int viewingdevicegrey; // level of grey output device
|
int viewingdevicegrey; // level of grey output device
|
||||||
int viewinggreySc; // level of grey Scene
|
int viewinggreySc; // level of grey Scene
|
||||||
int leveldnv; // level of crop denoise
|
int leveldnv; // level of crop denoise
|
||||||
int leveldnti; // size of tiles denoise
|
int leveldnti; // size of tiles denoise
|
||||||
int leveldnaut; // level of auto denoise
|
int leveldnaut; // level of auto denoise
|
||||||
int leveldnliss; // level of auto multi zone
|
int leveldnliss; // level of auto multi zone
|
||||||
int leveldnautsimpl; // STD or EXPERT
|
int leveldnautsimpl; // STD or EXPERT
|
||||||
|
|
||||||
Glib::ustring printerProfile; ///< ICC profile name used for soft-proofing a printer output
|
Glib::ustring printerProfile; ///< ICC profile name used for soft-proofing a printer output
|
||||||
RenderingIntent printerIntent; ///< Colorimetric intent used with the above profile
|
RenderingIntent printerIntent; ///< Colorimetric intent used with the above profile
|
||||||
@@ -60,11 +60,12 @@ public:
|
|||||||
Glib::ustring bruce; // default name of Bruce
|
Glib::ustring bruce; // default name of Bruce
|
||||||
Glib::ustring srgb; // default name of SRGB space profile
|
Glib::ustring srgb; // default name of SRGB space profile
|
||||||
Glib::ustring srgb10; // default name of SRGB space profile
|
Glib::ustring srgb10; // default name of SRGB space profile
|
||||||
Glib::ustring rec2020; // default name of rec2020
|
Glib::ustring rec2020; // default name of rec2020
|
||||||
|
|
||||||
bool gamutICC; // no longer used
|
bool gamutICC; // no longer used
|
||||||
bool gamutLch;
|
bool gamutLch;
|
||||||
bool HistogramWorking;
|
bool HistogramWorking; // true: histogram is display the value of the image computed in the Working profile
|
||||||
|
// false: histogram is display the value of the image computed in the Output profile
|
||||||
int amchroma;
|
int amchroma;
|
||||||
int protectred;
|
int protectred;
|
||||||
double protectredh;
|
double protectredh;
|
||||||
|
@@ -97,8 +97,8 @@ public:
|
|||||||
|
|
||||||
rtengine::procparams::CropParams cropParams;
|
rtengine::procparams::CropParams cropParams;
|
||||||
rtengine::procparams::ColorManagementParams colorParams;
|
rtengine::procparams::ColorManagementParams colorParams;
|
||||||
Glib::RefPtr<Gdk::Pixbuf> cropPixbuf;
|
Glib::RefPtr<Gdk::Pixbuf> cropPixbuf; // image displayed on monitor, using the monitor profile (i.e. lab to monitor profile)
|
||||||
Glib::RefPtr<Gdk::Pixbuf> cropPixbuftrue;
|
Glib::RefPtr<Gdk::Pixbuf> cropPixbuftrue; // internal image in output color space for analysis (i.e. lab to either Working profile or Output profile, depending on options.rtSettings.HistogramWorking)
|
||||||
|
|
||||||
MyMutex cimg;
|
MyMutex cimg;
|
||||||
|
|
||||||
|
@@ -1007,6 +1007,8 @@ void CropWindow::pointerMoved (int bstate, int x, int y)
|
|||||||
int mx, my;
|
int mx, my;
|
||||||
screenCoordToImage (x, y, mx, my);
|
screenCoordToImage (x, y, mx, my);
|
||||||
|
|
||||||
|
MyMutex::MyLock lock(cropHandler.cimg);
|
||||||
|
|
||||||
if (!onArea (CropImage, x, y) || !cropHandler.cropPixbuf) {
|
if (!onArea (CropImage, x, y) || !cropHandler.cropPixbuf) {
|
||||||
cropHandler.getFullImageSize(mx, my);
|
cropHandler.getFullImageSize(mx, my);
|
||||||
// pmlistener->pointerMoved (false, cropHandler.colorParams.working, mx, my, -1, -1, -1);
|
// pmlistener->pointerMoved (false, cropHandler.colorParams.working, mx, my, -1, -1, -1);
|
||||||
@@ -1023,7 +1025,7 @@ void CropWindow::pointerMoved (int bstate, int x, int y)
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
/*MyMutex::MyLock lock(cropHandler.cimg);
|
/*
|
||||||
|
|
||||||
int vx = x - xpos - imgX;
|
int vx = x - xpos - imgX;
|
||||||
int vy = y - ypos - imgY;
|
int vy = y - ypos - imgY;
|
||||||
@@ -1033,7 +1035,6 @@ void CropWindow::pointerMoved (int bstate, int x, int y)
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
cropHandler.cimg.lock ();
|
|
||||||
int vx = x - xpos - imgX;
|
int vx = x - xpos - imgX;
|
||||||
int vy = y - ypos - imgY;
|
int vy = y - ypos - imgY;
|
||||||
|
|
||||||
@@ -1045,9 +1046,9 @@ void CropWindow::pointerMoved (int bstate, int x, int y)
|
|||||||
// guint8* pix = cropHandler.cropPixbuf->get_pixels() + vy*cropHandler.cropPixbuf->get_rowstride() + vx*3;
|
// guint8* pix = cropHandler.cropPixbuf->get_pixels() + vy*cropHandler.cropPixbuf->get_rowstride() + vx*3;
|
||||||
// if (vx < cropHandler.cropPixbuf->get_width() && vy < cropHandler.cropPixbuf->get_height())
|
// if (vx < cropHandler.cropPixbuf->get_width() && vy < cropHandler.cropPixbuf->get_height())
|
||||||
// pmlistener->pointerMoved (true, mx, my, pix[0], pix[1], pix[2]);
|
// pmlistener->pointerMoved (true, mx, my, pix[0], pix[1], pix[2]);
|
||||||
int imwidth = cropHandler.cropPixbuf->get_width();
|
int imwidth = cropHandler.cropPixbuftrue->get_width();
|
||||||
int imheight = cropHandler.cropPixbuf->get_height();
|
int imheight = cropHandler.cropPixbuftrue->get_height();
|
||||||
guint8* pix = cropHandler.cropPixbuftrue->get_pixels() + vy * cropHandler.cropPixbuf->get_rowstride() + vx * 3;
|
guint8* pix = cropHandler.cropPixbuftrue->get_pixels() + vy * cropHandler.cropPixbuftrue->get_rowstride() + vx * 3;
|
||||||
|
|
||||||
int rval = pix[0];
|
int rval = pix[0];
|
||||||
int gval = pix[1];
|
int gval = pix[1];
|
||||||
@@ -1062,17 +1063,16 @@ void CropWindow::pointerMoved (int bstate, int x, int y)
|
|||||||
isrc->getRawValues(mx, my, params.coarse.rotate, rval, gval, bval);
|
isrc->getRawValues(mx, my, params.coarse.rotate, rval, gval, bval);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// pmlistener->pointerMoved (true, cropHandler.colorParams.working, mx, my, pix[0], pix[1], pix[2]);
|
|
||||||
|
// Updates the Navigator
|
||||||
|
// TODO: possible double color conversion if rval, gval, bval come from cropHandler.cropPixbuftrue ? see issue #4583
|
||||||
pmlistener->pointerMoved (true, cropHandler.colorParams.output, cropHandler.colorParams.working, mx, my, rval, gval, bval);
|
pmlistener->pointerMoved (true, cropHandler.colorParams.output, cropHandler.colorParams.working, mx, my, rval, gval, bval);
|
||||||
|
|
||||||
if (pmhlistener)
|
if (pmhlistener) {
|
||||||
// pmhlistener->pointerMoved (true, cropHandler.colorParams.working, mx, my, pix[0], pix[1], pix[2]);
|
// Updates the HistogramRGBArea
|
||||||
{
|
pmhlistener->pointerMoved (true, cropHandler.colorParams.output, cropHandler.colorParams.working, mx, my, rval, gval, bval);
|
||||||
pmhlistener->pointerMoved (true, cropHandler.colorParams.output, cropHandler.colorParams.working, mx, my, pix[0], pix[1], pix[2]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
cropHandler.cimg.unlock ();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user