Commit Graph

769 Commits

Author SHA1 Message Date
Michael Natterer 021a49ce73 Add tile_manager_duplicate() which does quick tile-by-tile COW copy
and use it instead of duplicating the same code twice less efficiently.
2010-03-19 19:18:18 +01:00
Alexia Death 44a5a34d7e app: Make brush boundaries dynamic aswell 2010-03-15 02:55:15 +02:00
Martin Nordholts 98463cf081 app: Add get_backtrace() function to base-utils.[ch] 2010-02-25 18:02:04 +01:00
Michael Natterer 68ee4a5d6c base: add a proper version of the code that tracked down the tile manager leak
For GIMP_UNSTABLE, keep around a list of allocated tile managers and
have a function tile_manager_exit() which complains about them and
unrefs them. This is infinitely more helpful than the tile cache and
swap complaining about not being empty, because there is absolutely
nothing wrong with swap and cache when we simply leaked tile managers.
2010-02-10 12:33:30 +01:00
Martin Nordholts 8efb46bd0b app: Remove unused include #include <sys/types.h> in base/base.c 2009-12-21 17:25:01 +01:00
Michael Natterer 892363605c Random doc fix 2009-09-14 21:36:50 +02:00
Martin Nordholts 1dbf732943 app: Add temp_buf_dump()
Add temp_buf_dump() which can be used to dump TempBufs to disk for
easier analysis, for example with GIMP.
2009-08-14 19:23:01 +02:00
Mason Thomas fc66ca5169 Clamp levels after input changes applied. 2009-07-16 22:00:38 +02:00
Sven Neumann 8f37a96d70 only spit out debug output if TILE_PROFILING is defined 2009-06-04 12:15:07 +02:00
Sven Neumann b2fc6d2876 whitespace and coding style cleanups 2009-06-04 12:15:06 +02:00
Sven Neumann ac680f1cbd whitespace cleanup and removed inclusion of <sys/types.h> 2009-06-04 12:15:06 +02:00
Monty 717d8b4e56 Correct startup flaw in idle swapper start.
Check that the cache itself is idle. Previously it would start during
transforms and long pyramid rendering ops and toss writes and large
seeks into the tile cache while it was potentially under heavy pressure.

Also increase its flush rate more to be more in line with modern system
and editing needs.
2009-06-04 12:15:06 +02:00
Monty e925338321 Replace two list 'flush clean first' cache strategy with an LRU strategy.
Although the clean-first strategy gives fast light-load performance,
it also degrades catastrophically under moderate cache pressure. LRU is
not as efficient under light load, but degrades more gracefully under
moderate and heavy load.
2009-06-04 12:15:05 +02:00
Monty ac51a588d6 Add additional profiling to tile usage.
Add more profiling In order to analyze efficiency and behavior of the
tile cache. Profiling includes run-time indication of idle swapper
activity.

Also, fixes to original tile profiling code that appears to have
bitrotted some; it was no longer tracking changes made to tile memory
outside of tile.c.
2009-06-04 12:15:05 +02:00
Monty 2eaa777314 Optimize TILE_DATA_POINTER() macro
Minor change to TILE_DATA_POINTER that restricts TILE_WIDTH and
TILE_HEIGHT to powers of two, but eliminates two integer divisions
(or, in reality, eliminates the over-complicated assembly resulting
from optimizing out two integer divisions in a C compliant fashion).
2009-06-04 12:14:22 +02:00
Martin Nordholts 4d7a6b10d1 Added .gitignore files generated with git svn create-ignore.
svn path=/trunk/; revision=27972
2009-01-31 11:37:44 +00:00
Martin Nordholts d5b91835fd Bail out if we fail to create a dest buffer.
* app/base/temp-buf.c (temp_buf_copy): Bail out if we fail to
create a dest buffer.

svn path=/trunk/; revision=27946
2009-01-25 19:07:51 +00:00
Michael Natterer d9b5207aa2 Change licence to GPLv3 (and to LGPLv3 for libgimp).
2009-01-17  Michael Natterer  <mitch@gimp.org>

	* all files with a GPL header and all COPYING files:

	Change licence to GPLv3 (and to LGPLv3 for libgimp).

	Cleaned up some copyright headers and regenerated the parsers in
	the ImageMap plugin.


