Refactor out using global resources singletons in KisPaintOpSettings
We cannot access global resource system while rendering the stroke in
a worker thread. Therefore, we should prepare all the resources in
advance, in GUI-thread, wrap them into a "server-like" storage and
then pass to the paintop itself
The patch does the following changes:
- KisPaintOpSettings now stores an internal link to "resources interface". Whenever the settings object wants to fetch a resource, e.g. in KisBrushBasedPaintOpSettings::paintOpSize(), it asks the resource interface about it.
- Before starting a stroke KisResourcesSnapshot does the following preparations (via KisPaintOpPreset::createLocalResourcesSnapshot()):
- Asks the paintop's factory about all the needed resources via (static) call to prepareResources().
- Wraps all these resources into KisLocalStrokeResources "fake" object.
- Sets this "fake" object as a resources source for KisPaintOpSettings object. Therefore, no global resources system will be accessed during the execution of the stroke.
- KoResource::load() and KoResource::loadFromDevice() now should also accept the resources interface. Obviously, the resources source for for KisPaintOpPreset should be set up right from the construction.