2 * Copyright (C) 2007 Google (Evan Stade)
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
32 #include "gdiplus_private.h"
33 #include "wine/debug.h"
35 WINE_DEFAULT_DEBUG_CHANNEL(gdiplus);
37 /******************************************************************************
38 * GdipCloneBrush [GDIPLUS.@]
40 GpStatus WINGDIPAPI GdipCloneBrush(GpBrush *brush, GpBrush **clone)
42 TRACE("(%p, %p)\n", brush, clone);
45 return InvalidParameter;
48 case BrushTypeSolidColor:
51 *clone = GdipAlloc(sizeof(GpSolidFill));
52 if (!*clone) return OutOfMemory;
54 fill = (GpSolidFill*)*clone;
56 memcpy(*clone, brush, sizeof(GpSolidFill));
58 (*clone)->gdibrush = CreateBrushIndirect(&(*clone)->lb);
59 fill->bmp = ARGB2BMP(fill->color);
62 case BrushTypeHatchFill:
63 *clone = GdipAlloc(sizeof(GpHatch));
64 if (!*clone) return OutOfMemory;
66 memcpy(*clone, brush, sizeof(GpHatch));
68 (*clone)->gdibrush = CreateBrushIndirect(&(*clone)->lb);
70 case BrushTypePathGradient:{
71 GpPathGradient *src, *dest;
74 *clone = GdipAlloc(sizeof(GpPathGradient));
75 if (!*clone) return OutOfMemory;
77 src = (GpPathGradient*) brush,
78 dest = (GpPathGradient*) *clone;
79 count = src->pathdata.Count;
81 memcpy(dest, src, sizeof(GpPathGradient));
83 dest->pathdata.Count = count;
84 dest->pathdata.Points = GdipAlloc(count * sizeof(PointF));
85 dest->pathdata.Types = GdipAlloc(count);
87 if(!dest->pathdata.Points || !dest->pathdata.Types){
88 GdipFree(dest->pathdata.Points);
89 GdipFree(dest->pathdata.Types);
94 memcpy(dest->pathdata.Points, src->pathdata.Points, count * sizeof(PointF));
95 memcpy(dest->pathdata.Types, src->pathdata.Types, count);
98 count = src->blendcount;
99 dest->blendcount = count;
100 dest->blendfac = GdipAlloc(count * sizeof(REAL));
101 dest->blendpos = GdipAlloc(count * sizeof(REAL));
103 if(!dest->blendfac || !dest->blendpos){
104 GdipFree(dest->pathdata.Points);
105 GdipFree(dest->pathdata.Types);
106 GdipFree(dest->blendfac);
107 GdipFree(dest->blendpos);
112 memcpy(dest->blendfac, src->blendfac, count * sizeof(REAL));
113 memcpy(dest->blendpos, src->blendpos, count * sizeof(REAL));
117 case BrushTypeLinearGradient:{
118 GpLineGradient *dest, *src;
121 dest = GdipAlloc(sizeof(GpLineGradient));
122 if(!dest) return OutOfMemory;
124 src = (GpLineGradient*)brush;
126 memcpy(dest, src, sizeof(GpLineGradient));
128 dest->brush.gdibrush = CreateSolidBrush(dest->brush.lb.lbColor);
130 count = dest->blendcount;
131 dest->blendfac = GdipAlloc(count * sizeof(REAL));
132 dest->blendpos = GdipAlloc(count * sizeof(REAL));
133 pcount = dest->pblendcount;
136 dest->pblendcolor = GdipAlloc(pcount * sizeof(ARGB));
137 dest->pblendpos = GdipAlloc(pcount * sizeof(REAL));
140 if (!dest->blendfac || !dest->blendpos ||
141 (pcount && (!dest->pblendcolor || !dest->pblendpos)))
143 GdipFree(dest->blendfac);
144 GdipFree(dest->blendpos);
145 GdipFree(dest->pblendcolor);
146 GdipFree(dest->pblendpos);
147 DeleteObject(dest->brush.gdibrush);
152 memcpy(dest->blendfac, src->blendfac, count * sizeof(REAL));
153 memcpy(dest->blendpos, src->blendpos, count * sizeof(REAL));
157 memcpy(dest->pblendcolor, src->pblendcolor, pcount * sizeof(ARGB));
158 memcpy(dest->pblendpos, src->pblendpos, pcount * sizeof(REAL));
161 *clone = &dest->brush;
164 case BrushTypeTextureFill:
165 *clone = GdipAlloc(sizeof(GpTexture));
166 if(!*clone) return OutOfMemory;
168 memcpy(*clone, brush, sizeof(GpTexture));
170 (*clone)->gdibrush = CreateBrushIndirect(&(*clone)->lb);
173 ERR("not implemented for brush type %d\n", brush->bt);
174 return NotImplemented;
180 static LONG HatchStyleToHatch(HatchStyle hatchstyle)
184 case HatchStyleHorizontal: return HS_HORIZONTAL;
185 case HatchStyleVertical: return HS_VERTICAL;
186 case HatchStyleForwardDiagonal: return HS_FDIAGONAL;
187 case HatchStyleBackwardDiagonal: return HS_BDIAGONAL;
188 case HatchStyleCross: return HS_CROSS;
189 case HatchStyleDiagonalCross: return HS_DIAGCROSS;
194 /******************************************************************************
195 * GdipCreateHatchBrush [GDIPLUS.@]
197 GpStatus WINGDIPAPI GdipCreateHatchBrush(HatchStyle hatchstyle, ARGB forecol, ARGB backcol, GpHatch **brush)
199 COLORREF fgcol = ARGB2COLORREF(forecol);
201 TRACE("(%d, %d, %d, %p)\n", hatchstyle, forecol, backcol, brush);
203 if(!brush) return InvalidParameter;
205 *brush = GdipAlloc(sizeof(GpHatch));
206 if (!*brush) return OutOfMemory;
210 case HatchStyleHorizontal:
211 case HatchStyleVertical:
212 case HatchStyleForwardDiagonal:
213 case HatchStyleBackwardDiagonal:
214 case HatchStyleCross:
215 case HatchStyleDiagonalCross:
216 /* Brushes that map to BS_HATCHED */
217 (*brush)->brush.lb.lbStyle = BS_HATCHED;
218 (*brush)->brush.lb.lbColor = fgcol;
219 (*brush)->brush.lb.lbHatch = HatchStyleToHatch(hatchstyle);
223 FIXME("Unimplemented hatch style %d\n", hatchstyle);
225 (*brush)->brush.lb.lbStyle = BS_SOLID;
226 (*brush)->brush.lb.lbColor = fgcol;
227 (*brush)->brush.lb.lbHatch = 0;
232 (*brush)->brush.gdibrush = CreateBrushIndirect(&(*brush)->brush.lb);
233 (*brush)->brush.bt = BrushTypeHatchFill;
234 (*brush)->forecol = forecol;
235 (*brush)->backcol = backcol;
236 (*brush)->hatchstyle = hatchstyle;
241 /******************************************************************************
242 * GdipCreateLineBrush [GDIPLUS.@]
244 GpStatus WINGDIPAPI GdipCreateLineBrush(GDIPCONST GpPointF* startpoint,
245 GDIPCONST GpPointF* endpoint, ARGB startcolor, ARGB endcolor,
246 GpWrapMode wrap, GpLineGradient **line)
248 COLORREF col = ARGB2COLORREF(startcolor);
250 TRACE("(%p, %p, %x, %x, %d, %p)\n", startpoint, endpoint,
251 startcolor, endcolor, wrap, line);
253 if(!line || !startpoint || !endpoint || wrap == WrapModeClamp)
254 return InvalidParameter;
256 *line = GdipAlloc(sizeof(GpLineGradient));
257 if(!*line) return OutOfMemory;
259 (*line)->brush.lb.lbStyle = BS_SOLID;
260 (*line)->brush.lb.lbColor = col;
261 (*line)->brush.lb.lbHatch = 0;
262 (*line)->brush.gdibrush = CreateSolidBrush(col);
263 (*line)->brush.bt = BrushTypeLinearGradient;
265 (*line)->startpoint.X = startpoint->X;
266 (*line)->startpoint.Y = startpoint->Y;
267 (*line)->endpoint.X = endpoint->X;
268 (*line)->endpoint.Y = endpoint->Y;
269 (*line)->startcolor = startcolor;
270 (*line)->endcolor = endcolor;
271 (*line)->wrap = wrap;
272 (*line)->gamma = FALSE;
274 (*line)->rect.X = (startpoint->X < endpoint->X ? startpoint->X: endpoint->X);
275 (*line)->rect.Y = (startpoint->Y < endpoint->Y ? startpoint->Y: endpoint->Y);
276 (*line)->rect.Width = fabs(startpoint->X - endpoint->X);
277 (*line)->rect.Height = fabs(startpoint->Y - endpoint->Y);
279 if ((*line)->rect.Width == 0)
281 (*line)->rect.X -= (*line)->rect.Height / 2.0f;
282 (*line)->rect.Width = (*line)->rect.Height;
284 else if ((*line)->rect.Height == 0)
286 (*line)->rect.Y -= (*line)->rect.Width / 2.0f;
287 (*line)->rect.Height = (*line)->rect.Width;
290 (*line)->blendcount = 1;
291 (*line)->blendfac = GdipAlloc(sizeof(REAL));
292 (*line)->blendpos = GdipAlloc(sizeof(REAL));
294 if (!(*line)->blendfac || !(*line)->blendpos)
296 GdipFree((*line)->blendfac);
297 GdipFree((*line)->blendpos);
298 DeleteObject((*line)->brush.gdibrush);
304 (*line)->blendfac[0] = 1.0f;
305 (*line)->blendpos[0] = 1.0f;
307 (*line)->pblendcolor = NULL;
308 (*line)->pblendpos = NULL;
309 (*line)->pblendcount = 0;
314 GpStatus WINGDIPAPI GdipCreateLineBrushI(GDIPCONST GpPoint* startpoint,
315 GDIPCONST GpPoint* endpoint, ARGB startcolor, ARGB endcolor,
316 GpWrapMode wrap, GpLineGradient **line)
321 TRACE("(%p, %p, %x, %x, %d, %p)\n", startpoint, endpoint,
322 startcolor, endcolor, wrap, line);
324 if(!startpoint || !endpoint)
325 return InvalidParameter;
327 stF.X = (REAL)startpoint->X;
328 stF.Y = (REAL)startpoint->Y;
329 endF.X = (REAL)endpoint->X;
330 endF.X = (REAL)endpoint->Y;
332 return GdipCreateLineBrush(&stF, &endF, startcolor, endcolor, wrap, line);
335 GpStatus WINGDIPAPI GdipCreateLineBrushFromRect(GDIPCONST GpRectF* rect,
336 ARGB startcolor, ARGB endcolor, LinearGradientMode mode, GpWrapMode wrap,
337 GpLineGradient **line)
342 TRACE("(%p, %x, %x, %d, %d, %p)\n", rect, startcolor, endcolor, mode,
346 return InvalidParameter;
350 case LinearGradientModeHorizontal:
353 end.X = rect->X + rect->Width;
356 case LinearGradientModeVertical:
360 end.Y = rect->Y + rect->Height;
362 case LinearGradientModeForwardDiagonal:
365 end.X = rect->X + rect->Width;
366 end.Y = rect->Y + rect->Height;
368 case LinearGradientModeBackwardDiagonal:
369 start.X = rect->X + rect->Width;
372 end.Y = rect->Y + rect->Height;
375 return InvalidParameter;
378 stat = GdipCreateLineBrush(&start, &end, startcolor, endcolor, wrap, line);
381 (*line)->rect = *rect;
386 GpStatus WINGDIPAPI GdipCreateLineBrushFromRectI(GDIPCONST GpRect* rect,
387 ARGB startcolor, ARGB endcolor, LinearGradientMode mode, GpWrapMode wrap,
388 GpLineGradient **line)
392 TRACE("(%p, %x, %x, %d, %d, %p)\n", rect, startcolor, endcolor, mode,
395 rectF.X = (REAL) rect->X;
396 rectF.Y = (REAL) rect->Y;
397 rectF.Width = (REAL) rect->Width;
398 rectF.Height = (REAL) rect->Height;
400 return GdipCreateLineBrushFromRect(&rectF, startcolor, endcolor, mode, wrap, line);
403 /******************************************************************************
404 * GdipCreateLineBrushFromRectWithAngle [GDIPLUS.@]
406 * FIXME: angle value completely ignored. Don't know how to use it since native
407 * always set Brush rectangle to rect (independetly of this angle).
408 * Maybe it's used only on drawing.
410 GpStatus WINGDIPAPI GdipCreateLineBrushFromRectWithAngle(GDIPCONST GpRectF* rect,
411 ARGB startcolor, ARGB endcolor, REAL angle, BOOL isAngleScalable, GpWrapMode wrap,
412 GpLineGradient **line)
414 TRACE("(%p, %x, %x, %.2f, %d, %d, %p)\n", rect, startcolor, endcolor, angle, isAngleScalable,
417 return GdipCreateLineBrushFromRect(rect, startcolor, endcolor, LinearGradientModeForwardDiagonal,
421 GpStatus WINGDIPAPI GdipCreateLineBrushFromRectWithAngleI(GDIPCONST GpRect* rect,
422 ARGB startcolor, ARGB endcolor, REAL angle, BOOL isAngleScalable, GpWrapMode wrap,
423 GpLineGradient **line)
425 TRACE("(%p, %x, %x, %.2f, %d, %d, %p)\n", rect, startcolor, endcolor, angle, isAngleScalable,
428 return GdipCreateLineBrushFromRectI(rect, startcolor, endcolor, LinearGradientModeForwardDiagonal,
432 GpStatus WINGDIPAPI GdipCreatePathGradient(GDIPCONST GpPointF* points,
433 INT count, GpWrapMode wrap, GpPathGradient **grad)
435 COLORREF col = ARGB2COLORREF(0xffffffff);
437 TRACE("(%p, %d, %d, %p)\n", points, count, wrap, grad);
440 return InvalidParameter;
445 *grad = GdipAlloc(sizeof(GpPathGradient));
446 if (!*grad) return OutOfMemory;
448 (*grad)->blendfac = GdipAlloc(sizeof(REAL));
449 if(!(*grad)->blendfac){
453 (*grad)->blendfac[0] = 1.0;
454 (*grad)->blendpos = NULL;
455 (*grad)->blendcount = 1;
457 (*grad)->pathdata.Count = count;
458 (*grad)->pathdata.Points = GdipAlloc(count * sizeof(PointF));
459 (*grad)->pathdata.Types = GdipAlloc(count);
461 if(!(*grad)->pathdata.Points || !(*grad)->pathdata.Types){
462 GdipFree((*grad)->pathdata.Points);
463 GdipFree((*grad)->pathdata.Types);
468 memcpy((*grad)->pathdata.Points, points, count * sizeof(PointF));
469 memset((*grad)->pathdata.Types, PathPointTypeLine, count);
471 (*grad)->brush.lb.lbStyle = BS_SOLID;
472 (*grad)->brush.lb.lbColor = col;
473 (*grad)->brush.lb.lbHatch = 0;
475 (*grad)->brush.gdibrush = CreateSolidBrush(col);
476 (*grad)->brush.bt = BrushTypePathGradient;
477 (*grad)->centercolor = 0xffffffff;
478 (*grad)->wrap = wrap;
479 (*grad)->gamma = FALSE;
480 (*grad)->center.X = 0.0;
481 (*grad)->center.Y = 0.0;
482 (*grad)->focus.X = 0.0;
483 (*grad)->focus.Y = 0.0;
488 GpStatus WINGDIPAPI GdipCreatePathGradientI(GDIPCONST GpPoint* points,
489 INT count, GpWrapMode wrap, GpPathGradient **grad)
495 TRACE("(%p, %d, %d, %p)\n", points, count, wrap, grad);
498 return InvalidParameter;
503 pointsF = GdipAlloc(sizeof(GpPointF) * count);
507 for(i = 0; i < count; i++){
508 pointsF[i].X = (REAL)points[i].X;
509 pointsF[i].Y = (REAL)points[i].Y;
512 ret = GdipCreatePathGradient(pointsF, count, wrap, grad);
518 /******************************************************************************
519 * GdipCreatePathGradientFromPath [GDIPLUS.@]
521 * FIXME: path gradient brushes not truly supported (drawn as solid brushes)
523 GpStatus WINGDIPAPI GdipCreatePathGradientFromPath(GDIPCONST GpPath* path,
524 GpPathGradient **grad)
526 COLORREF col = ARGB2COLORREF(0xffffffff);
528 TRACE("(%p, %p)\n", path, grad);
531 return InvalidParameter;
533 *grad = GdipAlloc(sizeof(GpPathGradient));
534 if (!*grad) return OutOfMemory;
536 (*grad)->blendfac = GdipAlloc(sizeof(REAL));
537 if(!(*grad)->blendfac){
541 (*grad)->blendfac[0] = 1.0;
542 (*grad)->blendpos = NULL;
543 (*grad)->blendcount = 1;
545 (*grad)->pathdata.Count = path->pathdata.Count;
546 (*grad)->pathdata.Points = GdipAlloc(path->pathdata.Count * sizeof(PointF));
547 (*grad)->pathdata.Types = GdipAlloc(path->pathdata.Count);
549 if(!(*grad)->pathdata.Points || !(*grad)->pathdata.Types){
550 GdipFree((*grad)->pathdata.Points);
551 GdipFree((*grad)->pathdata.Types);
556 memcpy((*grad)->pathdata.Points, path->pathdata.Points,
557 path->pathdata.Count * sizeof(PointF));
558 memcpy((*grad)->pathdata.Types, path->pathdata.Types, path->pathdata.Count);
560 (*grad)->brush.lb.lbStyle = BS_SOLID;
561 (*grad)->brush.lb.lbColor = col;
562 (*grad)->brush.lb.lbHatch = 0;
564 (*grad)->brush.gdibrush = CreateSolidBrush(col);
565 (*grad)->brush.bt = BrushTypePathGradient;
566 (*grad)->centercolor = 0xffffffff;
567 (*grad)->wrap = WrapModeClamp;
568 (*grad)->gamma = FALSE;
569 /* FIXME: this should be set to the "centroid" of the path by default */
570 (*grad)->center.X = 0.0;
571 (*grad)->center.Y = 0.0;
572 (*grad)->focus.X = 0.0;
573 (*grad)->focus.Y = 0.0;
578 /******************************************************************************
579 * GdipCreateSolidFill [GDIPLUS.@]
581 GpStatus WINGDIPAPI GdipCreateSolidFill(ARGB color, GpSolidFill **sf)
583 COLORREF col = ARGB2COLORREF(color);
585 TRACE("(%x, %p)\n", color, sf);
587 if(!sf) return InvalidParameter;
589 *sf = GdipAlloc(sizeof(GpSolidFill));
590 if (!*sf) return OutOfMemory;
592 (*sf)->brush.lb.lbStyle = BS_SOLID;
593 (*sf)->brush.lb.lbColor = col;
594 (*sf)->brush.lb.lbHatch = 0;
596 (*sf)->brush.gdibrush = CreateSolidBrush(col);
597 (*sf)->brush.bt = BrushTypeSolidColor;
598 (*sf)->color = color;
599 (*sf)->bmp = ARGB2BMP(color);
604 /******************************************************************************
605 * GdipCreateTexture [GDIPLUS.@]
608 * image [I] image to use
609 * wrapmode [I] optional
610 * texture [O] pointer to the resulting texturebrush
614 * FAILURE: element of GpStatus
616 GpStatus WINGDIPAPI GdipCreateTexture(GpImage *image, GpWrapMode wrapmode,
620 GpImageAttributes attributes;
623 TRACE("%p, %d %p\n", image, wrapmode, texture);
625 if (!(image && texture))
626 return InvalidParameter;
628 stat = GdipGetImageWidth(image, &width);
629 if (stat != Ok) return stat;
630 stat = GdipGetImageHeight(image, &height);
631 if (stat != Ok) return stat;
632 attributes.wrap = wrapmode;
634 return GdipCreateTextureIA(image, &attributes, 0, 0, width, height,
638 /******************************************************************************
639 * GdipCreateTexture2 [GDIPLUS.@]
641 GpStatus WINGDIPAPI GdipCreateTexture2(GpImage *image, GpWrapMode wrapmode,
642 REAL x, REAL y, REAL width, REAL height, GpTexture **texture)
644 GpImageAttributes attributes;
646 TRACE("%p %d %f %f %f %f %p\n", image, wrapmode,
647 x, y, width, height, texture);
649 attributes.wrap = wrapmode;
650 return GdipCreateTextureIA(image, &attributes, x, y, width, height,
654 /******************************************************************************
655 * GdipCreateTextureIA [GDIPLUS.@]
657 * FIXME: imageattr ignored
659 GpStatus WINGDIPAPI GdipCreateTextureIA(GpImage *image,
660 GDIPCONST GpImageAttributes *imageattr, REAL x, REAL y, REAL width,
661 REAL height, GpTexture **texture)
664 HBITMAP hbm, old = NULL;
666 BITMAPINFOHEADER *bmih;
667 INT n_x, n_y, n_width, n_height, abs_height, stride, image_stride, i, bytespp;
669 BYTE *dibits, *buff, *textbits;
672 TRACE("(%p, %p, %.2f, %.2f, %.2f, %.2f, %p)\n", image, imageattr, x, y, width, height,
675 if(!image || !texture || x < 0.0 || y < 0.0 || width < 0.0 || height < 0.0)
676 return InvalidParameter;
678 if(image->type != ImageTypeBitmap){
679 FIXME("not implemented for image type %d\n", image->type);
680 return NotImplemented;
685 n_width = roundr(width);
686 n_height = roundr(height);
688 if(n_x + n_width > ((GpBitmap*)image)->width ||
689 n_y + n_height > ((GpBitmap*)image)->height)
690 return InvalidParameter;
692 hbm = ((GpBitmap*)image)->hbitmap;
693 if(!hbm) return GenericError;
694 hdc = ((GpBitmap*)image)->hdc;
695 bm_is_selected = (hdc != 0);
697 pbmi = GdipAlloc(sizeof(BITMAPINFOHEADER) + 256 * sizeof(RGBQUAD));
700 pbmi->bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
701 pbmi->bmiHeader.biBitCount = 0;
704 hdc = CreateCompatibleDC(0);
705 old = SelectObject(hdc, hbm);
709 GetDIBits(hdc, hbm, 0, 0, NULL, pbmi, DIB_RGB_COLORS);
711 bytespp = pbmi->bmiHeader.biBitCount / 8;
712 abs_height = abs(pbmi->bmiHeader.biHeight);
714 if(n_x > pbmi->bmiHeader.biWidth || n_x + n_width > pbmi->bmiHeader.biWidth ||
715 n_y > abs_height || n_y + n_height > abs_height){
717 return InvalidParameter;
720 dibits = GdipAlloc(pbmi->bmiHeader.biSizeImage);
722 if(dibits) /* this is not a good place to error out */
723 GetDIBits(hdc, hbm, 0, abs_height, dibits, pbmi, DIB_RGB_COLORS);
726 SelectObject(hdc, old);
735 image_stride = (pbmi->bmiHeader.biWidth * bytespp + 3) & ~3;
736 stride = (n_width * bytespp + 3) & ~3;
737 buff = GdipAlloc(sizeof(BITMAPINFOHEADER) + stride * n_height);
744 bmih = (BITMAPINFOHEADER*)buff;
745 textbits = (BYTE*) (bmih + 1);
746 bmih->biSize = sizeof(BITMAPINFOHEADER);
747 bmih->biWidth = n_width;
748 bmih->biHeight = n_height;
749 bmih->biCompression = BI_RGB;
750 bmih->biSizeImage = stride * n_height;
751 bmih->biBitCount = pbmi->bmiHeader.biBitCount;
755 /* image is flipped */
756 if(pbmi->bmiHeader.biHeight > 0){
757 dibits += image_stride * (pbmi->bmiHeader.biHeight - 1);
759 textbits += stride * (n_height - 1);
765 for(i = 0; i < n_height; i++)
766 memcpy(&textbits[i * stride],
767 &dibits[n_x * bytespp + (n_y + i) * image_stride],
770 *texture = GdipAlloc(sizeof(GpTexture));
777 if((status = GdipCreateMatrix(&(*texture)->transform)) != Ok){
784 (*texture)->brush.lb.lbStyle = BS_DIBPATTERNPT;
785 (*texture)->brush.lb.lbColor = DIB_RGB_COLORS;
786 (*texture)->brush.lb.lbHatch = (ULONG_PTR)buff;
788 (*texture)->brush.gdibrush = CreateBrushIndirect(&(*texture)->brush.lb);
789 (*texture)->brush.bt = BrushTypeTextureFill;
790 (*texture)->wrap = imageattr->wrap;
798 /******************************************************************************
799 * GdipCreateTextureIAI [GDIPLUS.@]
801 GpStatus WINGDIPAPI GdipCreateTextureIAI(GpImage *image, GDIPCONST GpImageAttributes *imageattr,
802 INT x, INT y, INT width, INT height, GpTexture **texture)
804 TRACE("(%p, %p, %d, %d, %d, %d, %p)\n", image, imageattr, x, y, width, height,
807 return GdipCreateTextureIA(image,imageattr,(REAL)x,(REAL)y,(REAL)width,(REAL)height,texture);
810 GpStatus WINGDIPAPI GdipCreateTexture2I(GpImage *image, GpWrapMode wrapmode,
811 INT x, INT y, INT width, INT height, GpTexture **texture)
813 GpImageAttributes imageattr;
815 TRACE("%p %d %d %d %d %d %p\n", image, wrapmode, x, y, width, height,
818 imageattr.wrap = wrapmode;
820 return GdipCreateTextureIA(image, &imageattr, x, y, width, height, texture);
823 GpStatus WINGDIPAPI GdipGetBrushType(GpBrush *brush, GpBrushType *type)
825 TRACE("(%p, %p)\n", brush, type);
827 if(!brush || !type) return InvalidParameter;
834 GpStatus WINGDIPAPI GdipGetHatchBackgroundColor(GpHatch *brush, ARGB *backcol)
836 TRACE("(%p, %p)\n", brush, backcol);
838 if(!brush || !backcol) return InvalidParameter;
840 *backcol = brush->backcol;
845 GpStatus WINGDIPAPI GdipGetHatchForegroundColor(GpHatch *brush, ARGB *forecol)
847 TRACE("(%p, %p)\n", brush, forecol);
849 if(!brush || !forecol) return InvalidParameter;
851 *forecol = brush->forecol;
856 GpStatus WINGDIPAPI GdipGetHatchStyle(GpHatch *brush, HatchStyle *hatchstyle)
858 TRACE("(%p, %p)\n", brush, hatchstyle);
860 if(!brush || !hatchstyle) return InvalidParameter;
862 *hatchstyle = brush->hatchstyle;
867 GpStatus WINGDIPAPI GdipDeleteBrush(GpBrush *brush)
869 TRACE("(%p)\n", brush);
871 if(!brush) return InvalidParameter;
875 case BrushTypePathGradient:
876 GdipFree(((GpPathGradient*) brush)->pathdata.Points);
877 GdipFree(((GpPathGradient*) brush)->pathdata.Types);
878 GdipFree(((GpPathGradient*) brush)->blendfac);
879 GdipFree(((GpPathGradient*) brush)->blendpos);
881 case BrushTypeSolidColor:
882 if (((GpSolidFill*)brush)->bmp)
883 DeleteObject(((GpSolidFill*)brush)->bmp);
885 case BrushTypeLinearGradient:
886 GdipFree(((GpLineGradient*)brush)->blendfac);
887 GdipFree(((GpLineGradient*)brush)->blendpos);
888 GdipFree(((GpLineGradient*)brush)->pblendcolor);
889 GdipFree(((GpLineGradient*)brush)->pblendpos);
891 case BrushTypeTextureFill:
892 GdipDeleteMatrix(((GpTexture*)brush)->transform);
898 DeleteObject(brush->gdibrush);
904 GpStatus WINGDIPAPI GdipGetLineGammaCorrection(GpLineGradient *line,
907 TRACE("(%p, %p)\n", line, usinggamma);
909 if(!line || !usinggamma)
910 return InvalidParameter;
912 *usinggamma = line->gamma;
917 GpStatus WINGDIPAPI GdipGetLineWrapMode(GpLineGradient *brush, GpWrapMode *wrapmode)
919 TRACE("(%p, %p)\n", brush, wrapmode);
921 if(!brush || !wrapmode)
922 return InvalidParameter;
924 *wrapmode = brush->wrap;
929 GpStatus WINGDIPAPI GdipGetPathGradientBlend(GpPathGradient *brush, REAL *blend,
930 REAL *positions, INT count)
932 TRACE("(%p, %p, %p, %d)\n", brush, blend, positions, count);
934 if(!brush || !blend || !positions || count <= 0)
935 return InvalidParameter;
937 if(count < brush->blendcount)
938 return InsufficientBuffer;
940 memcpy(blend, brush->blendfac, count*sizeof(REAL));
941 if(brush->blendcount > 1){
942 memcpy(positions, brush->blendpos, count*sizeof(REAL));
948 GpStatus WINGDIPAPI GdipGetPathGradientBlendCount(GpPathGradient *brush, INT *count)
950 TRACE("(%p, %p)\n", brush, count);
953 return InvalidParameter;
955 *count = brush->blendcount;
960 GpStatus WINGDIPAPI GdipGetPathGradientCenterPoint(GpPathGradient *grad,
963 TRACE("(%p, %p)\n", grad, point);
966 return InvalidParameter;
968 point->X = grad->center.X;
969 point->Y = grad->center.Y;
974 GpStatus WINGDIPAPI GdipGetPathGradientCenterPointI(GpPathGradient *grad,
980 TRACE("(%p, %p)\n", grad, point);
983 return InvalidParameter;
985 ret = GdipGetPathGradientCenterPoint(grad,&ptf);
988 point->X = roundr(ptf.X);
989 point->Y = roundr(ptf.Y);
995 GpStatus WINGDIPAPI GdipGetPathGradientFocusScales(GpPathGradient *grad,
998 TRACE("(%p, %p, %p)\n", grad, x, y);
1000 if(!grad || !x || !y)
1001 return InvalidParameter;
1009 GpStatus WINGDIPAPI GdipGetPathGradientGammaCorrection(GpPathGradient *grad,
1012 TRACE("(%p, %p)\n", grad, gamma);
1015 return InvalidParameter;
1017 *gamma = grad->gamma;
1022 GpStatus WINGDIPAPI GdipGetPathGradientPointCount(GpPathGradient *grad,
1025 TRACE("(%p, %p)\n", grad, count);
1028 return InvalidParameter;
1030 *count = grad->pathdata.Count;
1035 GpStatus WINGDIPAPI GdipGetPathGradientRect(GpPathGradient *brush, GpRectF *rect)
1041 TRACE("(%p, %p)\n", brush, rect);
1044 return InvalidParameter;
1046 stat = GdipCreatePath2(brush->pathdata.Points, brush->pathdata.Types,
1047 brush->pathdata.Count, FillModeAlternate, &path);
1048 if(stat != Ok) return stat;
1050 stat = GdipGetPathWorldBounds(path, &r, NULL, NULL);
1052 GdipDeletePath(path);
1056 memcpy(rect, &r, sizeof(GpRectF));
1058 GdipDeletePath(path);
1063 GpStatus WINGDIPAPI GdipGetPathGradientRectI(GpPathGradient *brush, GpRect *rect)
1068 TRACE("(%p, %p)\n", brush, rect);
1071 return InvalidParameter;
1073 stat = GdipGetPathGradientRect(brush, &rectf);
1074 if(stat != Ok) return stat;
1076 rect->X = roundr(rectf.X);
1077 rect->Y = roundr(rectf.Y);
1078 rect->Width = roundr(rectf.Width);
1079 rect->Height = roundr(rectf.Height);
1084 GpStatus WINGDIPAPI GdipGetPathGradientSurroundColorsWithCount(GpPathGradient
1085 *grad, ARGB *argb, INT *count)
1089 if(!grad || !argb || !count || (*count < grad->pathdata.Count))
1090 return InvalidParameter;
1093 FIXME("not implemented\n");
1095 return NotImplemented;
1098 GpStatus WINGDIPAPI GdipGetPathGradientWrapMode(GpPathGradient *brush,
1099 GpWrapMode *wrapmode)
1101 TRACE("(%p, %p)\n", brush, wrapmode);
1103 if(!brush || !wrapmode)
1104 return InvalidParameter;
1106 *wrapmode = brush->wrap;
1111 GpStatus WINGDIPAPI GdipGetSolidFillColor(GpSolidFill *sf, ARGB *argb)
1113 TRACE("(%p, %p)\n", sf, argb);
1116 return InvalidParameter;
1123 /******************************************************************************
1124 * GdipGetTextureTransform [GDIPLUS.@]
1126 GpStatus WINGDIPAPI GdipGetTextureTransform(GpTexture *brush, GpMatrix *matrix)
1128 TRACE("(%p, %p)\n", brush, matrix);
1130 if(!brush || !matrix)
1131 return InvalidParameter;
1133 memcpy(matrix, brush->transform, sizeof(GpMatrix));
1138 /******************************************************************************
1139 * GdipGetTextureWrapMode [GDIPLUS.@]
1141 GpStatus WINGDIPAPI GdipGetTextureWrapMode(GpTexture *brush, GpWrapMode *wrapmode)
1143 TRACE("(%p, %p)\n", brush, wrapmode);
1145 if(!brush || !wrapmode)
1146 return InvalidParameter;
1148 *wrapmode = brush->wrap;
1153 /******************************************************************************
1154 * GdipMultiplyTextureTransform [GDIPLUS.@]
1156 GpStatus WINGDIPAPI GdipMultiplyTextureTransform(GpTexture* brush,
1157 GDIPCONST GpMatrix *matrix, GpMatrixOrder order)
1159 TRACE("(%p, %p, %d)\n", brush, matrix, order);
1161 if(!brush || !matrix)
1162 return InvalidParameter;
1164 return GdipMultiplyMatrix(brush->transform, matrix, order);
1167 /******************************************************************************
1168 * GdipResetTextureTransform [GDIPLUS.@]
1170 GpStatus WINGDIPAPI GdipResetTextureTransform(GpTexture* brush)
1172 TRACE("(%p)\n", brush);
1175 return InvalidParameter;
1177 return GdipSetMatrixElements(brush->transform, 1.0, 0.0, 0.0, 1.0, 0.0, 0.0);
1180 /******************************************************************************
1181 * GdipScaleTextureTransform [GDIPLUS.@]
1183 GpStatus WINGDIPAPI GdipScaleTextureTransform(GpTexture* brush,
1184 REAL sx, REAL sy, GpMatrixOrder order)
1186 TRACE("(%p, %.2f, %.2f, %d)\n", brush, sx, sy, order);
1189 return InvalidParameter;
1191 return GdipScaleMatrix(brush->transform, sx, sy, order);
1194 GpStatus WINGDIPAPI GdipSetLineBlend(GpLineGradient *brush,
1195 GDIPCONST REAL *factors, GDIPCONST REAL* positions, INT count)
1197 REAL *new_blendfac, *new_blendpos;
1199 TRACE("(%p, %p, %p, %i)\n", brush, factors, positions, count);
1201 if(!brush || !factors || !positions || count <= 0 ||
1202 (count >= 2 && (positions[0] != 0.0f || positions[count-1] != 1.0f)))
1203 return InvalidParameter;
1205 new_blendfac = GdipAlloc(count * sizeof(REAL));
1206 new_blendpos = GdipAlloc(count * sizeof(REAL));
1208 if (!new_blendfac || !new_blendpos)
1210 GdipFree(new_blendfac);
1211 GdipFree(new_blendpos);
1215 memcpy(new_blendfac, factors, count * sizeof(REAL));
1216 memcpy(new_blendpos, positions, count * sizeof(REAL));
1218 GdipFree(brush->blendfac);
1219 GdipFree(brush->blendpos);
1221 brush->blendcount = count;
1222 brush->blendfac = new_blendfac;
1223 brush->blendpos = new_blendpos;
1228 GpStatus WINGDIPAPI GdipGetLineBlend(GpLineGradient *brush, REAL *factors,
1229 REAL *positions, INT count)
1231 TRACE("(%p, %p, %p, %i)\n", brush, factors, positions, count);
1233 if (!brush || !factors || !positions || count <= 0)
1234 return InvalidParameter;
1236 if (count < brush->blendcount)
1237 return InsufficientBuffer;
1239 memcpy(factors, brush->blendfac, brush->blendcount * sizeof(REAL));
1240 memcpy(positions, brush->blendpos, brush->blendcount * sizeof(REAL));
1245 GpStatus WINGDIPAPI GdipGetLineBlendCount(GpLineGradient *brush, INT *count)
1247 TRACE("(%p, %p)\n", brush, count);
1249 if (!brush || !count)
1250 return InvalidParameter;
1252 *count = brush->blendcount;
1257 GpStatus WINGDIPAPI GdipSetLineGammaCorrection(GpLineGradient *line,
1260 TRACE("(%p, %d)\n", line, usegamma);
1263 return InvalidParameter;
1265 line->gamma = usegamma;
1270 GpStatus WINGDIPAPI GdipSetLineSigmaBlend(GpLineGradient *line, REAL focus,
1277 const int precision = 16;
1278 REAL erf_range; /* we use values erf(-erf_range) through erf(+erf_range) */
1282 TRACE("(%p, %0.2f, %0.2f)\n", line, focus, scale);
1284 if(!line || focus < 0.0 || focus > 1.0 || scale < 0.0 || scale > 1.0)
1285 return InvalidParameter;
1287 /* we want 2 standard deviations */
1288 erf_range = 2.0 / sqrt(2);
1290 /* calculate the constants we need to normalize the error function to be
1291 between 0.0 and scale over the range we need */
1292 min_erf = erf(-erf_range);
1293 scale_erf = scale / (-2.0 * min_erf);
1299 for (i=1; i<precision; i++)
1301 positions[i] = focus * i / precision;
1302 factors[i] = scale_erf * (erf(2 * erf_range * i / precision - erf_range) - min_erf);
1304 num_points += precision;
1307 positions[num_points] = focus;
1308 factors[num_points] = scale;
1313 for (i=1; i<precision; i++)
1315 positions[i+num_points-1] = (focus + ((1.0-focus) * i / precision));
1316 factors[i+num_points-1] = scale_erf * (erf(erf_range - 2 * erf_range * i / precision) - min_erf);
1318 num_points += precision;
1319 positions[num_points-1] = 1.0;
1320 factors[num_points-1] = 0.0;
1323 return GdipSetLineBlend(line, factors, positions, num_points);
1326 GpStatus WINGDIPAPI GdipSetLineWrapMode(GpLineGradient *line,
1329 TRACE("(%p, %d)\n", line, wrap);
1331 if(!line || wrap == WrapModeClamp)
1332 return InvalidParameter;
1339 GpStatus WINGDIPAPI GdipSetPathGradientBlend(GpPathGradient *brush, GDIPCONST REAL *blend,
1340 GDIPCONST REAL *pos, INT count)
1345 FIXME("not implemented\n");
1347 return NotImplemented;
1350 GpStatus WINGDIPAPI GdipSetPathGradientPresetBlend(GpPathGradient *brush,
1351 GDIPCONST ARGB *blend, GDIPCONST REAL *pos, INT count)
1353 FIXME("(%p,%p,%p,%i): stub\n", brush, blend, pos, count);
1354 return NotImplemented;
1357 GpStatus WINGDIPAPI GdipSetPathGradientCenterColor(GpPathGradient *grad,
1360 TRACE("(%p, %x)\n", grad, argb);
1363 return InvalidParameter;
1365 grad->centercolor = argb;
1366 grad->brush.lb.lbColor = ARGB2COLORREF(argb);
1368 DeleteObject(grad->brush.gdibrush);
1369 grad->brush.gdibrush = CreateSolidBrush(grad->brush.lb.lbColor);
1374 GpStatus WINGDIPAPI GdipSetPathGradientCenterPoint(GpPathGradient *grad,
1377 TRACE("(%p, %p)\n", grad, point);
1380 return InvalidParameter;
1382 grad->center.X = point->X;
1383 grad->center.Y = point->Y;
1388 GpStatus WINGDIPAPI GdipSetPathGradientCenterPointI(GpPathGradient *grad,
1393 TRACE("(%p, %p)\n", grad, point);
1396 return InvalidParameter;
1398 ptf.X = (REAL)point->X;
1399 ptf.Y = (REAL)point->Y;
1401 return GdipSetPathGradientCenterPoint(grad,&ptf);
1404 GpStatus WINGDIPAPI GdipSetPathGradientFocusScales(GpPathGradient *grad,
1407 TRACE("(%p, %.2f, %.2f)\n", grad, x, y);
1410 return InvalidParameter;
1418 GpStatus WINGDIPAPI GdipSetPathGradientGammaCorrection(GpPathGradient *grad,
1421 TRACE("(%p, %d)\n", grad, gamma);
1424 return InvalidParameter;
1426 grad->gamma = gamma;
1431 GpStatus WINGDIPAPI GdipSetPathGradientSigmaBlend(GpPathGradient *grad,
1432 REAL focus, REAL scale)
1436 if(!grad || focus < 0.0 || focus > 1.0 || scale < 0.0 || scale > 1.0)
1437 return InvalidParameter;
1440 FIXME("not implemented\n");
1442 return NotImplemented;
1445 GpStatus WINGDIPAPI GdipSetPathGradientSurroundColorsWithCount(GpPathGradient
1446 *grad, ARGB *argb, INT *count)
1450 if(!grad || !argb || !count || (*count <= 0) ||
1451 (*count > grad->pathdata.Count))
1452 return InvalidParameter;
1455 FIXME("not implemented\n");
1457 return NotImplemented;
1460 GpStatus WINGDIPAPI GdipSetPathGradientWrapMode(GpPathGradient *grad,
1463 TRACE("(%p, %d)\n", grad, wrap);
1466 return InvalidParameter;
1473 GpStatus WINGDIPAPI GdipSetSolidFillColor(GpSolidFill *sf, ARGB argb)
1475 TRACE("(%p, %x)\n", sf, argb);
1478 return InvalidParameter;
1481 sf->brush.lb.lbColor = ARGB2COLORREF(argb);
1483 DeleteObject(sf->brush.gdibrush);
1484 sf->brush.gdibrush = CreateSolidBrush(sf->brush.lb.lbColor);
1489 /******************************************************************************
1490 * GdipSetTextureTransform [GDIPLUS.@]
1492 GpStatus WINGDIPAPI GdipSetTextureTransform(GpTexture *texture,
1493 GDIPCONST GpMatrix *matrix)
1495 TRACE("(%p, %p)\n", texture, matrix);
1497 if(!texture || !matrix)
1498 return InvalidParameter;
1500 memcpy(texture->transform, matrix, sizeof(GpMatrix));
1505 /******************************************************************************
1506 * GdipSetTextureWrapMode [GDIPLUS.@]
1508 * WrapMode not used, only stored
1510 GpStatus WINGDIPAPI GdipSetTextureWrapMode(GpTexture *brush, GpWrapMode wrapmode)
1512 TRACE("(%p, %d)\n", brush, wrapmode);
1515 return InvalidParameter;
1517 brush->wrap = wrapmode;
1522 GpStatus WINGDIPAPI GdipSetLineColors(GpLineGradient *brush, ARGB color1,
1525 TRACE("(%p, %x, %x)\n", brush, color1, color2);
1528 return InvalidParameter;
1530 brush->startcolor = color1;
1531 brush->endcolor = color2;
1536 GpStatus WINGDIPAPI GdipGetLineColors(GpLineGradient *brush, ARGB *colors)
1538 TRACE("(%p, %p)\n", brush, colors);
1540 if(!brush || !colors)
1541 return InvalidParameter;
1543 colors[0] = brush->startcolor;
1544 colors[1] = brush->endcolor;
1549 /******************************************************************************
1550 * GdipRotateTextureTransform [GDIPLUS.@]
1552 GpStatus WINGDIPAPI GdipRotateTextureTransform(GpTexture* brush, REAL angle,
1553 GpMatrixOrder order)
1555 TRACE("(%p, %.2f, %d)\n", brush, angle, order);
1558 return InvalidParameter;
1560 return GdipRotateMatrix(brush->transform, angle, order);
1563 GpStatus WINGDIPAPI GdipSetLineLinearBlend(GpLineGradient *brush, REAL focus,
1570 TRACE("(%p,%.2f,%.2f)\n", brush, focus, scale);
1572 if (!brush) return InvalidParameter;
1576 factors[num_points] = 0.0;
1577 positions[num_points] = 0.0;
1581 factors[num_points] = scale;
1582 positions[num_points] = focus;
1587 factors[num_points] = 0.0;
1588 positions[num_points] = 1.0;
1592 return GdipSetLineBlend(brush, factors, positions, num_points);
1595 GpStatus WINGDIPAPI GdipSetLinePresetBlend(GpLineGradient *brush,
1596 GDIPCONST ARGB *blend, GDIPCONST REAL* positions, INT count)
1600 TRACE("(%p,%p,%p,%i)\n", brush, blend, positions, count);
1602 if (!brush || !blend || !positions || count < 2 ||
1603 positions[0] != 0.0f || positions[count-1] != 1.0f)
1605 return InvalidParameter;
1608 new_color = GdipAlloc(count * sizeof(ARGB));
1609 new_pos = GdipAlloc(count * sizeof(REAL));
1610 if (!new_color || !new_pos)
1612 GdipFree(new_color);
1617 memcpy(new_color, blend, sizeof(ARGB) * count);
1618 memcpy(new_pos, positions, sizeof(REAL) * count);
1620 GdipFree(brush->pblendcolor);
1621 GdipFree(brush->pblendpos);
1623 brush->pblendcolor = new_color;
1624 brush->pblendpos = new_pos;
1625 brush->pblendcount = count;
1630 GpStatus WINGDIPAPI GdipGetLinePresetBlend(GpLineGradient *brush,
1631 ARGB *blend, REAL* positions, INT count)
1633 if (!brush || !blend || !positions || count < 2)
1634 return InvalidParameter;
1636 if (brush->pblendcount == 0)
1637 return GenericError;
1639 if (count < brush->pblendcount)
1640 return InsufficientBuffer;
1642 memcpy(blend, brush->pblendcolor, sizeof(ARGB) * brush->pblendcount);
1643 memcpy(positions, brush->pblendpos, sizeof(REAL) * brush->pblendcount);
1648 GpStatus WINGDIPAPI GdipGetLinePresetBlendCount(GpLineGradient *brush,
1651 if (!brush || !count)
1652 return InvalidParameter;
1654 *count = brush->pblendcount;
1659 GpStatus WINGDIPAPI GdipResetLineTransform(GpLineGradient *brush)
1664 FIXME("not implemented\n");
1666 return NotImplemented;
1669 GpStatus WINGDIPAPI GdipSetLineTransform(GpLineGradient *brush,
1670 GDIPCONST GpMatrix *matrix)
1675 FIXME("not implemented\n");
1677 return NotImplemented;
1680 GpStatus WINGDIPAPI GdipScaleLineTransform(GpLineGradient *brush, REAL sx, REAL sy,
1681 GpMatrixOrder order)
1686 FIXME("not implemented\n");
1688 return NotImplemented;
1691 GpStatus WINGDIPAPI GdipTranslateLineTransform(GpLineGradient* brush,
1692 REAL dx, REAL dy, GpMatrixOrder order)
1694 FIXME("stub: %p %f %f %d\n", brush, dx, dy, order);
1696 return NotImplemented;
1699 /******************************************************************************
1700 * GdipTranslateTextureTransform [GDIPLUS.@]
1702 GpStatus WINGDIPAPI GdipTranslateTextureTransform(GpTexture* brush, REAL dx, REAL dy,
1703 GpMatrixOrder order)
1705 TRACE("(%p, %.2f, %.2f, %d)\n", brush, dx, dy, order);
1708 return InvalidParameter;
1710 return GdipTranslateMatrix(brush->transform, dx, dy, order);
1713 GpStatus WINGDIPAPI GdipGetLineRect(GpLineGradient *brush, GpRectF *rect)
1715 TRACE("(%p, %p)\n", brush, rect);
1718 return InvalidParameter;
1720 *rect = brush->rect;
1725 GpStatus WINGDIPAPI GdipGetLineRectI(GpLineGradient *brush, GpRect *rect)
1730 TRACE("(%p, %p)\n", brush, rect);
1733 return InvalidParameter;
1735 ret = GdipGetLineRect(brush, &rectF);
1738 rect->X = roundr(rectF.X);
1739 rect->Y = roundr(rectF.Y);
1740 rect->Width = roundr(rectF.Width);
1741 rect->Height = roundr(rectF.Height);
1747 GpStatus WINGDIPAPI GdipRotateLineTransform(GpLineGradient* brush,
1748 REAL angle, GpMatrixOrder order)
1753 return InvalidParameter;
1756 FIXME("(%p, %.2f, %d) stub\n", brush, angle, order);
1758 return NotImplemented;