svn path=/trunk/; revision=27913
2009-01-17 22:28:01 +00:00
Sven Neumann c03759344b formatting.
2008-12-27  Sven Neumann  <sven@gimp.org>

	* app/base/pixel-surround.c (struct _PixelSurround): formatting.


svn path=/trunk/; revision=27834
2008-12-27 15:21:46 +00:00
Martin Nordholts 4cb231f53b Introduce temp_buf_get_data_size() and use it.
* app/base/temp-buf.[ch]
* app/widgets/gimpbrushselect.c
* app/widgets/gimppatternselect.c

svn path=/trunk/; revision=27783
2008-12-13 10:51:16 +00:00
Martin Nordholts ddaa0b48ec s/temp_buf_data/temp_buf_get_data/
* app/base/pixel-region.c
* app/base/temp-buf.c
* app/base/temp-buf.h
* app/core/gimpbrush-load.c
* app/core/gimpbrush-scale.c
* app/core/gimpbrush.c
* app/core/gimpbrushgenerated.c
* app/core/gimpgradient.c
* app/core/gimpimage.c
* app/core/gimppalette.c
* app/core/gimppattern-load.c
* app/core/gimppattern.c
* app/core/gimppreviewcache.c
* app/core/gimpviewable.c
* app/paint-funcs/paint-funcs-generic.h
* app/paint/gimpbrushcore.c
* app/paint/gimpclone.c
* app/paint/gimperaser.c
* app/paint/gimpheal.c
* app/paint/gimpink.c
* app/paint/gimppaintbrush.c
* app/pdb/brush-cmds.c
* app/pdb/brushes-cmds.c
* app/pdb/drawable-cmds.c
* app/pdb/image-cmds.c
* app/pdb/pattern-cmds.c
* app/pdb/patterns-cmds.c
* app/text/gimpfont.c
* app/tools/gimpiscissorstool.c
* app/vectors/gimpvectors-preview.c
* app/widgets/gimpbrushselect.c
* app/widgets/gimppatternselect.c
* app/widgets/gimpviewrenderer.c

svn path=/trunk/; revision=27782
2008-12-13 10:35:53 +00:00
Sven Neumann 02817081ff use NC_() to mark enum values for translation. Use a lower-case short form
2008-11-06  Sven Neumann  <sven@gimp.org>

	* tools/gimp-mkenums: use NC_() to mark enum values for 
translation.
	Use a lower-case short form of the type name as translation 
context.

	* libgimp/libgimp-intl.h: define the NC_() macro as noop.

	* libgimpbase/gimpbasetypes.[ch]
	* libgimpbase/gimpbase.def: added new functions to set and
	get a translation context on an enum type.

	* app/base/Makefile.am
	* app/core/Makefile.am
	* app/display/Makefile.am
	* app/paint/Makefile.am
	* app/plug-in/Makefile.am
	* app/text/Makefile.am
	* app/tools/Makefile.am
	* app/widgets/Makefile.am
	* libgimp/Makefile.am
	* libgimpbase/Makefile.am:
	* libgimpconfig/Makefile.am
	* libgimpthumb/Makefile.am
	* libgimpwidgets/Makefile.am: register the translation context
	with the enum types.

	* app/display/display-enums.h
	* libgimpbase/gimpbaseenums.h
	* libgimpconfig/gimpcolorconfig-enums.h: removed old-style 
explicit
	translation context.

	* app/base/base-enums.c
	* app/core/core-enums.c
	* app/display/display-enums.c
	* app/paint/paint-enums.c
	* app/plug-in/plug-in-enums.c
	* app/text/text-enums.c
	* app/tools/tools-enums.c
	* app/widgets/widgets-enums.c
	* libgimpbase/gimpbaseenums.c
	* libgimpconfig/gimpcolorconfig-enums.c
	* libgimpwidgets/gimpwidgetsenums.c: regenerated.


svn path=/trunk/; revision=27562
2008-11-06 08:28:28 +00:00
Sven Neumann b5ff19f743 reverted last change as the code in tile-pyramid does care about the pixel
2008-11-04  Sven Neumann  <sven@sven>

	* app/base/tile-pyramid.[ch] (tile_pyramid_new):
	* app/core/gimpprojection.c 
(gimp_projection_get_tiles_at_level):
	reverted last change as the code in tile-pyramid does care about
	the pixel format and it should continue to reject types that it
	cannot handle.


