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

This commit is contained in:
Michael Natterer 2011-03-25 21:57:56 +01:00
parent 3ed87015a6
commit 4d7dbe233d
2 changed files with 28 additions and 12 deletions

View File

@ -26,8 +26,10 @@
#include "pdb-types.h"
#include "core/gimp-transform-utils.h"
#include "core/gimpchannel.h"
#include "core/gimpdrawable-transform.h"
#include "core/gimpdrawable.h"
#include "core/gimpimage.h"
#include "core/gimpitem.h"
#include "core/gimpparamspecs.h"
#include "core/gimpprogress.h"
@ -81,7 +83,8 @@ item_transform_flip_simple_invoker (GimpProcedure *procedure,
flip_type, auto_center, &axis);
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;
@ -159,7 +162,8 @@ item_transform_flip_invoker (GimpProcedure *procedure,
gimp_progress_start (progress, _("Flipping"), FALSE);
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;
@ -258,7 +262,8 @@ item_transform_perspective_invoker (GimpProcedure *procedure,
gimp_progress_start (progress, _("Perspective"), FALSE);
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;
@ -341,7 +346,8 @@ item_transform_rotate_simple_invoker (GimpProcedure *procedure,
auto_center, &center_x, &center_y);
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;
@ -427,7 +433,8 @@ item_transform_rotate_invoker (GimpProcedure *procedure,
gimp_progress_start (progress, _("Rotating"), FALSE);
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;
@ -517,7 +524,8 @@ item_transform_scale_invoker (GimpProcedure *procedure,
gimp_progress_start (progress, _("Scaling"), FALSE);
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;
@ -603,7 +611,8 @@ item_transform_shear_invoker (GimpProcedure *procedure,
gimp_progress_start (progress, _("Shearing"), FALSE);
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;
@ -700,7 +709,8 @@ item_transform_2d_invoker (GimpProcedure *procedure,
gimp_progress_start (progress, _("2D Transform"), FALSE);
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;
@ -805,7 +815,8 @@ item_transform_matrix_invoker (GimpProcedure *procedure,
gimp_progress_start (progress, _("2D Transforming"), FALSE);
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;

View File

@ -53,7 +53,8 @@ $assemble_matrix
gimp_progress_start (progress, _(\"$progress_text\"), FALSE);
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;
@ -150,7 +151,8 @@ HELP
flip_type, auto_center, &axis);
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;
@ -356,7 +358,8 @@ HELP
auto_center, &center_x, &center_y);
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;
@ -657,8 +660,10 @@ CODE
@headers = qw("libgimpmath/gimpmath.h"
"core/gimp-transform-utils.h"
"core/gimpchannel.h"
"core/gimpdrawable.h"
"core/gimpdrawable-transform.h"
"core/gimpimage.h"
"core/gimpprogress.h"
"gimppdb-utils.h"
"gimppdbcontext.h"