This from the AutomationFilter example causes Phohtoshop to redraw.
//-------------------------------------------------------------------- -----------
//
// AutomationFilterData::Redraw
//
// Tell Photoshop to redraw everything.
//
//-------------------------------------------------------------------- -----------
void AutomationFilterData::Redraw(void)
{
Auto_Desc descriptor;
Auto_Desc result(false);
AFERROR(sPSActionDescriptor->PutEnumerated(descriptor.get(), keyState, typeState, enumRedrawComplete));
(void)sPSActionControl->Play(&result, eventWait, descriptor.get(), plugInDialogSilent);
}
I'm looking for a way to tell Photoshop to postpone redrawing until I'm ready for it to start updating again.
The issue is that my plugin does LOTS of copying and pasting of layer data, and with Photoshop
redrawing after every command, the plugin can take minutes to finish even though the underlying
algorithm is finished in milliseconds.
The interesting thing is that on Mac it seems as if Photoshop redaws much less frequently than on
PC. I'll see a document with hundreds of layers complete in 10-15 sec on Mac where the PC would
take ~3 minutes on similarly capable hardware.
On Mac it seems to be drawing only as fast as it can keep up with the plugin's execution. On PC it
seems like somewhere the code example above is being called (it's not, I only show it for example)
and it's redrawing after every operation, and not moving on until the redraw is complete.
Any thoughts?