ReactOS 0.4.17-dev-116-ga4b6fe9
fillshap.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS win32 kernel mode subsystem
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: win32ss/gdi/ntgdi/fillshap.c
5 * PURPOSE: fillshap
6 * PROGRAMMER:
7 */
8
9#include <win32k.h>
10
11#define NDEBUG
12#include <debug.h>
13
14#define Rsin(d) ((d) == 0.0 ? 0.0 : ((d) == 90.0 ? 1.0 : sin(d*M_PI/180.0)))
15#define Rcos(d) ((d) == 0.0 ? 1.0 : ((d) == 90.0 ? 0.0 : cos(d*M_PI/180.0)))
16
19 PPOINT Points,
20 int Count)
21{
22 SURFACE *psurf;
23 PBRUSH pbrLine, pbrFill;
24 BOOL ret = FALSE; // Default to failure
25 RECTL DestRect;
26 INT i, CurrentPoint;
27 PDC_ATTR pdcattr;
28 POINTL BrushOrigin;
29 PPATH pPath;
30// int Left;
31// int Top;
32
33 ASSERT(dc); // Caller's responsibility to pass a valid dc
34
35 if (!Points || Count < 2 )
36 {
38 return FALSE;
39 }
40
41/*
42 // Find start x, y
43 Left = Points[0].x;
44 Top = Points[0].y;
45 for (CurrentPoint = 1; CurrentPoint < Count; ++CurrentPoint) {
46 Left = min(Left, Points[CurrentPoint].x);
47 Top = min(Top, Points[CurrentPoint].y);
48 }
49*/
50
51 pdcattr = dc->pdcattr;
52
53 /* Convert to screen coordinates */
54 IntLPtoDP(dc, Points, Count);
55 for (CurrentPoint = 0; CurrentPoint < Count; CurrentPoint++)
56 {
57 Points[CurrentPoint].x += dc->ptlDCOrig.x;
58 Points[CurrentPoint].y += dc->ptlDCOrig.y;
59 }
60 // No need to have path here.
61 {
62 DestRect.left = Points[0].x;
63 DestRect.right = Points[0].x;
64 DestRect.top = Points[0].y;
65 DestRect.bottom = Points[0].y;
66
67 for (CurrentPoint = 1; CurrentPoint < Count; ++CurrentPoint)
68 {
69 DestRect.left = min(DestRect.left, Points[CurrentPoint].x);
70 DestRect.right = max(DestRect.right, Points[CurrentPoint].x);
71 DestRect.top = min(DestRect.top, Points[CurrentPoint].y);
72 DestRect.bottom = max(DestRect.bottom, Points[CurrentPoint].y);
73 }
74
75 if (pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY))
77
78 if (pdcattr->ulDirty_ & (DIRTY_LINE | DC_PEN_DIRTY))
80
81 /* Special locking order to avoid lock-ups */
82 pbrFill = dc->dclevel.pbrFill;
83 pbrLine = dc->dclevel.pbrLine;
84 psurf = dc->dclevel.pSurface;
85 if (psurf == NULL)
86 {
87 /* Memory DC without a bitmap selected, nothing to do. */
88 return TRUE;
89 }
90
91 /* Now fill the polygon with the current fill brush. */
92 if (!(pbrFill->flAttrs & BR_IS_NULL))
93 {
94 BrushOrigin = *((PPOINTL)&pbrFill->ptOrigin);
95 BrushOrigin.x += dc->ptlDCOrig.x;
96 BrushOrigin.y += dc->ptlDCOrig.y;
98 psurf,
99 &dc->eboFill.BrushObject,
100 Points,
101 Count,
102 DestRect,
103 &BrushOrigin);
104 }
105
106 // Draw the Polygon Edges with the current pen ( if not a NULL pen )
107 if (!(pbrLine->flAttrs & BR_IS_NULL))
108 {
109 if (IntIsEffectiveWidePen(pbrLine))
110 {
111 /* Clear the path */
112 PATH_Delete(dc->dclevel.hPath);
113 dc->dclevel.hPath = NULL;
114
115 /* Begin a path */
116 pPath = PATH_CreatePath(Count + 1);
117 dc->dclevel.flPath |= DCPATH_ACTIVE;
118 dc->dclevel.hPath = pPath->BaseObject.hHmgr;
119 pPath->pos = Points[0];
120 IntLPtoDP(dc, &pPath->pos, 1);
121
122 PATH_MoveTo(dc, pPath);
123 for (i = 1; i < Count; ++i)
124 {
125 PATH_LineTo(dc, Points[i].x, Points[i].y);
126 }
127 PATH_LineTo(dc, Points[0].x, Points[0].y);
128
129 /* Close the path */
130 pPath->state = PATH_Closed;
131 dc->dclevel.flPath &= ~DCPATH_ACTIVE;
132
133 /* Actually stroke a path */
134 ret = PATH_StrokePath(dc, pPath);
135
136 /* Clear the path */
137 PATH_UnlockPath(pPath);
138 PATH_Delete(dc->dclevel.hPath);
139 dc->dclevel.hPath = NULL;
140 }
141 else
142 {
143 for (i = 0; i < Count-1; i++)
144 {
145// DPRINT1("Polygon Making line from (%d,%d) to (%d,%d)\n",
146// Points[0].x, Points[0].y,
147// Points[1].x, Points[1].y );
148
149 ret = IntEngLineTo(&psurf->SurfObj,
150 (CLIPOBJ *)&dc->co,
151 &dc->eboLine.BrushObject,
152 Points[i].x, /* From */
153 Points[i].y,
154 Points[i+1].x, /* To */
155 Points[i+1].y,
156 &DestRect,
157 ROP2_TO_MIX(pdcattr->jROP2)); /* MIX */
158 if (!ret) break;
159 }
160 /* Close the polygon */
161 if (ret)
162 {
163 ret = IntEngLineTo(&psurf->SurfObj,
164 (CLIPOBJ *)&dc->co,
165 &dc->eboLine.BrushObject,
166 Points[Count-1].x, /* From */
167 Points[Count-1].y,
168 Points[0].x, /* To */
169 Points[0].y,
170 &DestRect,
171 ROP2_TO_MIX(pdcattr->jROP2)); /* MIX */
172 }
173 }
174 }
175 }
176
177 return ret;
178}
179
182 LPPOINT Points,
183 PULONG PolyCounts,
184 int Count)
185{
186 if (PATH_IsPathOpen(dc->dclevel))
187 return PATH_PolyPolygon ( dc, Points, (PINT)PolyCounts, Count);
188
189 while (--Count >=0)
190 {
191 if (!IntGdiPolygon ( dc, Points, *PolyCounts ))
192 return FALSE;
193 Points+=*PolyCounts++;
194 }
195 return TRUE;
196}
197
200{
201 BOOL bResult;
202 PDC pdc;
203
204 pdc = DC_LockDc(hdc);
205 if (pdc == NULL)
206 {
208 return FALSE;
209 }
210
211 bResult = IntGdiPolygon(pdc, Point, Count);
212
213 DC_UnlockDc(pdc);
214 return bResult;
215}
216
217
218/******************************************************************************/
219
220/*
221 * NtGdiEllipse
222 *
223 * Author
224 * Filip Navara
225 *
226 * Remarks
227 * This function uses optimized Bresenham's ellipse algorithm. It draws
228 * four lines of the ellipse in one pass.
229 *
230 */
231
234 HDC hDC,
235 int Left,
236 int Top,
237 int Right,
238 int Bottom)
239{
240 PDC dc;
241 PDC_ATTR pdcattr;
242 RECTL RectBounds;
243 PBRUSH pbrush;
244 BOOL ret = TRUE;
245 LONG PenWidth, PenOrigWidth;
246 LONG RadiusX, RadiusY, CenterX, CenterY;
247 PBRUSH pFillBrushObj;
248 BRUSH tmpFillBrushObj;
249
250 dc = DC_LockDc(hDC);
251 if (dc == NULL)
252 {
254 return FALSE;
255 }
256
257 if (PATH_IsPathOpen(dc->dclevel))
258 {
259 ret = PATH_Ellipse(dc, Left, Top, Right, Bottom);
261 return ret;
262 }
263
267 if ((Left == Right) || (Top == Bottom))
268 {
270 return TRUE;
271 }
272
273 if (Right < Left)
274 {
275 INT tmp = Right; Right = Left; Left = tmp;
276 }
277 if (Bottom < Top)
278 {
279 INT tmp = Bottom; Bottom = Top; Top = tmp;
280 }
282
283 pdcattr = dc->pdcattr;
284
285 if (pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY))
287
288 if (pdcattr->ulDirty_ & (DIRTY_LINE | DC_PEN_DIRTY))
290
291 pbrush = PEN_ShareLockPen(pdcattr->hpen);
292 if (!pbrush)
293 {
294 DPRINT1("Ellipse Fail 1\n");
297 return FALSE;
298 }
299
300 PenOrigWidth = PenWidth = pbrush->lWidth;
301 if (pbrush->ulPenStyle == PS_NULL) PenWidth = 0;
302
303 if (pbrush->ulPenStyle == PS_INSIDEFRAME)
304 {
305 if (2*PenWidth > (Right - Left)) PenWidth = (Right -Left + 1)/2;
306 if (2*PenWidth > (Bottom - Top)) PenWidth = (Bottom -Top + 1)/2;
307 Left += PenWidth / 2;
308 Right -= (PenWidth - 1) / 2;
309 Top += PenWidth / 2;
310 Bottom -= (PenWidth - 1) / 2;
311 }
312
313 if (!PenWidth) PenWidth = 1;
314 pbrush->lWidth = PenWidth;
315
316 RectBounds.left = Left;
317 RectBounds.right = Right;
318 RectBounds.top = Top;
319 RectBounds.bottom = Bottom;
320
321 IntLPtoDP(dc, (LPPOINT)&RectBounds, 2);
322
323 RectBounds.left += dc->ptlDCOrig.x;
324 RectBounds.right += dc->ptlDCOrig.x;
325 RectBounds.top += dc->ptlDCOrig.y;
326 RectBounds.bottom += dc->ptlDCOrig.y;
327
328 // Setup for dynamic width and height.
329 RadiusX = max((RectBounds.right - RectBounds.left) / 2, 2); // Needs room
330 RadiusY = max((RectBounds.bottom - RectBounds.top) / 2, 2);
331 CenterX = (RectBounds.right + RectBounds.left) / 2;
332 CenterY = (RectBounds.bottom + RectBounds.top) / 2;
333
334 DPRINT("Ellipse 1: Left: %d, Top: %d, Right: %d, Bottom: %d\n",
335 RectBounds.left,RectBounds.top,RectBounds.right,RectBounds.bottom);
336
337 DPRINT("Ellipse 2: XLeft: %d, YLeft: %d, Width: %d, Height: %d\n",
338 CenterX - RadiusX, CenterY + RadiusY, RadiusX*2, RadiusY*2);
339
340 pFillBrushObj = BRUSH_ShareLockBrush(pdcattr->hbrush);
341 if (NULL == pFillBrushObj)
342 {
343 DPRINT1("FillEllipse Fail\n");
345 ret = FALSE;
346 }
347 else
348 {
349 RtlCopyMemory(&tmpFillBrushObj, pFillBrushObj, sizeof(tmpFillBrushObj));
350 //tmpFillBrushObj.ptOrigin.x += RectBounds.left - Left;
351 //tmpFillBrushObj.ptOrigin.y += RectBounds.top - Top;
352 tmpFillBrushObj.ptOrigin.x += dc->ptlDCOrig.x;
353 tmpFillBrushObj.ptOrigin.y += dc->ptlDCOrig.y;
354
355 DC_vPrepareDCsForBlit(dc, &RectBounds, NULL, NULL);
356
358 CenterX - RadiusX,
359 CenterY - RadiusY,
360 RadiusX*2, // Width
361 RadiusY*2, // Height
362 &tmpFillBrushObj);
363 BRUSH_ShareUnlockBrush(pFillBrushObj);
364
365 if (ret)
366 {
368 CenterX - RadiusX,
369 CenterY - RadiusY,
370 RadiusX*2, // Width
371 RadiusY*2, // Height
372 pbrush);
373 }
374
376 }
377
378 pbrush->lWidth = PenOrigWidth;
379 PEN_ShareUnlockPen(pbrush);
381 DPRINT("Ellipse Exit.\n");
382 return ret;
383}
384
385#if 0
386
387// When the fill mode is ALTERNATE, GDI fills the area between odd-numbered and
388// even-numbered polygon sides on each scan line. That is, GDI fills the area between the
389// first and second side, between the third and fourth side, and so on.
390
391// WINDING Selects winding mode (fills any region with a nonzero winding value).
392// When the fill mode is WINDING, GDI fills any region that has a nonzero winding value.
393// This value is defined as the number of times a pen used to draw the polygon would go around the region.
394// The direction of each edge of the polygon is important.
395
396extern BOOL FillPolygon(PDC dc,
397 SURFOBJ *SurfObj,
398 PBRUSHOBJ BrushObj,
399 MIX RopMode,
400 CONST PPOINT Points,
401 int Count,
402 RECTL BoundRect);
403
404#endif
405
406
410 IN PPOINT UnsafePoints,
411 IN PULONG UnsafeCounts,
412 IN ULONG Count,
413 IN INT iFunc )
414{
415 DC *dc;
416 PVOID pTemp;
417 LPPOINT SafePoints;
418 PULONG SafeCounts;
420 BOOL Ret = TRUE;
421 ULONG nPoints = 0, nMaxPoints = 0, nInvalid = 0, i;
422
423 if (!UnsafePoints || !UnsafeCounts ||
424 Count == 0 || iFunc == 0 || iFunc > GdiPolyPolyRgn)
425 {
426 /* Windows doesn't set last error */
427 return FALSE;
428 }
429
431 {
432 ProbeForRead(UnsafePoints, Count * sizeof(POINT), 1);
433 ProbeForRead(UnsafeCounts, Count * sizeof(ULONG), 1);
434
435 /* Count points and validate polygons */
436 for (i = 0; i < Count; i++)
437 {
438 if (UnsafeCounts[i] < 2)
439 {
440 nInvalid++;
441 }
442 nPoints += UnsafeCounts[i];
443 nMaxPoints = max(nMaxPoints, UnsafeCounts[i]);
444 }
445 }
447 {
449 }
450 _SEH2_END;
451
452 if (!NT_SUCCESS(Status))
453 {
454 /* Windows doesn't set last error */
455 return FALSE;
456 }
457
458 if (nPoints == 0 || nPoints < nMaxPoints)
459 {
460 /* If all polygon counts are zero, or we have overflow,
461 return without setting a last error code. */
462 return FALSE;
463 }
464
465 if (nInvalid != 0)
466 {
467 /* If at least one poly count is 0 or 1, fail */
469 return FALSE;
470 }
471
472 /* Allocate one buffer for both counts and points */
474 Count * sizeof(ULONG) + nPoints * sizeof(POINT),
475 TAG_SHAPE);
476 if (!pTemp)
477 {
479 return FALSE;
480 }
481
482 SafeCounts = pTemp;
483 SafePoints = (PVOID)(SafeCounts + Count);
484
486 {
487 /* Pointers already probed! */
488 RtlCopyMemory(SafeCounts, UnsafeCounts, Count * sizeof(ULONG));
489 RtlCopyMemory(SafePoints, UnsafePoints, nPoints * sizeof(POINT));
490 }
492 {
494 }
495 _SEH2_END;
496
497 if (!NT_SUCCESS(Status))
498 {
500 return FALSE;
501 }
502
503 /* Special handling for GdiPolyPolyRgn */
504 if (iFunc == GdiPolyPolyRgn)
505 {
507 HRGN hrgn;
508
509 hrgn = GreCreatePolyPolygonRgn(SafePoints, SafeCounts, Count, iMode);
510
512 return (ULONG_PTR)hrgn;
513 }
514
515 dc = DC_LockDc(hDC);
516 if (!dc)
517 {
520 return FALSE;
521 }
522
524
525 if (dc->pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY))
527
528 if (dc->pdcattr->ulDirty_ & (DIRTY_LINE | DC_PEN_DIRTY))
530
531 /* Perform the actual work */
532 switch (iFunc)
533 {
534 case GdiPolyPolygon:
535 Ret = IntGdiPolyPolygon(dc, SafePoints, SafeCounts, Count);
536 break;
537 case GdiPolyPolyLine:
538 Ret = IntGdiPolyPolyline(dc, SafePoints, SafeCounts, Count);
539 break;
540 case GdiPolyBezier:
541 Ret = IntGdiPolyBezier(dc, SafePoints, *SafeCounts);
542 break;
543 case GdiPolyLineTo:
544 Ret = IntGdiPolylineTo(dc, SafePoints, *SafeCounts);
545 break;
546 case GdiPolyBezierTo:
547 /* From Wine 10.0 dlls/win32u/painting.c NtGdiPolyPolyDraw
548 * UnsafeCounts[0] must be 3 * n + 1 (where n >= 1) */
549 if (Count == 1 && UnsafeCounts[0] != 1 && UnsafeCounts[0] % 3 == 1)
550 {
551 SafeCounts[0]--;
552 Ret = IntGdiPolyBezierTo(dc, SafePoints, *SafeCounts);
553 }
554 else
555 {
557 Ret = FALSE;
558 }
559 break;
560 default:
562 Ret = FALSE;
563 }
564
565 /* Cleanup and return */
569
570 return (ULONG_PTR)Ret;
571}
572
573
574BOOL
577 int LeftRect,
578 int TopRect,
579 int RightRect,
580 int BottomRect)
581{
582 SURFACE *psurf = NULL;
583 PBRUSH pbrLine, pbrFill;
584 BOOL ret = FALSE; // Default to failure
585 RECTL DestRect;
586 MIX Mix;
587 PDC_ATTR pdcattr;
588 POINTL BrushOrigin;
589 PPATH pPath;
590
591 ASSERT ( dc ); // Caller's responsibility to set this up
592
593 pdcattr = dc->pdcattr;
594
595 // Rectangle Path only.
596 if ( PATH_IsPathOpen(dc->dclevel) )
597 {
598 return PATH_Rectangle ( dc, LeftRect, TopRect, RightRect, BottomRect );
599 }
600
601 /* Make sure rectangle is not inverted */
602 DestRect.left = min(LeftRect, RightRect);
603 DestRect.right = max(LeftRect, RightRect);
604 DestRect.top = min(TopRect, BottomRect);
605 DestRect.bottom = max(TopRect, BottomRect);
606
607 IntLPtoDP(dc, (LPPOINT)&DestRect, 2);
608
609 DestRect.left += dc->ptlDCOrig.x;
610 DestRect.right += dc->ptlDCOrig.x;
611 DestRect.top += dc->ptlDCOrig.y;
612 DestRect.bottom += dc->ptlDCOrig.y;
613
614 if (dc->fs & (DC_ACCUM_APP|DC_ACCUM_WMGR))
615 {
616 IntUpdateBoundsRect(dc, &DestRect);
617 }
618
619 /* In GM_COMPATIBLE, don't include bottom and right edges */
620 if (pdcattr->iGraphicsMode == GM_COMPATIBLE)
621 {
622 DestRect.right--;
623 DestRect.bottom--;
624 }
625
626 DC_vPrepareDCsForBlit(dc, &DestRect, NULL, NULL);
627
628 if (pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY))
630
631 if (pdcattr->ulDirty_ & (DIRTY_LINE | DC_PEN_DIRTY))
633
634 pbrFill = dc->dclevel.pbrFill;
635 pbrLine = dc->dclevel.pbrLine;
636 if (!pbrLine)
637 {
638 ret = FALSE;
639 goto cleanup;
640 }
641
642 psurf = dc->dclevel.pSurface;
643 if (!psurf)
644 {
645 ret = TRUE;
646 goto cleanup;
647 }
648
649 if (pbrFill)
650 {
651 if (!(pbrFill->flAttrs & BR_IS_NULL))
652 {
653 BrushOrigin = *((PPOINTL)&pbrFill->ptOrigin);
654 BrushOrigin.x += dc->ptlDCOrig.x;
655 BrushOrigin.y += dc->ptlDCOrig.y;
656 ret = IntEngBitBlt(&psurf->SurfObj,
657 NULL,
658 NULL,
659 (CLIPOBJ *)&dc->co,
660 NULL,
661 &DestRect,
662 NULL,
663 NULL,
664 &dc->eboFill.BrushObject,
665 &BrushOrigin,
667 }
668 }
669
670 // Draw the rectangle with the current pen
671
672 ret = TRUE; // Change default to success
673
674 if (!(pbrLine->flAttrs & BR_IS_NULL))
675 {
676 if (IntIsEffectiveWidePen(pbrLine))
677 {
678 /* Clear the path */
679 PATH_Delete(dc->dclevel.hPath);
680 dc->dclevel.hPath = NULL;
681
682 /* Begin a path */
683 pPath = PATH_CreatePath(5);
684 dc->dclevel.flPath |= DCPATH_ACTIVE;
685 dc->dclevel.hPath = pPath->BaseObject.hHmgr;
686 pPath->pos.x = LeftRect;
687 pPath->pos.y = TopRect;
688 IntLPtoDP(dc, &pPath->pos, 1);
689
690 PATH_MoveTo(dc, pPath);
691 PATH_LineTo(dc, RightRect, TopRect);
692 PATH_LineTo(dc, RightRect, BottomRect);
693 PATH_LineTo(dc, LeftRect, BottomRect);
694 PATH_LineTo(dc, LeftRect, TopRect);
695
696 /* Close the path */
697 pPath->state = PATH_Closed;
698 dc->dclevel.flPath &= ~DCPATH_ACTIVE;
699
700 /* Actually stroke a path */
701 ret = PATH_StrokePath(dc, pPath);
702
703 /* Clear the path */
704 PATH_UnlockPath(pPath);
705 PATH_Delete(dc->dclevel.hPath);
706 dc->dclevel.hPath = NULL;
707 }
708 else
709 {
710 Mix = ROP2_TO_MIX(pdcattr->jROP2);
711 ret = ret && IntEngLineTo(&psurf->SurfObj,
712 (CLIPOBJ *)&dc->co,
713 &dc->eboLine.BrushObject,
714 DestRect.left, DestRect.top, DestRect.right, DestRect.top,
715 &DestRect, // Bounding rectangle
716 Mix);
717
718 ret = ret && IntEngLineTo(&psurf->SurfObj,
719 (CLIPOBJ *)&dc->co,
720 &dc->eboLine.BrushObject,
721 DestRect.right, DestRect.top, DestRect.right, DestRect.bottom,
722 &DestRect, // Bounding rectangle
723 Mix);
724
725 ret = ret && IntEngLineTo(&psurf->SurfObj,
726 (CLIPOBJ *)&dc->co,
727 &dc->eboLine.BrushObject,
728 DestRect.right, DestRect.bottom, DestRect.left, DestRect.bottom,
729 &DestRect, // Bounding rectangle
730 Mix);
731
732 ret = ret && IntEngLineTo(&psurf->SurfObj,
733 (CLIPOBJ *)&dc->co,
734 &dc->eboLine.BrushObject,
735 DestRect.left, DestRect.bottom, DestRect.left, DestRect.top,
736 &DestRect, // Bounding rectangle
737 Mix);
738 }
739 }
740
741cleanup:
743
744 /* Move current position in DC?
745 MSDN: The current position is neither used nor updated by Rectangle. */
746
747 return ret;
748}
749
750BOOL
753 int LeftRect,
754 int TopRect,
755 int RightRect,
756 int BottomRect)
757{
758 DC *dc;
759 BOOL ret; // Default to failure
760
761 dc = DC_LockDc(hDC);
762 if (!dc)
763 {
765 return FALSE;
766 }
767
768 /* Do we rotate or shear? */
769 if (!(dc->pdcattr->mxWorldToDevice.flAccel & XFORM_SCALE))
770 {
771 POINTL DestCoords[4];
772 ULONG PolyCounts = 4;
773
774 DestCoords[0].x = DestCoords[3].x = LeftRect;
775 DestCoords[0].y = DestCoords[1].y = TopRect;
776 DestCoords[1].x = DestCoords[2].x = RightRect;
777 DestCoords[2].y = DestCoords[3].y = BottomRect;
778 // Use IntGdiPolyPolygon so to support PATH.
779 ret = IntGdiPolyPolygon(dc, DestCoords, &PolyCounts, 1);
780 }
781 else
782 {
783 ret = IntRectangle(dc, LeftRect, TopRect, RightRect, BottomRect );
784 }
785
787
788 return ret;
789}
790
791
792BOOL
795 PDC dc,
796 int Left,
797 int Top,
798 int Right,
799 int Bottom,
800 int xCurveDiameter,
801 int yCurveDiameter)
802{
803 PDC_ATTR pdcattr;
804 PBRUSH pbrLine, pbrFill;
805 RECTL RectBounds;
806 LONG PenWidth, PenOrigWidth;
807 BOOL ret = TRUE; // Default to success
808 BRUSH brushTemp;
809
810 ASSERT ( dc ); // Caller's responsibility to set this up
811
812 if ( PATH_IsPathOpen(dc->dclevel) )
813 return PATH_RoundRect ( dc, Left, Top, Right, Bottom,
814 xCurveDiameter, yCurveDiameter );
815
816 if ((Left == Right) || (Top == Bottom)) return TRUE;
817
818 xCurveDiameter = max(abs( xCurveDiameter ), 1);
819 yCurveDiameter = max(abs( yCurveDiameter ), 1);
820
821 if (Right < Left)
822 {
823 INT tmp = Right; Right = Left; Left = tmp;
824 }
825 if (Bottom < Top)
826 {
827 INT tmp = Bottom; Bottom = Top; Top = tmp;
828 }
829
830 pdcattr = dc->pdcattr;
831
832 if (pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY))
834
835 if (pdcattr->ulDirty_ & (DIRTY_LINE | DC_PEN_DIRTY))
837
838 pbrLine = PEN_ShareLockPen(pdcattr->hpen);
839 if (!pbrLine)
840 {
841 /* Nothing to do, as we don't have a bitmap */
843 return FALSE;
844 }
845
846 PenOrigWidth = PenWidth = pbrLine->lWidth;
847 if (pbrLine->ulPenStyle == PS_NULL) PenWidth = 0;
848
849 if (pbrLine->ulPenStyle == PS_INSIDEFRAME)
850 {
851 if (2*PenWidth > (Right - Left)) PenWidth = (Right -Left + 1)/2;
852 if (2*PenWidth > (Bottom - Top)) PenWidth = (Bottom -Top + 1)/2;
853 Left += PenWidth / 2;
854 Right -= (PenWidth - 1) / 2;
855 Top += PenWidth / 2;
856 Bottom -= (PenWidth - 1) / 2;
857 }
858
859 if (!PenWidth) PenWidth = 1;
860 pbrLine->lWidth = PenWidth;
861
862 RectBounds.left = Left;
863 RectBounds.top = Top;
864 RectBounds.right = Right;
865 RectBounds.bottom = Bottom;
866
867 IntLPtoDP(dc, (LPPOINT)&RectBounds, 2);
868
869 RectBounds.left += dc->ptlDCOrig.x;
870 RectBounds.top += dc->ptlDCOrig.y;
871 RectBounds.right += dc->ptlDCOrig.x;
872 RectBounds.bottom += dc->ptlDCOrig.y;
873
874 pbrFill = BRUSH_ShareLockBrush(pdcattr->hbrush);
875 if (!pbrFill)
876 {
877 DPRINT1("FillRound Fail\n");
879 ret = FALSE;
880 }
881 else
882 {
883
884 DC_vPrepareDCsForBlit(dc, &RectBounds, NULL, NULL);
885
886 RtlCopyMemory(&brushTemp, pbrFill, sizeof(brushTemp));
887 brushTemp.ptOrigin.x += RectBounds.left - Left;
888 brushTemp.ptOrigin.y += RectBounds.top - Top;
890 RectBounds.left,
891 RectBounds.top,
892 RectBounds.right,
893 RectBounds.bottom,
894 xCurveDiameter,
895 yCurveDiameter,
896 &brushTemp);
897 BRUSH_ShareUnlockBrush(pbrFill);
898
899 if (ret)
900 {
902 RectBounds.left,
903 RectBounds.top,
904 RectBounds.right,
905 RectBounds.bottom,
906 xCurveDiameter,
907 yCurveDiameter,
908 pbrLine);
909 }
910
912 }
913
914
915 pbrLine->lWidth = PenOrigWidth;
916 PEN_ShareUnlockPen(pbrLine);
917 return ret;
918}
919
920BOOL
923 HDC hDC,
924 int LeftRect,
925 int TopRect,
926 int RightRect,
927 int BottomRect,
928 int Width,
929 int Height)
930{
931 DC *dc = DC_LockDc(hDC);
932 BOOL ret = FALSE; /* Default to failure */
933
934 DPRINT("NtGdiRoundRect(0x%p,%i,%i,%i,%i,%i,%i)\n",hDC,LeftRect,TopRect,RightRect,BottomRect,Width,Height);
935 if ( !dc )
936 {
937 DPRINT1("NtGdiRoundRect() - hDC is invalid\n");
939 }
940 else
941 {
942 ret = IntRoundRect ( dc, LeftRect, TopRect, RightRect, BottomRect, Width, Height );
943 DC_UnlockDc ( dc );
944 }
945
946 return ret;
947}
948
949BOOL
950NTAPI
952 HDC hdc,
955 PVOID pMesh,
956 ULONG nMesh,
958{
959 PDC pdc;
960 SURFACE *psurf;
961 EXLATEOBJ exlo;
962 RECTL rclExtent;
963 POINTL ptlDitherOrg;
964 ULONG i;
965 BOOL bRet;
966
967 /* Check parameters */
968 if (ulMode == GRADIENT_FILL_TRIANGLE)
969 {
971
972 for (i = 0; i < nMesh; i++, pTriangle++)
973 {
974 if (pTriangle->Vertex1 >= nVertex ||
975 pTriangle->Vertex2 >= nVertex ||
976 pTriangle->Vertex3 >= nVertex)
977 {
979 return FALSE;
980 }
981 }
982 }
983 else
984 {
986 for (i = 0; i < nMesh; i++, pRect++)
987 {
988 if (pRect->UpperLeft >= nVertex || pRect->LowerRight >= nVertex)
989 {
991 return FALSE;
992 }
993 }
994 }
995
996 /* Lock the output DC */
997 pdc = DC_LockDc(hdc);
998 if(!pdc)
999 {
1001 return FALSE;
1002 }
1003
1004 if (!pdc->dclevel.pSurface)
1005 {
1006 /* Memory DC with no surface selected */
1007 DC_UnlockDc(pdc);
1008 return TRUE; // CHECKME
1009 }
1010
1011 /* Calculate extent */
1012 rclExtent.left = rclExtent.right = pVertex->x;
1013 rclExtent.top = rclExtent.bottom = pVertex->y;
1014 for (i = 0; i < nVertex; i++)
1015 {
1016 rclExtent.left = min(rclExtent.left, (pVertex + i)->x);
1017 rclExtent.right = max(rclExtent.right, (pVertex + i)->x);
1018 rclExtent.top = min(rclExtent.top, (pVertex + i)->y);
1019 rclExtent.bottom = max(rclExtent.bottom, (pVertex + i)->y);
1020 }
1021 IntLPtoDP(pdc, (LPPOINT)&rclExtent, 2);
1022
1023 rclExtent.left += pdc->ptlDCOrig.x;
1024 rclExtent.right += pdc->ptlDCOrig.x;
1025 rclExtent.top += pdc->ptlDCOrig.y;
1026 rclExtent.bottom += pdc->ptlDCOrig.y;
1027
1028 if (RECTL_bIsEmptyRect(&rclExtent))
1029 {
1030 DC_UnlockDc(pdc);
1031 return TRUE;
1032 }
1033
1034 /* Offset vertex for rectangles */
1035 if (ulMode == GRADIENT_FILL_RECT_H ||
1036 ulMode == GRADIENT_FILL_RECT_V)
1037 {
1038 for (i = 0; i < nVertex; i++)
1039 {
1040 IntLPtoDP(pdc, (LPPOINT)&pVertex[i], 1);
1041 pVertex[i].x += pdc->ptlDCOrig.x;
1042 pVertex[i].y += pdc->ptlDCOrig.y;
1043 }
1044 }
1045
1046 ptlDitherOrg.x = ptlDitherOrg.y = 0;
1047 IntLPtoDP(pdc, (LPPOINT)&ptlDitherOrg, 1);
1048
1049 ptlDitherOrg.x += pdc->ptlDCOrig.x;
1050 ptlDitherOrg.y += pdc->ptlDCOrig.y;
1051
1052 if (pdc->fs & (DC_ACCUM_APP|DC_ACCUM_WMGR))
1053 {
1054 IntUpdateBoundsRect(pdc, &rclExtent);
1055 }
1056
1057 DC_vPrepareDCsForBlit(pdc, &rclExtent, NULL, NULL);
1058
1059 psurf = pdc->dclevel.pSurface;
1060
1061 EXLATEOBJ_vInitialize(&exlo, &gpalRGB, psurf->ppal, 0, 0, 0);
1062
1063 bRet = IntEngGradientFill(&psurf->SurfObj,
1064 (CLIPOBJ *)&pdc->co,
1065 &exlo.xlo,
1066 pVertex,
1067 nVertex,
1068 pMesh,
1069 nMesh,
1070 &rclExtent,
1071 &ptlDitherOrg,
1072 ulMode);
1073
1074 EXLATEOBJ_vCleanup(&exlo);
1075 DC_vFinishBlit(pdc, NULL);
1076 DC_UnlockDc(pdc);
1077
1078 return bRet;
1079}
1080
1081BOOL
1084 HDC hdc,
1086 ULONG nVertex,
1087 PVOID pMesh,
1088 ULONG nMesh,
1089 ULONG ulMode)
1090{
1091 BOOL bRet;
1092 PTRIVERTEX SafeVertex;
1093 PVOID SafeMesh;
1094 ULONG cbVertex, cbMesh;
1095
1096 /* Validate parameters */
1097 if (!pVertex || !nVertex || !pMesh || !nMesh)
1098 {
1100 return FALSE;
1101 }
1102
1103 switch (ulMode)
1104 {
1105 case GRADIENT_FILL_RECT_H:
1106 case GRADIENT_FILL_RECT_V:
1107 cbMesh = nMesh * sizeof(GRADIENT_RECT);
1108 break;
1109 case GRADIENT_FILL_TRIANGLE:
1110 cbMesh = nMesh * sizeof(GRADIENT_TRIANGLE);
1111 break;
1112 default:
1114 return FALSE;
1115 }
1116
1117 cbVertex = nVertex * sizeof(TRIVERTEX) ;
1118 if(cbVertex + cbMesh <= cbVertex)
1119 {
1120 /* Overflow */
1121 return FALSE ;
1122 }
1123
1124 /* Allocate a kernel mode buffer */
1125 SafeVertex = ExAllocatePoolWithTag(PagedPool, cbVertex + cbMesh, TAG_SHAPE);
1126 if(!SafeVertex)
1127 {
1129 return FALSE;
1130 }
1131
1132 SafeMesh = (PVOID)((ULONG_PTR)SafeVertex + cbVertex);
1133
1134 /* Copy the parameters to kernel mode */
1135 _SEH2_TRY
1136 {
1137 ProbeForRead(pVertex, cbVertex, 1);
1138 ProbeForRead(pMesh, cbMesh, 1);
1139 RtlCopyMemory(SafeVertex, pVertex, cbVertex);
1140 RtlCopyMemory(SafeMesh, pMesh, cbMesh);
1141 }
1143 {
1144 ExFreePoolWithTag(SafeVertex, TAG_SHAPE);
1146 _SEH2_YIELD(return FALSE;)
1147 }
1148 _SEH2_END;
1149
1150 /* Call the internal function */
1151 bRet = GreGradientFill(hdc, SafeVertex, nVertex, SafeMesh, nMesh, ulMode);
1152
1153 /* Cleanup and return result */
1154 ExFreePoolWithTag(SafeVertex, TAG_SHAPE);
1155 return bRet;
1156}
1157
1160 HDC hDC,
1161 INT XStart,
1162 INT YStart,
1164 UINT FillType)
1165{
1166 PDC dc;
1167#if 0
1168 PDC_ATTR pdcattr;
1169#endif
1170 SURFACE *psurf;
1171 EXLATEOBJ exlo;
1172 BOOL Ret = FALSE;
1173 RECTL DestRect;
1174 POINTL Pt;
1175 ULONG ConvColor;
1176 PREGION prgn;
1177
1178 dc = DC_LockDc(hDC);
1179 if (!dc)
1180 {
1182 return FALSE;
1183 }
1184
1185 if (!dc->dclevel.pSurface)
1186 {
1187 Ret = TRUE;
1188 goto cleanup;
1189 }
1190
1191#if 0
1192 pdcattr = dc->pdcattr;
1193#endif
1194
1195 Pt.x = XStart;
1196 Pt.y = YStart;
1197 IntLPtoDP(dc, (LPPOINT)&Pt, 1);
1198
1199 DC_vPrepareDCsForBlit(dc, &DestRect, NULL, NULL);
1200
1201 psurf = dc->dclevel.pSurface;
1202
1203 prgn = dc->prgnRao ? dc->prgnRao : dc->prgnVis;
1204 if (prgn)
1205 {
1206 Ret = REGION_PtInRegion(prgn, Pt.x, Pt.y);
1207 if (Ret)
1208 REGION_GetRgnBox(prgn, (LPRECT)&DestRect);
1209 else
1210 {
1212 goto cleanup;
1213 }
1214 }
1215 else
1216 {
1217 RECTL_vSetRect(&DestRect, 0, 0, psurf->SurfObj.sizlBitmap.cx, psurf->SurfObj.sizlBitmap.cy);
1218 }
1219
1220 if (dc->fs & (DC_ACCUM_APP|DC_ACCUM_WMGR))
1221 {
1222 IntUpdateBoundsRect(dc, &DestRect);
1223 }
1224
1225 EXLATEOBJ_vInitialize(&exlo, &gpalRGB, psurf->ppal, 0, 0xffffff, 0);
1226
1227 /* Only solid fills supported for now
1228 * How to support pattern brushes and non standard surfaces (not offering dib functions):
1229 * Version a (most likely slow): call DrvPatBlt for every pixel
1230 * Version b: create a flood mask and let MaskBlt blit a masked brush */
1231 ConvColor = XLATEOBJ_iXlate(&exlo.xlo, Color);
1232 Ret = DIB_XXBPP_FloodFillSolid(&psurf->SurfObj, &dc->eboFill.BrushObject, &DestRect, &Pt, ConvColor, FillType);
1233
1235
1236 EXLATEOBJ_vCleanup(&exlo);
1237
1238cleanup:
1239 DC_UnlockDc(dc);
1240 return Ret;
1241}
1242
1243/* EOF */
static HDC hDC
Definition: 3dtext.c:33
static HRGN hrgn
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
static LPHIST_ENTRY Bottom
Definition: history.c:54
static LPHIST_ENTRY Top
Definition: history.c:53
HGDIOBJ hHmgr(VOID)
Definition: baseobj.hpp:95
Definition: brush.hpp:16
static BOOLEAN IntLPtoDP(DC *pdc, PPOINTL ppt, UINT count)
Definition: coord.h:182
HDC dc
Definition: cylfrac.c:34
VOID FASTCALL DC_vPrepareDCsForBlit(PDC pdcDest, const RECT *rcDest, PDC pdcSrc, const RECT *rcSrc)
Definition: dclife.c:505
VOID FASTCALL DC_vUpdateLineBrush(PDC pdc)
Definition: dcobjs.c:62
VOID FASTCALL DC_vFinishBlit(PDC pdc1, PDC pdc2)
Definition: dclife.c:614
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:238
VOID FASTCALL IntUpdateBoundsRect(PDC, PRECTL)
Definition: dcutil.c:694
VOID FASTCALL DC_vUpdateFillBrush(PDC pdc)
Definition: dcobjs.c:16
@ DC_ACCUM_APP
Definition: dc.h:25
@ DC_ACCUM_WMGR
Definition: dc.h:24
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:220
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
#define APIENTRY
Definition: api.h:79
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
static void cleanup(void)
Definition: main.c:1335
BOOL FASTCALL IntFillEllipse(PDC dc, INT XLeft, INT YLeft, INT Width, INT Height, PBRUSH pbrush)
Definition: drawing.c:1376
BOOL FASTCALL IntDrawRoundRect(PDC dc, INT Left, INT Top, INT Right, INT Bottom, INT Wellipse, INT Hellipse, PBRUSH pbrushPen)
Definition: drawing.c:1454
BOOL FASTCALL IntDrawEllipse(PDC dc, INT XLeft, INT YLeft, INT Width, INT Height, PBRUSH pbrush)
Definition: drawing.c:1364
BOOL FASTCALL IntFillRoundRect(PDC dc, INT Left, INT Top, INT Right, INT Bottom, INT Wellipse, INT Hellipse, PBRUSH pbrush)
Definition: drawing.c:1388
return ret
Definition: mutex.c:146
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define PagedPool
Definition: env_spec_w32.h:308
VOID NTAPI ProbeForRead(IN CONST VOID *Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:102
#define abs(i)
Definition: fconv.c:206
unsigned int BOOL
Definition: ntddk_ex.h:94
BOOL APIENTRY NtGdiRoundRect(HDC hDC, int LeftRect, int TopRect, int RightRect, int BottomRect, int Width, int Height)
Definition: fillshap.c:922
ULONG_PTR APIENTRY NtGdiPolyPolyDraw(IN HDC hDC, IN PPOINT UnsafePoints, IN PULONG UnsafeCounts, IN ULONG Count, IN INT iFunc)
Definition: fillshap.c:409
BOOL APIENTRY NtGdiRectangle(HDC hDC, int LeftRect, int TopRect, int RightRect, int BottomRect)
Definition: fillshap.c:752
BOOL APIENTRY NtGdiExtFloodFill(HDC hDC, INT XStart, INT YStart, COLORREF Color, UINT FillType)
Definition: fillshap.c:1159
BOOL FASTCALL IntRectangle(PDC dc, int LeftRect, int TopRect, int RightRect, int BottomRect)
Definition: fillshap.c:576
BOOL FASTCALL IntRoundRect(PDC dc, int Left, int Top, int Right, int Bottom, int xCurveDiameter, int yCurveDiameter)
Definition: fillshap.c:794
BOOL FASTCALL IntPolygon(HDC hdc, POINT *Point, int Count)
Definition: fillshap.c:199
BOOL NTAPI GreGradientFill(HDC hdc, PTRIVERTEX pVertex, ULONG nVertex, PVOID pMesh, ULONG nMesh, ULONG ulMode)
Definition: fillshap.c:951
BOOL APIENTRY NtGdiEllipse(HDC hDC, int Left, int Top, int Right, int Bottom)
Definition: fillshap.c:233
BOOL FASTCALL IntGdiPolyPolygon(DC *dc, LPPOINT Points, PULONG PolyCounts, int Count)
Definition: fillshap.c:181
BOOL APIENTRY NtGdiGradientFill(HDC hdc, PTRIVERTEX pVertex, ULONG nVertex, PVOID pMesh, ULONG nMesh, ULONG ulMode)
Definition: fillshap.c:1083
BOOL FASTCALL IntGdiPolygon(PDC dc, PPOINT Points, int Count)
Definition: fillshap.c:18
#define BRUSH_ShareLockBrush(hBrush)
Definition: brush.h:117
#define BRUSH_ShareUnlockBrush(pBrush)
Definition: brush.h:118
#define BR_IS_NULL
Definition: brush.h:105
Status
Definition: gdiplustypes.h:25
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:90
#define ROP4_FROM_INDEX(index)
Definition: inteng.h:42
#define ROP2_TO_MIX(Rop2)
Definition: inteng.h:40
@ R3_OPINDEX_PATCOPY
Definition: inteng.h:35
BOOL FASTCALL IntGdiPolyBezier(DC *dc, LPPOINT pt, DWORD Count)
Definition: line.c:262
BOOL FASTCALL IntGdiPolylineTo(DC *dc, LPPOINT pt, DWORD Count)
Definition: line.c:425
BOOL FASTCALL IntGdiPolyPolyline(DC *dc, LPPOINT pt, PULONG PolyPoints, DWORD Count)
Definition: line.c:464
BOOL FASTCALL IntGdiPolyBezierTo(DC *dc, LPPOINT pt, DWORD Count)
Definition: line.c:290
int * PINT
Definition: minwindef.h:150
#define ASSERT(a)
Definition: mode.c:44
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1109
HDC hdc
Definition: main.c:9
static HDC
Definition: imagelist.c:88
#define min(a, b)
Definition: monoChain.cc:55
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
unsigned int UINT
Definition: ndis.h:50
int Count
Definition: noreturn.cpp:7
#define FASTCALL
Definition: nt_native.h:50
#define DIRTY_FILL
Definition: ntgdihdl.h:123
#define DC_PEN_DIRTY
Definition: ntgdihdl.h:136
#define DIRTY_LINE
Definition: ntgdihdl.h:124
#define DC_BRUSH_DIRTY
Definition: ntgdihdl.h:135
@ XFORM_SCALE
Definition: ntgdityp.h:106
@ GdiPolyPolygon
Definition: ntgdityp.h:38
@ GdiPolyPolyLine
Definition: ntgdityp.h:39
@ GdiPolyBezierTo
Definition: ntgdityp.h:42
@ GdiPolyLineTo
Definition: ntgdityp.h:41
@ GdiPolyPolyRgn
Definition: ntgdityp.h:43
@ GdiPolyBezier
Definition: ntgdityp.h:40
BOOL FASTCALL IntFillPolygon(PDC dc, SURFACE *psurf, BRUSHOBJ *BrushObj, CONST PPOINT Points, int Count, RECTL DestRect, POINTL *BrushOrigin)
Definition: polyfill.c:590
#define PATH_UnlockPath(pPath)
Definition: path.h:71
#define PATH_IsPathOpen(dclevel)
Definition: path.h:72
@ PATH_Closed
Definition: path.h:20
@ DCPATH_ACTIVE
Definition: path.h:6
#define CONST
Definition: pedump.c:81
long LONG
Definition: pedump.c:60
#define PEN_ShareUnlockPen(ppen)
Definition: pen.h:18
#define IntIsEffectiveWidePen(pbrLine)
Definition: pen.h:33
#define INT
Definition: polytest.cpp:20
void IntEngLineTo(SURFOBJ *, CLIPOBJ, PBRUSHOBJ, int x1, int y1, int x2, int y2, RECTL *, MIX mix)
Definition: polytest.cpp:107
#define PBRUSHOBJ
Definition: polytest.cpp:23
BOOL FillPolygon(PDC dc, SURFOBJ *SurfObj, PBRUSHOBJ BrushObj, MIX RopMode, CONST PPOINT Points, int Count, RECTL BoundRect)
Definition: polytest.cpp:673
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:204
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:104
#define _SEH2_END
Definition: pseh2_64.h:194
#define _SEH2_TRY
Definition: pseh2_64.h:93
#define _SEH2_YIELD(__stmt)
Definition: pseh2_64.h:207
#define STATUS_SUCCESS
Definition: shellext.h:65
#define DPRINT
Definition: sndvol32.h:73
Definition: polytest.cpp:41
long bottom
Definition: polytest.cpp:53
long right
Definition: polytest.cpp:53
long top
Definition: polytest.cpp:53
long left
Definition: polytest.cpp:53
POINT ptOrigin
Definition: brush.h:24
Definition: types.h:101
HANDLE hbrush
Definition: ntgdihdl.h:295
HANDLE hpen
Definition: ntgdihdl.h:296
INT iGraphicsMode
Definition: ntgdihdl.h:306
ULONG ulDirty_
Definition: ntgdihdl.h:294
BYTE jROP2
Definition: ntgdihdl.h:307
XLATEOBJ xlo
Definition: xlateobj.h:21
ULONG LowerRight
Definition: wingdi.h:3252
ULONG UpperLeft
Definition: wingdi.h:3251
Definition: path.h:35
POINT pos
Definition: path.h:58
BASEOBJECT BaseObject
Definition: path.h:36
FLONG state
Definition: path.h:52
LONG y
Definition: windef.h:130
LONG x
Definition: windef.h:129
Definition: region.h:8
LONG cx
Definition: kdterminal.h:27
LONG cy
Definition: kdterminal.h:28
SURFOBJ SurfObj
Definition: surface.h:8
struct _PALETTE *const ppal
Definition: surface.h:11
SIZEL sizlBitmap
Definition: winddi.h:1209
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
#define max(a, b)
Definition: svc.c:63
uint32_t * PULONG
Definition: typedefs.h:59
#define NTAPI
Definition: typedefs.h:36
void * PVOID
Definition: typedefs.h:50
int32_t INT
Definition: typedefs.h:58
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define IN
Definition: typedefs.h:39
uint32_t ULONG
Definition: typedefs.h:59
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
Definition: font.h:89
_In_ HFONT _Out_ PUINT Height
Definition: font.h:88
BOOLEAN DIB_XXBPP_FloodFillSolid(SURFOBJ *, BRUSHOBJ *, RECTL *, POINTL *, ULONG, UINT)
Definition: floodfill.c:86
BOOL APIENTRY IntEngBitBlt(SURFOBJ *psoTrg, SURFOBJ *psoSrc, SURFOBJ *psoMask, CLIPOBJ *pco, XLATEOBJ *pxlo, RECTL *prclTrg, POINTL *pptlSrc, POINTL *pptlMask, BRUSHOBJ *pbo, POINTL *pptlBrush, ROP4 Rop4)
Definition: bitblt.c:656
VOID FASTCALL SetLastNtError(_In_ NTSTATUS Status)
Definition: error.c:30
BOOL APIENTRY IntEngGradientFill(IN SURFOBJ *psoDest, IN CLIPOBJ *pco, IN XLATEOBJ *pxlo, IN TRIVERTEX *pVertex, IN ULONG nVertex, IN PVOID pMesh, IN ULONG nMesh, IN RECTL *prclExtents, IN POINTL *pptlDitherOrg, IN ULONG ulMode)
Definition: gradient.c:557
PALETTE gpalRGB
Definition: palette.c:20
BOOL FASTCALL PATH_PolyPolygon(PDC dc, const POINT *pts, const INT *counts, UINT polygons)
Definition: path.c:1301
BOOL PATH_RoundRect(DC *dc, INT x1, INT y1, INT x2, INT y2, INT ell_width, INT ell_height)
Definition: path.c:685
BOOL FASTCALL PATH_Rectangle(PDC dc, INT x1, INT y1, INT x2, INT y2)
Definition: path.c:637
BOOL FASTCALL PATH_Delete(HPATH hPath)
Definition: path.c:90
BOOL PATH_Ellipse(PDC dc, INT x1, INT y1, INT x2, INT y2)
Definition: path.c:792
BOOL FASTCALL PATH_LineTo(PDC dc, INT x, INT y)
Definition: path.c:593
BOOL FASTCALL PATH_StrokePath(DC *dc, PPATH pPath)
Definition: path.c:1610
PPATH FASTCALL PATH_CreatePath(int count)
Definition: path.c:35
BOOL FASTCALL PATH_MoveTo(PDC dc, PPATH pPath)
Definition: path.c:564
PBRUSH FASTCALL PEN_ShareLockPen(HPEN hobj)
Definition: pen.c:61
FORCEINLINE VOID RECTL_vSetRect(_Out_ RECTL *prcl, _In_ LONG left, _In_ LONG top, _In_ LONG right, _In_ LONG bottom)
Definition: rect.h:5
FORCEINLINE BOOL RECTL_bIsEmptyRect(_In_ const RECTL *prcl)
Definition: rect.h:44
BOOL FASTCALL REGION_PtInRegion(PREGION prgn, INT X, INT Y)
Definition: region.c:2582
HRGN NTAPI GreCreatePolyPolygonRgn(_In_ const POINT *ppt, _In_ const ULONG *pcPoints, _In_ ULONG cPolygons, _In_ INT iMode)
Definition: region.c:3452
INT FASTCALL REGION_GetRgnBox(PREGION Rgn, PRECTL pRect)
Definition: region.c:2543
#define TAG_SHAPE
Definition: tags.h:14
_In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ TRIVERTEX _In_ ULONG _In_ PVOID pMesh
Definition: winddi.h:3653
ENGAPI ULONG APIENTRY XLATEOBJ_iXlate(_In_ XLATEOBJ *pxlo, _In_ ULONG iColor)
Definition: xlateobj.c:909
_In_ ULONG iMode
Definition: winddi.h:3520
_In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ TRIVERTEX _In_ ULONG nVertex
Definition: winddi.h:3652
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:21
_In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ TRIVERTEX _In_ ULONG _In_ PVOID _In_ ULONG _In_ RECTL _In_ POINTL _In_ ULONG ulMode
Definition: winddi.h:3657
ULONG MIX
Definition: winddi.h:129
_In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ TRIVERTEX * pVertex
Definition: winddi.h:3651
_In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ TRIVERTEX _In_ ULONG _In_ PVOID _In_ ULONG nMesh
Definition: winddi.h:3654
struct _POINTL * PPOINTL
DWORD COLORREF
Definition: windef.h:100
#define ERROR_INTERNAL_ERROR
Definition: winerror.h:1185
#define GM_COMPATIBLE
Definition: wingdi.h:864
struct _GRADIENT_TRIANGLE GRADIENT_TRIANGLE
#define PS_NULL
Definition: wingdi.h:591
struct _GRADIENT_RECT * PGRADIENT_RECT
struct _TRIVERTEX TRIVERTEX
struct _GRADIENT_TRIANGLE * PGRADIENT_TRIANGLE
#define PS_INSIDEFRAME
Definition: wingdi.h:593
struct _GRADIENT_RECT GRADIENT_RECT
VOID NTAPI EXLATEOBJ_vInitialize(_Out_ PEXLATEOBJ pexlo, _In_opt_ PALETTE *ppalSrc, _In_opt_ PALETTE *ppalDst, _In_ COLORREF crSrcBackColor, _In_ COLORREF crDstBackColor, _In_ COLORREF crDstForeColor)
Definition: xlateobj.c:491
VOID NTAPI EXLATEOBJ_vCleanup(_Inout_ PEXLATEOBJ pexlo)
Definition: xlateobj.c:894