svn path=/trunk/; revision=27545
2008-11-04 09:07:38 +00:00
Michael Natterer 6f300a579c changed "type" parameter into "bytes" because tile managers don't care
2008-11-04  Michael Natterer  <mitch@gimp.org>

	* app/base/tile-pyramid.[ch] (tile_pyramid_new): changed "type"
	parameter into "bytes" because tile managers don't care about
	the pixel format of their tiles. Reordered parameters to match
	tile_manager_new().

	* app/core/gimpprojection.c (gimp_projection_get_tiles_at_level):
	pass the bytes instead of the image type.


svn path=/trunk/; revision=27544
2008-11-04 08:50:04 +00:00
Sven Neumann fe520925b7 app/base/Makefile.am app/core/Makefile.am app/display/Makefile.am
2008-11-03  Sven Neumann  <sven@gimp.org>

	
	* app/base/Makefile.am
	* app/core/Makefile.am
	* app/display/Makefile.am
	* app/paint/Makefile.am
	* app/plug-in/Makefile.am
	* app/text/Makefile.am
	* app/tools/Makefile.am
	* app/widgets/Makefile.am
	* libgimp/Makefile.am
	* libgimpbase/Makefile.am: 
	* libgimpconfig/Makefile.am
	* libgimpthumb/Makefile.am
	* libgimpwidgets/Makefile.am: micro-optimization in the 
generated
	enum registration code.

	* app/base/base-enums.c
	* app/core/core-enums.c
	* app/display/display-enums.c
	* app/paint/paint-enums.c
	* app/plug-in/plug-in-enums.c
	* app/text/text-enums.c
	* app/tools/tools-enums.c
	* app/widgets/widgets-enums.c
	* libgimpbase/gimpbaseenums.c
	* libgimpconfig/gimpcolorconfig-enums.c
	* libgimpwidgets/gimpwidgetsenums.c: regenerated.


svn path=/trunk/; revision=27538
2008-11-03 21:38:13 +00:00
Martin Nordholts e38ca5490a Rename the convenient channel offset defines from FOO_PIX to FOO as this
* app/base/base-types.h: Rename the convenient channel offset
defines from FOO_PIX to FOO as this increases readability.

* app/base/color-balance.c
* app/base/colorize.c
* app/base/desaturate.c
* app/base/hue-saturation.c
* app/base/siox.c
* app/base/threshold.c

* app/core/gimp-edit.c
* app/core/gimp-transform-region.c
* app/core/gimpchannel.c
* app/core/gimpdrawable-bucket-fill.c
* app/core/gimpdrawable-convert.c
* app/core/gimpdrawable-stroke.c
* app/core/gimpdrawable.c
* app/core/gimpimage-convert.c
* app/core/gimpimage.c
* app/core/gimppalette-import.c
* app/core/gimppickable.c

* app/gegl/gimpoperation*mode.c
* app/gegl/gimpoperationcolorbalance.c
* app/gegl/gimpoperationcolorize.c
* app/gegl/gimpoperationhuesaturation.c
* app/gegl/gimpoperationlevels.c
* app/gegl/gimpoperationposterize.c
* app/gegl/gimpoperationthreshold.c

* app/paint-funcs/subsample-region.c

* app/paint/gimpclone.c
* app/paint/gimppaintbrush.c

* app/widgets/gimpviewrenderer.c: Adapt.

svn path=/trunk/; revision=27324
2008-10-19 13:47:09 +00:00
Martin Nordholts bbbeb06973 There is nothing magic or ugly about the convenient defines, remove
* app/base/base-types.h: There is nothing magic or ugly about the
convenient defines, remove comments saying so.

svn path=/trunk/; revision=27322
2008-10-19 13:25:03 +00:00
Sven Neumann e069a226d5 use a GMutex instead of a GStaticMutex as the latter needs API that causes
2008-10-08  Sven Neumann  <sven@gimp.org>

	* app/base/tile-cache.c: use a GMutex instead of a GStaticMutex
	as the latter needs API that causes compiler warnings about
	dereferencing of type-punned pointers.


