Commit Graph

28 Commits

Author SHA1 Message Date
Ell
3b0040c043 app, libgimp*, modules: don't use g_type_class_add_private() ...
... and G_TYPE_INSTANCE_GET_PRIVATE()

g_type_class_add_private() and G_TYPE_INSTANCE_GET_PRIVATE() were
deprecated in GLib 2.58.  Instead, use
G_DEFINE_[ABSTRACT_]TYPE_WITH_PRIVATE(), and
G_ADD_PRIVATE[_DYNAMIC](), and the implictly-defined
foo_get_instance_private() functions, all of which are available in
the GLib versions we depend on.

This commit only covers types registered using one of the
G_DEFINE_FOO() macros (i.e., most types), but not types with a
custom registration function, of which we still have a few -- GLib
currently only provides a (non-deprecated) public API for adding a
private struct using the G_DEFINE_FOO() macros.

Note that this commit was 99% auto-generated (because I'm not
*that* crazy :), so if there are any style mismatches... we'll have
to live with them for now.
2018-09-18 14:39:56 -04:00
Ell
2ac91e0fc3 Issue #1125 - Transform tools temporarily disables layer mask
In GimpCanvasTransformPreview, add the necessary bits to the
preview graph so that, when transforming a layer, the layer's
opacity and mask are correctly applied to the preview.  Note that
since we're still not rendering the preview as part of the image
graph, the output is not always accurate, but it should be good
enough in most cases.
2018-08-06 04:21:42 -04:00
5f700549e7 Change the license URL from http://www.gnu.org/licenses/ to https:// 2018-07-11 23:29:46 +02:00
Ell
d3a3c35317 Issue #1646 - Transform preview looks wrong with selection
In GimpCanvasTransformPreview, when the image mask is not empty,
make sure to align it with the drawable using a gegl:translate
node, before combining both at the gegl:opacity node.  Otherwise,
the mask is applied at the wrong offset when the drawable's offset
is not (0, 0).
2018-06-15 01:59:40 -04:00
Ell
5f58a7a260 app: pass near-plane z-coordinate to gegl:transform
... so that GEGL performs the same clipping we do.
2018-01-28 16:37:34 -05:00
Ell
9900573345 app: use gimp_transform_polygon() in GimpCanvasTransformPreview
... so that clipping is done properly.
2018-01-28 16:37:34 -05:00
8120694759 app: add include to fix a warning.
The build warning was:
> warning: implicit declaration of function ‘memcmp’ [-Wimplicit-function-declaration]
2018-01-21 17:31:57 +01:00
Ell
7f56393138 app: use GEGL for transform-tools preview
Before you get too exceited -- no, this commit doesn't integrate
transform previews into the image graph :)  We still use a
separate canvas-item overlay, just like before, but instead of
using an impromptu implementation to render the preview, we use
gegl:transform.  We properly adjust the matrix passed to the op
according to the display scale, so that we still render only as
much as needed.

This is both notably faster than the current code, and, for
perspective transforms, more accurate.
2018-01-15 14:58:23 -05:00
Ell
5d91657747 app: indentation fix to last commit 2017-11-14 11:34:32 -05:00
Ell
2e9ab59d19 app: use matrix to determine if doing perspective transform in preview
In GimpCanvasTransformPreview, use the transform matrix to
determine if we're doing a perspective transform, rather than
relying on a separate property, so that we don't use the slow
perspective path unnecessarily.

Consequently, remove the does_perspective member of
GimpTransformTool, since it's no longer used.
2017-11-14 11:24:56 -05:00
055ca325f2 app: manage the preview opacity with an object binding too 2017-06-19 23:39:37 +02:00
0add37a6cc app: remove GimpDisplayShell parameters from all GimpCanvasItem vfuncs
and get the shell from gimp_canvas_item_get_shell() if needed.  Remove
some cairo_translate() that didn't have any effect and were leftovers
from a very early canvas item code.
2013-04-18 16:46:01 +02:00
64c929a1d1 app: add an own GimpCanvasItem API for transforming coords
and use it in all subclasses. Removes all gimpdisplayshell-transform
dependency from all item implementations.
2013-04-18 16:46:00 +02:00
faf2217811 Bug 696958 - In-image preview in Transform tools is off by one screen pixel
Simplify the loops without any significant loss in performance, separating
the positive and negative X directions to treat each correctly. Fixes this
bug.
2013-04-02 17:23:40 +02:00
c83e7790bf app: Two mostly cosmetic changes
Use a temporary that is less expensive to refer to. Don't loop more
than necessary when comparing pairs.
2013-04-02 17:05:52 +02:00
cc916e4894 app: speed up GimpCanvasTransformPreview massively
by reading from the source buffers in their native format, and then
calling babl_process() on an entire line of pixels at once.
2012-06-07 00:50:58 +02:00
736eb26637 app: port GimpCanvasTransformPreview to gegl_buffer_sample() 2012-05-02 17:51:11 +02:00
d9f1a9eec6 app: Drop redundant assignment 2011-10-12 19:02:49 +05:30
6e4a5b1996 app (display): Drop redundant assignments 2011-10-11 10:29:55 +05:30
9f1187f6a5 app: Prefix TileManager functions
read_pixel_data() -> tile_manager_read_pixel_data()
write_pixel_data() -> tile_manager_write_pixel_data()
read_pixel_data_1() -> tile_manager_read_pixel_data_1()
write_pixel_data_1() -> tile_manager_write_pixel_data_1()

for consistency.
2011-09-07 12:08:43 +02:00
ea27c7bc83 app: add the MIN4() and MAX4() macros to gimp-utils.h
instead of having them in 5 .c files.
2011-06-04 17:16:21 +02:00
1371602383 app: call cairo_surface_flush before drawing directly 2011-05-26 20:17:08 +02:00
cc47b2a600 libgimpwidgets/color: move the cairo color utility functions to libgimpcolor
Add CAIRO_CFLAGS to a lot of Makefiles to make this possible, and
because they pull in cairo via the libgimp headers.
2011-04-28 15:50:39 +02:00
fde934ac58 app: s/GdkRectangle/cairo_rectangle_int_t/ in all GimpCanvasItems 2011-04-10 18:15:16 +02:00
eb4f01039a app: add utility function gimp_transform_polygon_is_convex()
and use it in GimpTransformTool and GimpCanvasTransformPreview.
2011-03-27 22:04:33 +02:00
8a09fd1f34 app: refactor GimpCanvasTransformPreview to not know GimpTransformTool any more
Instead, add drawable, transform, x1, y1 etc. properties. This is
cleaner and has the nice side effect of not leaving artifacts, because
the changed state of the transform tool doesn't affect the extents
calculation any longer.
2011-03-27 21:19:38 +02:00
1d9f95ac98 app: code cleanup and streamlining in GimpCanvasTransformPreview 2011-03-27 16:54:21 +02:00
f09be52c1b app: turn the transform preview into a GimpCanvasItem
And remove all the complicated handling code entirely. This makes
GimpTransformTool a lot less complex. As a nice side effect, the
preview is now always 100% in sync with the grid and handles.
2011-03-27 16:40:41 +02:00