gdiplus: Partial implementation of GdipGetEffectParameterSize.

This commit is contained in:
Vijay Kiran Kamuju 2024-10-24 19:09:39 +02:00 committed by Alexandre Julliard
parent b91f57c85f
commit a7e386b63e
Notes: Alexandre Julliard 2024-10-30 14:01:45 -05:00
Approved-by: Esme Povirk (@madewokherd)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/wine/merge_requests/4661
2 changed files with 64 additions and 23 deletions

View file

@ -5593,11 +5593,56 @@ GpStatus WINGDIPAPI GdipDeleteEffect(CGpEffect *effect)
*/
GpStatus WINGDIPAPI GdipGetEffectParameterSize(CGpEffect *effect, UINT *size)
{
FIXME("(%p,%p): stub\n", effect, size);
UINT sz = 0;
GpStatus status = Ok;
TRACE("(%p,%p)\n", effect, size);
if (!effect || !size)
return InvalidParameter;
return NotImplemented;
switch (effect->type)
{
case BlurEffect:
sz = sizeof(struct BlurParams);
break;
case SharpenEffect:
sz = sizeof(struct SharpenParams);
break;
case TintEffect:
sz = sizeof(struct TintParams);
break;
case RedEyeCorrectionEffect:
sz = sizeof(struct RedEyeCorrectionParams);
break;
case ColorMatrixEffect:
sz = sizeof(ColorMatrix);
break;
case ColorLUTEffect:
sz = sizeof(struct ColorLUTParams);
break;
case BrightnessContrastEffect:
sz = sizeof(struct BrightnessContrastParams);
break;
case HueSaturationLightnessEffect:
sz = sizeof(struct HueSaturationLightnessParams);
break;
case ColorBalanceEffect:
sz = sizeof(struct ColorBalanceParams);
break;
case LevelsEffect:
sz = sizeof(struct LevelsParams);
break;
case ColorCurveEffect:
sz = sizeof(struct ColorCurveParams);
break;
default:
status = InvalidParameter;
break;
}
*size = sz;
return status;
}
/*****************************************************************************

View file

@ -5418,20 +5418,24 @@ static void test_createeffect(void)
static const struct test_data {
const GUID *effect;
const UINT parameters_number;
const BOOL todo;
} td[] =
{
{ &BlurEffectGuid, 8, TRUE },
{ &BrightnessContrastEffectGuid, 8, TRUE },
{ &ColorBalanceEffectGuid, 12, TRUE },
{ &ColorCurveEffectGuid, 12, TRUE },
{ &ColorLUTEffectGuid, 1024, TRUE },
{ &ColorMatrixEffectGuid, 100, TRUE },
{ &HueSaturationLightnessEffectGuid, 12, TRUE },
{ &LevelsEffectGuid, 12, TRUE },
{ &RedEyeCorrectionEffectGuid, 8, TRUE },
{ &SharpenEffectGuid, 8, TRUE },
{ &TintEffectGuid, 8, TRUE },
{ &BlurEffectGuid, 8 },
{ &BrightnessContrastEffectGuid, 8 },
{ &ColorBalanceEffectGuid, 12 },
{ &ColorCurveEffectGuid, 12 },
{ &ColorLUTEffectGuid, 1024 },
{ &ColorMatrixEffectGuid, 100 },
{ &HueSaturationLightnessEffectGuid, 12 },
{ &LevelsEffectGuid, 12 },
/* Parameter Size for Red Eye Correction effect is different for 64 bits build */
#ifdef _WIN64
{ &RedEyeCorrectionEffectGuid, 16 },
#else
{ &RedEyeCorrectionEffectGuid, 8 },
#endif
{ &SharpenEffectGuid, 8 },
{ &TintEffectGuid, 8 },
};
pGdipCreateEffect = (void*)GetProcAddress( mod, "GdipCreateEffect");
@ -5466,15 +5470,7 @@ static void test_createeffect(void)
param_size = 0;
stat = pGdipGetEffectParameterSize(effect, &param_size);
expect(Ok, stat);
#ifdef _WIN64
/* Parameter Size for Red Eye Correction effect is different for 64 bits build */
if (td[i].effect == &RedEyeCorrectionEffectGuid)
todo_wine_if(td[i].todo) expect(16, param_size);
else
todo_wine_if(td[i].todo) expect(td[i].parameters_number, param_size);
#else
todo_wine_if(td[i].todo) expect(td[i].parameters_number, param_size);
#endif
expect(td[i].parameters_number, param_size);
stat = pGdipDeleteEffect(effect);
expect(Ok, stat);
}