svn path=/trunk/; revision=27170
2008-10-08 07:33:29 +00:00
Michael Natterer 62e7dcc640 reorder sections consistently. Remove redundant CFLAGS.
2008-10-07  Michael Natterer  <mitch@gimp.org>

	* app/*/Makefile.am: reorder sections consistently. Remove
	redundant CFLAGS.


svn path=/trunk/; revision=27163
2008-10-07 11:58:14 +00:00
Hans Breuer d94419a9fd updated include <string.h> for memcmp() include <string.h> for strcmp()
2008-10-03  Hans Breuer  <hans@breuer.org>

	* **/makefie.msc gimpdefs.msc app/gimpcore.def : updated
	* app/core/gimpcurve.c : include <string.h> for memcmp()
	* app/gegl/gimpcurvesconfig.c : include <string.h> for strcmp()

svn path=/trunk/; revision=27118
2008-10-03 19:27:54 +00:00
Michael Natterer a3d0c68a70 fix calculation of final lookup table to not darken the image.
2008-09-25  Michael Natterer  <mitch@gimp.org>

	* app/base/colorize.c (colorize_calculate): fix calculation of
	final lookup table to not darken the image.


svn path=/trunk/; revision=27062
2008-09-25 18:14:05 +00:00
Tor Lillqvist b8f94b37b3 app/base/base-utils.h The return type of get_pid() should be gint, not
2008-09-04  Tor Lillqvist  <tml@novell.com>

	* app/base/base-utils.h
	* app/base/base-utils.c: The return type of get_pid() should be
	gint, not GPid. This matches also the C library on Windows, in
	which the return type of getpid() is int, not a pointer or
	intptr_t. The use for GPid in the GLib API is as a "handle" to a
	descendant processes, returned by the g_spawn_*() functions, and
	passed to the g_child_watch_*() functions, not as a "process
	identifier".


svn path=/trunk/; revision=26866
2008-09-04 17:54:06 +00:00
Sven Neumann a5f8345609 added clear_region().
2008-09-01  Sven Neumann  <sven@gimp.org>

	* app/paint-funcs/paint-funcs.[ch]: added clear_region().

	* app/base/tile-manager-crop.c
	* app/core/gimpchannel.c
	* app/core/gimpimage-merge.c
	* app/core/gimpmaskundo.c
	* app/core/gimpprojection-construct.c: use it instead of calling
	color_region() with a zero color.



svn path=/trunk/; revision=26826
2008-09-01 20:44:00 +00:00
Sven Neumann 6e764915d5 updated documentation.
2008-08-26  Sven Neumann  <sven@gimp.org>

	* app/base/pixel-surround.c: updated documentation.


svn path=/trunk/; revision=26783
2008-08-26 21:06:09 +00:00
Sven Neumann 55db28831c more fiddling with the edges
svn path=/trunk/; revision=26770
2008-08-26 07:41:53 +00:00
Sven Neumann 281cefc12d attempt to fix the newly introduced smear edge mode.
2008-08-26  Sven Neumann  <sven@gimp.org>

	* app/base/pixel-surround.c: attempt to fix the newly introduced
	smear edge mode.


svn path=/trunk/; revision=26769
2008-08-26 07:24:55 +00:00
Sven Neumann 972309fe48 changed to silently return in case of out-of-bounds access. There's code
2008-08-25  Sven Neumann  <sven@gimp.org>

	* app/base/tile-manager.c (read_pixel_data_1): changed to 
silently
	return in case of out-of-bounds access. There's code that relies
	on this.

	* app/base/pixel-surround.[ch]: added SMEAR as another edge
	strategy for the PixelSurround helper.

	* core/gimp-transform-region.c: changed accordingly.


svn path=/trunk/; revision=26767
2008-08-25 20:38:52 +00:00
Sven Neumann 3e5d269e59 provide a macro version of tile_data_pointer().
2008-08-25  Sven Neumann  <sven@gimp.org>

	* app/base/tile-private.h: provide a macro version of
	tile_data_pointer().

	* app/base/tile.c (tile_data_pointer): turned into a wrapper
	around the TILE_DATA_POINTER() macro.

	* app/base/tile-manager.c (read_pixel_data) (read_pixel_data_1)
	(write_pixel_data) (write_pixel_data_1): access tile struct
	members directly and use the new macro to access the tile data.


svn path=/trunk/; revision=26757
2008-08-25 13:00:28 +00:00
Sven Neumann 47afc75282 removed redundant check that is already performed by
2008-08-25  Sven Neumann  <sven@gimp.org>

	* app/base/tile-manager.c (read_pixel_data_1): removed redundant
	check that is already performed by tile_manager_get_tile_num().
	Warn if an out-of-bounds read is requested, instead of silently
	doing nothing.



