Commit 7a000a09 authored by Øyvind "pippin" Kolås's avatar Øyvind "pippin" Kolås
Browse files

app: include composite mode in legacy layer mode info

Otherwise normal mode doesn't work due to optimizations.
parent 6c983eb1
......@@ -416,42 +416,54 @@ gboolean
gimp_layer_mode_is_legacy (GimpLayerMode mode)
{
const GimpLayerModeInfo *info = gimp_layer_mode_info (mode);
return info?info->flags & GIMP_LAYER_MODE_FLAG_LEGACY:FALSE;
if (!info)
return FALSE;
return (info->flags & GIMP_LAYER_MODE_FLAG_LEGACY) != 0;
}
gboolean
gimp_layer_mode_wants_linear_data (GimpLayerMode mode)
{
const GimpLayerModeInfo *info = gimp_layer_mode_info (mode);
return info?info->flags & GIMP_LAYER_MODE_FLAG_WANTS_LINEAR_DATA:FALSE;
if (!info)
return FALSE;
return (info->flags & GIMP_LAYER_MODE_FLAG_WANTS_LINEAR_DATA) != 0;
}
GimpLayerColorSpace
gimp_layer_mode_get_blend_space (GimpLayerMode mode)
{
const GimpLayerModeInfo *info = gimp_layer_mode_info (mode);
return info?info->blend_space:GIMP_LAYER_COLOR_SPACE_RGB_LINEAR;
if (!info)
return GIMP_LAYER_COLOR_SPACE_RGB_LINEAR;
return info->blend_space;
}
GimpLayerColorSpace
gimp_layer_mode_get_composite_space (GimpLayerMode mode)
{
const GimpLayerModeInfo *info = gimp_layer_mode_info (mode);
return info?info->composite_space:GIMP_LAYER_COLOR_SPACE_RGB_LINEAR;
if (!info)
return GIMP_LAYER_COLOR_SPACE_RGB_LINEAR;
return info->composite_space;
}
GimpLayerCompositeMode
gimp_layer_mode_get_composite_mode (GimpLayerMode mode)
{
const GimpLayerModeInfo *info = gimp_layer_mode_info (mode);
return info?info->composite_mode:GIMP_LAYER_COMPOSITE_SRC_ATOP;
if (!info)
return GIMP_LAYER_COMPOSITE_SRC_OVER;
return info->composite_mode;
}
const gchar *
gimp_layer_mode_get_operation (GimpLayerMode mode)
{
const GimpLayerModeInfo *info = gimp_layer_mode_info (mode);
return info?info->op_name:"gimp:layer-mode";
if (!info)
return "gimp:layer-mode";
return info->op_name;
}
static gboolean
......
......@@ -1971,94 +1971,117 @@ static GimpLayerModeInfo gimp_layer_mode_infos[]=
{ GIMP_LAYER_MODE_NORMAL,
"gimp:normal",
0,
GIMP_LAYER_COMPOSITE_SRC_OVER,
},
{ GIMP_LAYER_MODE_DISSOLVE,
"gimp:dissolve",
GIMP_LAYER_MODE_FLAG_WANTS_LINEAR_DATA,
GIMP_LAYER_COMPOSITE_SRC_OVER,
},
{ GIMP_LAYER_MODE_BEHIND,
"gimp:behind",
0,
GIMP_LAYER_COMPOSITE_DST_ATOP,
},
{ GIMP_LAYER_MODE_MULTIPLY_LEGACY,
"gimp:multiply-legacy",
GIMP_LAYER_MODE_FLAG_LEGACY
GIMP_LAYER_MODE_FLAG_LEGACY,
GIMP_LAYER_COMPOSITE_SRC_ATOP,
},
{ GIMP_LAYER_MODE_SCREEN_LEGACY,
"gimp:screen-legacy",
GIMP_LAYER_MODE_FLAG_LEGACY,
GIMP_LAYER_COMPOSITE_SRC_ATOP,
},
{ GIMP_LAYER_MODE_OVERLAY_LEGACY,
"gimp:overlay-legacy",
GIMP_LAYER_MODE_FLAG_LEGACY,
GIMP_LAYER_COMPOSITE_SRC_ATOP,
},
{ GIMP_LAYER_MODE_DIFFERENCE_LEGACY,
"gimp:difference-legacy",
GIMP_LAYER_MODE_FLAG_LEGACY,
GIMP_LAYER_COMPOSITE_SRC_ATOP,
},
{ GIMP_LAYER_MODE_ADDITION_LEGACY,
"gimp:addition-legacy",
GIMP_LAYER_MODE_FLAG_LEGACY,
GIMP_LAYER_COMPOSITE_SRC_ATOP,
},
{ GIMP_LAYER_MODE_SUBTRACT_LEGACY,
"gimp:subtract-legacy",
GIMP_LAYER_MODE_FLAG_LEGACY,
GIMP_LAYER_COMPOSITE_SRC_ATOP,
},
{ GIMP_LAYER_MODE_DARKEN_ONLY_LEGACY,
"gimp:darken-only-legacy",
GIMP_LAYER_MODE_FLAG_LEGACY,
GIMP_LAYER_COMPOSITE_SRC_ATOP,
},
{ GIMP_LAYER_MODE_LIGHTEN_ONLY_LEGACY,
"gimp:lighten-only-legacy",
GIMP_LAYER_MODE_FLAG_LEGACY,
GIMP_LAYER_COMPOSITE_SRC_ATOP,
},
{ GIMP_LAYER_MODE_HSV_HUE_LEGACY,
"gimp:hsv-hue-legacy",
GIMP_LAYER_MODE_FLAG_LEGACY,
GIMP_LAYER_COMPOSITE_SRC_ATOP,
},
{ GIMP_LAYER_MODE_HSV_SATURATION_LEGACY,
"gimp:hsv-saturation-legacy",
GIMP_LAYER_MODE_FLAG_LEGACY,
GIMP_LAYER_COMPOSITE_SRC_ATOP,
},
{ GIMP_LAYER_MODE_HSV_COLOR_LEGACY,
"gimp:hsv-color-legacy",
GIMP_LAYER_MODE_FLAG_LEGACY,
GIMP_LAYER_COMPOSITE_SRC_ATOP,
},
{ GIMP_LAYER_MODE_HSV_VALUE_LEGACY,
"gimp:hsv-value-legacy",
GIMP_LAYER_MODE_FLAG_LEGACY,
GIMP_LAYER_COMPOSITE_SRC_ATOP,
},
{ GIMP_LAYER_MODE_DIVIDE_LEGACY,
"gimp:divide-legacy",
GIMP_LAYER_MODE_FLAG_LEGACY,
GIMP_LAYER_COMPOSITE_SRC_ATOP,
},
{ GIMP_LAYER_MODE_DODGE_LEGACY,
"gimp:dodge-legacy",
GIMP_LAYER_MODE_FLAG_LEGACY,
GIMP_LAYER_COMPOSITE_SRC_ATOP,
},
{ GIMP_LAYER_MODE_BURN_LEGACY,
"gimp:burn-legacy",
GIMP_LAYER_MODE_FLAG_LEGACY,
GIMP_LAYER_COMPOSITE_SRC_ATOP,
},
{ GIMP_LAYER_MODE_HARDLIGHT_LEGACY,
"gimp:hardlight-legacy",
GIMP_LAYER_MODE_FLAG_LEGACY,
GIMP_LAYER_COMPOSITE_SRC_ATOP,
},
{ GIMP_LAYER_MODE_SOFTLIGHT_LEGACY,
"gimp:softlight-legacy",
GIMP_LAYER_MODE_FLAG_LEGACY,
GIMP_LAYER_COMPOSITE_SRC_ATOP,
},
{ GIMP_LAYER_MODE_GRAIN_EXTRACT_LEGACY,
"gimp:grain-extract-legacy",
GIMP_LAYER_MODE_FLAG_LEGACY,
GIMP_LAYER_COMPOSITE_SRC_ATOP,
},
{ GIMP_LAYER_MODE_GRAIN_MERGE_LEGACY,
"gimp:grain-merge-legacy",
GIMP_LAYER_MODE_FLAG_LEGACY,
GIMP_LAYER_COMPOSITE_SRC_ATOP,
},
{ GIMP_LAYER_MODE_COLOR_ERASE,
"gimp:color-erase",
0,
GIMP_LAYER_COMPOSITE_SRC_ATOP,
},
{ GIMP_LAYER_MODE_OVERLAY,
"gimp:layer-mode",
......
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