Commit Graph

9 Commits

Author SHA1 Message Date
Ell b6cb1d167c Bug 790631 - C plug-ins instability when processing gegl graphs ...
... with several threads

Commit d8ae581703 didn't go far
enough in protecting GimpTileBackendPlugin against race conditions.
The underlying GimpTile cache is shared across all drawables, so we
must use a common lock for all instances of GimpTileBackendPlugin,
instead of one per instance.

Do just that -- replace the per-instance mutex of
GimpTileBackendPlugin with a global one.  This makes
GimpTileBackendPlugin instances thread-safe w.r.t. themselves, and
w.r.t other GimpTileBackendPlugin instances.  However, we don't aim
to make GimpTileBackendPlugin thread-safe w.r.t. other libgimp
functions at this point, since the original API has never been
thread-safe.
2017-11-22 04:38:07 -05:00
Ell d8ae581703 libgimp: make GimpTileBackendPlugin thread safe
The entire libgimp tile code is not thread safe.  For now, do the
easy thing, and protect GimpTileBackendPlugin with a mutex.
2017-11-20 09:18:41 -05:00
Michael Natterer 1263552f24 libgimp: don't #define TILE_HEIGHT gimp_tile_width()
Fortunately, tile width and height were alyways the same.
2016-04-24 20:04:42 +02:00
Michael Natterer 7e17a1e42e libgimp: deprecate the entire legacy pixel fiddling api
which generates a gazillion warnings in plug-ins, a perfect guide
where to do porting.
2012-05-03 01:51:39 +02:00
Michael Natterer 3e0891b80c libgimp: sytle cleanup in GimpTileBackendPlugin
and use gimp_drawable_get_format() instead our own utility function.
2012-05-02 17:50:53 +02:00
Øyvind Kolås ee97c1f4ff app: correct usage of babl formats
GIMP was doing evil hacks lying to GEGL about it's pixels being in a linear
color space when they are not. This causes incorrect rendering, makes gaussian
blur misbehave etc.

The legacy projection modes should be implemented using the same 2.2 gamma
formats that are correct to specify for sRGB data. (for proper color
management in higher bitdepths; icc backend babl formats should be used.)

For the old image modes correct babl formats are:

R'G'B'A u8  -  8 bit RGB with 2.2 gamma (sRGB) with linear alpha component
R'G'B' u8   -  8 bit RGB with 2.2 gamma (sRGB)
Y'A u8      -  8 bit Grayscale with 2.2 gamma with linear alpha component
Y' u8       -  8 bit Grayscale with 2.2 gamma

Y u8        -  8 bit linear data, used for masks/channels
A u8        -  8 bit linear alpha

-----------------------------------------------

RGBA float  -     32bit floating point linear light RGB
RaGaBaA float  -  32bit floating point linear light RGB, premultiplied alpha
                  to be used for processing that needs to scale by the alpha,
                  (blurs, resampling etc)
R'G'B'A float  -  32bit floating point sRGB with gamma, to be used where
                  the result depends on being closer to perceptual when
                  processing, can be used a cheaper alternative to CIE Lab
                  based modes.

-----------------------------------------------

The legacy layer modes should use the formats with gamma 2.2 only for loading
and rendering legacy XCF files correctly, in the brave new world compositing
should most likely be done in linear light with "RGBA float" and even better
"RaGaBaA float" like GEGL does for porter duff and other compositing modes.

The ability to chose the legacy layer modes should probably be hidden from the
user unless an old .xcf has been opened.
2012-05-02 17:50:38 +02:00
Øyvind Kolås 2ff19d7087 libgimp: flush underlying drawable on gegl_buffer_flush 2012-05-02 17:46:08 +02:00
Michael Natterer efb82673de libgimp: make GimpTileBackendPlugin properly private, and some cleanup 2012-05-02 17:46:08 +02:00
Øyvind Kolås 4bdbff08d7 libgimp: add a GeglBuffer backend for plug-ins
Also added an API to get GeglBuffers for drawables, you choose whether you
get.
2012-05-02 17:46:08 +02:00