svn path=/trunk/; revision=26755
2008-08-25 12:00:58 +00:00
Sven Neumann 9e163bb41b implement tile_manager_get_tile_coordinates() by calling
2008-08-08  Sven Neumann  <sven@gimp.org>

	* app/base/tile-manager.c: implement
	tile_manager_get_tile_coordinates() by calling
	tile_manager_get_tile_col_row() instead of the other way around.
	Saves two multiplications and divisions for each call of
	tile_manager_get_tile_col_row().


svn path=/trunk/; revision=26446
2008-08-08 11:33:18 +00:00
Sven Neumann 7f05996abc simplified tile_manager_map_tile()
svn path=/trunk/; revision=26439
2008-08-08 11:00:29 +00:00
Sven Neumann 576ea3cda1 whitespace fix
svn path=/trunk/; revision=26438
2008-08-08 10:57:38 +00:00
Sven Neumann c10f60e4c8 introduced utility function tile_manager_allocate_tiles() to avoid code
2008-08-08  Sven Neumann  <sven@gimp.org>

	* app/base/tile-manager.c: introduced utility function
	tile_manager_allocate_tiles() to avoid code duplication.


svn path=/trunk/; revision=26437
2008-08-08 10:55:46 +00:00
Sven Neumann 0d4b6aa33e improved a comment.
2008-08-08  Sven Neumann  <sven@gimp.org>

	* app/base/tile-pyramid.c: improved a comment.


svn path=/trunk/; revision=26436
2008-08-08 10:06:09 +00:00
Sven Neumann 1323200809 renamed a variable.
2008-08-07  Sven Neumann  <sven@gimp.org>

	* app/base/tile.c (tile_attach): renamed a variable.


svn path=/trunk/; revision=26428
2008-08-07 20:08:21 +00:00
Sven Neumann eb92ab8b22 fixed broken copy-on-write code. The old code did not insert the new tile
2008-08-07  Sven Neumann  <sven@gimp.org>

	* app/base/tile-manager.c (tile_manager_invalidate_tile): fixed
	broken copy-on-write code. The old code did not insert the new
	tile in the tile-manager's tile pointer array.

	(tile_manager_map): changed in a similar way as
	tile_manager_invalidate_tile(). This code was not broken, but it
	is easier to read now.

	* app/base/tile-private.h: moved a comment.

	* app/core/gimpselection.c (gimp_selection_extract): removed
	workaround for above bug.


svn path=/trunk/; revision=26419
2008-08-07 15:29:02 +00:00
Sven Neumann ae07d6218c app/base/tile-manager.h moved a misplaced comment to the right place.
2008-08-05  Sven Neumann  <sven@gimp.org>

	* app/base/tile-manager.h
	* app/base/tile-pyramid.h: moved a misplaced comment to the 
right
	place.


svn path=/trunk/; revision=26382
2008-08-05 15:10:47 +00:00
Sven Neumann 4368010863 added new method gimp_histogram_duplicate().
2008-07-22  Sven Neumann  <sven@gimp.org>

	* app/base/gimphistogram.[ch]: added new method
	gimp_histogram_duplicate().

	* app/widgets/gimphistogrameditor.c
	(gimp_histogram_editor_frozen_update): instead of recalculating
	the histogram, use a duplicate for the background histogram.


svn path=/trunk/; revision=26270
2008-07-22 09:29:35 +00:00
Sven Neumann c7a8fc98eb formatting, to improve readability.
2008-07-11  Sven Neumann  <sven@gimp.org>

	* app/base/color-balance.c (color_balance_create_lookup_tables):
	formatting, to improve readability.


svn path=/trunk/; revision=26115
2008-07-11 06:22:17 +00:00
Michael Natterer 2a064f55a6 remove PixelProcessorFunc typedef.
2008-05-21  Michael Natterer  <mitch@gimp.org>

	* app/base/pixel-processor.h: remove PixelProcessorFunc typedef.

	* app/base/base-types.h: add it here.

	* app/config/gimpbaseconfig.c: #include "base/base-types.h"

	* app/core/gimpdrawable-curves.c
	* app/core/gimpdrawable-desaturate.c
	* app/core/gimpdrawable-invert.c: remove pixel processor include.

	* app/core/gimpdrawable-levels.c: port to gimp_drawable_process().


svn path=/trunk/; revision=25738
2008-05-21 19:07:26 +00:00