From 1f4940ae44105c029a75d25533c497c2c594c95d Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Tue, 28 Apr 2009 18:25:59 -0500 Subject: [PATCH] gdiplus: Implement GdipSetLineBlend. --- dlls/gdiplus/brush.c | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/dlls/gdiplus/brush.c b/dlls/gdiplus/brush.c index 9df52adf3c2..eb0df03c3f6 100644 --- a/dlls/gdiplus/brush.c +++ b/dlls/gdiplus/brush.c @@ -1115,15 +1115,35 @@ GpStatus WINGDIPAPI GdipScaleTextureTransform(GpTexture* brush, } GpStatus WINGDIPAPI GdipSetLineBlend(GpLineGradient *brush, - GDIPCONST REAL *blend, GDIPCONST REAL* positions, INT count) + GDIPCONST REAL *factors, GDIPCONST REAL* positions, INT count) { - static int calls; + REAL *new_blendfac, *new_blendpos; - if(!brush || !blend || !positions || count <= 0) + TRACE("(%p, %p, %p, %i)\n", brush, factors, positions, count); + + if(!brush || !factors || !positions || count <= 0 || + (count >= 2 && (positions[0] != 0.0f || positions[count-1] != 1.0f))) return InvalidParameter; - if(!(calls++)) - FIXME("not implemented\n"); + new_blendfac = GdipAlloc(count * sizeof(REAL)); + new_blendpos = GdipAlloc(count * sizeof(REAL)); + + if (!new_blendfac || !new_blendpos) + { + GdipFree(new_blendfac); + GdipFree(new_blendpos); + return OutOfMemory; + } + + memcpy(new_blendfac, factors, count * sizeof(REAL)); + memcpy(new_blendpos, positions, count * sizeof(REAL)); + + GdipFree(brush->blendfac); + GdipFree(brush->blendpos); + + brush->blendcount = count; + brush->blendfac = new_blendfac; + brush->blendpos = new_blendpos; return Ok; } -- 2.11.4.GIT