Commit 4d7dbe23 authored by Michael Natterer's avatar Michael Natterer 😴

pdb: do the same optimization as in the transform tool in the commit below

parent 3ed87015
...@@ -26,8 +26,10 @@ ...@@ -26,8 +26,10 @@
#include "pdb-types.h" #include "pdb-types.h"
#include "core/gimp-transform-utils.h" #include "core/gimp-transform-utils.h"
#include "core/gimpchannel.h"
#include "core/gimpdrawable-transform.h" #include "core/gimpdrawable-transform.h"
#include "core/gimpdrawable.h" #include "core/gimpdrawable.h"
#include "core/gimpimage.h"
#include "core/gimpitem.h" #include "core/gimpitem.h"
#include "core/gimpparamspecs.h" #include "core/gimpparamspecs.h"
#include "core/gimpprogress.h" #include "core/gimpprogress.h"
...@@ -81,7 +83,8 @@ item_transform_flip_simple_invoker (GimpProcedure *procedure, ...@@ -81,7 +83,8 @@ item_transform_flip_simple_invoker (GimpProcedure *procedure,
flip_type, auto_center, &axis); flip_type, auto_center, &axis);
if (GIMP_IS_DRAWABLE (item) && if (GIMP_IS_DRAWABLE (item) &&
! gimp_viewable_get_children (GIMP_VIEWABLE (item))) ! gimp_viewable_get_children (GIMP_VIEWABLE (item)) &&
! gimp_channel_is_empty (gimp_image_get_mask (gimp_item_get_image (item))))
{ {
GimpDrawable *drawable; GimpDrawable *drawable;
...@@ -159,7 +162,8 @@ item_transform_flip_invoker (GimpProcedure *procedure, ...@@ -159,7 +162,8 @@ item_transform_flip_invoker (GimpProcedure *procedure,
gimp_progress_start (progress, _("Flipping"), FALSE); gimp_progress_start (progress, _("Flipping"), FALSE);
if (GIMP_IS_DRAWABLE (item) && if (GIMP_IS_DRAWABLE (item) &&
! gimp_viewable_get_children (GIMP_VIEWABLE (item))) ! gimp_viewable_get_children (GIMP_VIEWABLE (item)) &&
! gimp_channel_is_empty (gimp_image_get_mask (gimp_item_get_image (item))))
{ {
GimpDrawable *drawable; GimpDrawable *drawable;
...@@ -258,7 +262,8 @@ item_transform_perspective_invoker (GimpProcedure *procedure, ...@@ -258,7 +262,8 @@ item_transform_perspective_invoker (GimpProcedure *procedure,
gimp_progress_start (progress, _("Perspective"), FALSE); gimp_progress_start (progress, _("Perspective"), FALSE);
if (GIMP_IS_DRAWABLE (item) && if (GIMP_IS_DRAWABLE (item) &&
! gimp_viewable_get_children (GIMP_VIEWABLE (item))) ! gimp_viewable_get_children (GIMP_VIEWABLE (item)) &&
! gimp_channel_is_empty (gimp_image_get_mask (gimp_item_get_image (item))))
{ {
GimpDrawable *drawable; GimpDrawable *drawable;
...@@ -341,7 +346,8 @@ item_transform_rotate_simple_invoker (GimpProcedure *procedure, ...@@ -341,7 +346,8 @@ item_transform_rotate_simple_invoker (GimpProcedure *procedure,
auto_center, &center_x, &center_y); auto_center, &center_x, &center_y);
if (GIMP_IS_DRAWABLE (item) && if (GIMP_IS_DRAWABLE (item) &&
! gimp_viewable_get_children (GIMP_VIEWABLE (item))) ! gimp_viewable_get_children (GIMP_VIEWABLE (item)) &&
! gimp_channel_is_empty (gimp_image_get_mask (gimp_item_get_image (item))))
{ {
GimpDrawable *drawable; GimpDrawable *drawable;
...@@ -427,7 +433,8 @@ item_transform_rotate_invoker (GimpProcedure *procedure, ...@@ -427,7 +433,8 @@ item_transform_rotate_invoker (GimpProcedure *procedure,
gimp_progress_start (progress, _("Rotating"), FALSE); gimp_progress_start (progress, _("Rotating"), FALSE);
if (GIMP_IS_DRAWABLE (item) && if (GIMP_IS_DRAWABLE (item) &&
! gimp_viewable_get_children (GIMP_VIEWABLE (item))) ! gimp_viewable_get_children (GIMP_VIEWABLE (item)) &&
! gimp_channel_is_empty (gimp_image_get_mask (gimp_item_get_image (item))))
{ {
GimpDrawable *drawable; GimpDrawable *drawable;
...@@ -517,7 +524,8 @@ item_transform_scale_invoker (GimpProcedure *procedure, ...@@ -517,7 +524,8 @@ item_transform_scale_invoker (GimpProcedure *procedure,
gimp_progress_start (progress, _("Scaling"), FALSE); gimp_progress_start (progress, _("Scaling"), FALSE);
if (GIMP_IS_DRAWABLE (item) && if (GIMP_IS_DRAWABLE (item) &&
! gimp_viewable_get_children (GIMP_VIEWABLE (item))) ! gimp_viewable_get_children (GIMP_VIEWABLE (item)) &&
! gimp_channel_is_empty (gimp_image_get_mask (gimp_item_get_image (item))))
{ {
GimpDrawable *drawable; GimpDrawable *drawable;
...@@ -603,7 +611,8 @@ item_transform_shear_invoker (GimpProcedure *procedure, ...@@ -603,7 +611,8 @@ item_transform_shear_invoker (GimpProcedure *procedure,
gimp_progress_start (progress, _("Shearing"), FALSE); gimp_progress_start (progress, _("Shearing"), FALSE);
if (GIMP_IS_DRAWABLE (item) && if (GIMP_IS_DRAWABLE (item) &&
! gimp_viewable_get_children (GIMP_VIEWABLE (item))) ! gimp_viewable_get_children (GIMP_VIEWABLE (item)) &&
! gimp_channel_is_empty (gimp_image_get_mask (gimp_item_get_image (item))))
{ {
GimpDrawable *drawable; GimpDrawable *drawable;
...@@ -700,7 +709,8 @@ item_transform_2d_invoker (GimpProcedure *procedure, ...@@ -700,7 +709,8 @@ item_transform_2d_invoker (GimpProcedure *procedure,
gimp_progress_start (progress, _("2D Transform"), FALSE); gimp_progress_start (progress, _("2D Transform"), FALSE);
if (GIMP_IS_DRAWABLE (item) && if (GIMP_IS_DRAWABLE (item) &&
! gimp_viewable_get_children (GIMP_VIEWABLE (item))) ! gimp_viewable_get_children (GIMP_VIEWABLE (item)) &&
! gimp_channel_is_empty (gimp_image_get_mask (gimp_item_get_image (item))))
{ {
GimpDrawable *drawable; GimpDrawable *drawable;
...@@ -805,7 +815,8 @@ item_transform_matrix_invoker (GimpProcedure *procedure, ...@@ -805,7 +815,8 @@ item_transform_matrix_invoker (GimpProcedure *procedure,
gimp_progress_start (progress, _("2D Transforming"), FALSE); gimp_progress_start (progress, _("2D Transforming"), FALSE);
if (GIMP_IS_DRAWABLE (item) && if (GIMP_IS_DRAWABLE (item) &&
! gimp_viewable_get_children (GIMP_VIEWABLE (item))) ! gimp_viewable_get_children (GIMP_VIEWABLE (item)) &&
! gimp_channel_is_empty (gimp_image_get_mask (gimp_item_get_image (item))))
{ {
GimpDrawable *drawable; GimpDrawable *drawable;
......
...@@ -53,7 +53,8 @@ $assemble_matrix ...@@ -53,7 +53,8 @@ $assemble_matrix
gimp_progress_start (progress, _(\"$progress_text\"), FALSE); gimp_progress_start (progress, _(\"$progress_text\"), FALSE);
if (GIMP_IS_DRAWABLE (item) && if (GIMP_IS_DRAWABLE (item) &&
! gimp_viewable_get_children (GIMP_VIEWABLE (item))) ! gimp_viewable_get_children (GIMP_VIEWABLE (item)) &&
! gimp_channel_is_empty (gimp_image_get_mask (gimp_item_get_image (item))))
{ {
GimpDrawable *drawable; GimpDrawable *drawable;
...@@ -150,7 +151,8 @@ HELP ...@@ -150,7 +151,8 @@ HELP
flip_type, auto_center, &axis); flip_type, auto_center, &axis);
if (GIMP_IS_DRAWABLE (item) && if (GIMP_IS_DRAWABLE (item) &&
! gimp_viewable_get_children (GIMP_VIEWABLE (item))) ! gimp_viewable_get_children (GIMP_VIEWABLE (item)) &&
! gimp_channel_is_empty (gimp_image_get_mask (gimp_item_get_image (item))))
{ {
GimpDrawable *drawable; GimpDrawable *drawable;
...@@ -356,7 +358,8 @@ HELP ...@@ -356,7 +358,8 @@ HELP
auto_center, &center_x, &center_y); auto_center, &center_x, &center_y);
if (GIMP_IS_DRAWABLE (item) && if (GIMP_IS_DRAWABLE (item) &&
! gimp_viewable_get_children (GIMP_VIEWABLE (item))) ! gimp_viewable_get_children (GIMP_VIEWABLE (item)) &&
! gimp_channel_is_empty (gimp_image_get_mask (gimp_item_get_image (item))))
{ {
GimpDrawable *drawable; GimpDrawable *drawable;
...@@ -657,8 +660,10 @@ CODE ...@@ -657,8 +660,10 @@ CODE
@headers = qw("libgimpmath/gimpmath.h" @headers = qw("libgimpmath/gimpmath.h"
"core/gimp-transform-utils.h" "core/gimp-transform-utils.h"
"core/gimpchannel.h"
"core/gimpdrawable.h" "core/gimpdrawable.h"
"core/gimpdrawable-transform.h" "core/gimpdrawable-transform.h"
"core/gimpimage.h"
"core/gimpprogress.h" "core/gimpprogress.h"
"gimppdb-utils.h" "gimppdb-utils.h"
"gimppdbcontext.h" "gimppdbcontext.h"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment