Avoid unnecessary update to main preview when opening first detail window, fixes #4368

This commit is contained in:
heckflosse 2018-02-05 16:01:00 +01:00
parent 06fedfdac7
commit 1f42e5cdd4
4 changed files with 30 additions and 3 deletions

View File

@ -90,7 +90,7 @@ ImProcCoordinator::ImProcCoordinator ()
pW (-1), pH (-1),
plistener (nullptr), imageListener (nullptr), aeListener (nullptr), acListener (nullptr), abwListener (nullptr), awbListener (nullptr), frameCountListener (nullptr), imageTypeListener (nullptr), actListener (nullptr), adnListener (nullptr), awavListener (nullptr), dehaListener (nullptr), hListener (nullptr),
resultValid (false), lastOutputProfile ("BADFOOD"), lastOutputIntent (RI__COUNT), lastOutputBPC (false), thread (nullptr), changeSinceLast (0), updaterRunning (false), destroying (false), utili (false), autili (false),
butili (false), ccutili (false), cclutili (false), clcutili (false), opautili (false), wavcontlutili (false), colourToningSatLimit (0.f), colourToningSatLimitOpacity (0.f)
butili (false), ccutili (false), cclutili (false), clcutili (false), opautili (false), wavcontlutili (false), colourToningSatLimit (0.f), colourToningSatLimitOpacity (0.f), highQualityComputed (false)
{}
void ImProcCoordinator::assign (ImageSource* imgsrc)
@ -1388,5 +1388,26 @@ void ImProcCoordinator::endUpdateParams (int changeFlags)
startProcessing ();
}
bool ImProcCoordinator::getHighQualComputed() {
// this function may only be called from detail windows
if(!highQualityComputed) {
if(options.prevdemo == PD_Sidecar) {
// we already have high quality preview
setHighQualComputed();
} else {
for (size_t i = 0; i < crops.size() - 1; ++i) { // -1, because last entry is the freshly created detail window
if (crops[i]->get_skip() == 1 ) { // there is at least one crop with skip == 1 => we already have high quality preview
setHighQualComputed();
break;
}
}
}
}
return highQualityComputed;
}
void ImProcCoordinator::setHighQualComputed() {
highQualityComputed = true;
}
}

View File

@ -212,6 +212,7 @@ protected:
void process ();
float colourToningSatLimit;
float colourToningSatLimitOpacity;
bool highQualityComputed;
public:
@ -266,7 +267,8 @@ public:
void getCamWB (double& temp, double& green);
void getSpotWB (int x, int y, int rectSize, double& temp, double& green);
void getAutoCrop (double ratio, int &x, int &y, int &w, int &h);
bool getHighQualComputed();
void setHighQualComputed();
void setMonitorProfile (const Glib::ustring& profile, RenderingIntent intent);
void getMonitorProfile (Glib::ustring& profile, RenderingIntent& intent) const;
void setSoftProofing (bool softProof, bool gamutCheck);

View File

@ -440,6 +440,9 @@ public:
* @return the height of the preview image */
virtual int getPreviewHeight () = 0;
virtual bool getHighQualComputed() = 0;
virtual void setHighQualComputed() = 0;
virtual bool updateTryLock() = 0;
virtual void updateUnLock() = 0;

View File

@ -505,8 +505,9 @@ void ImageArea::addCropWindow ()
mainCropWindow->setObservedCropWin (cropWins.front());
if(cropWins.size() == 1) { // after first detail window we already have high quality
if(!ipc->getHighQualComputed()) {
ipc->startProcessing(M_HIGHQUAL);
ipc->setHighQualComputed();
}
}