ReactOS 0.4.16-dev-2208-g6350669
bitblt.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: GNU GPL, See COPYING in the top level directory
3 * PROJECT: ReactOS kernel
4 * PURPOSE: Bit blit functions
5 * FILE: win32ss/gdi/ntgdi/bitblt.c
6 * PROGRAMER: Unknown
7 */
8
9#include <win32k.h>
11
14 HDC hDCDest,
15 LONG XOriginDest,
16 LONG YOriginDest,
17 LONG WidthDest,
18 LONG HeightDest,
19 HDC hDCSrc,
20 LONG XOriginSrc,
21 LONG YOriginSrc,
22 LONG WidthSrc,
23 LONG HeightSrc,
26{
27 PDC DCDest;
28 PDC DCSrc;
29 HDC ahDC[2];
30 PGDIOBJ apObj[2];
31 SURFACE *BitmapDest, *BitmapSrc;
32 RECTL DestRect, SourceRect;
33 BOOL bResult;
34 EXLATEOBJ exlo;
35 BLENDOBJ BlendObj;
36 BlendObj.BlendFunction = BlendFunc;
37
38 if (WidthDest < 0 || HeightDest < 0 || WidthSrc < 0 || HeightSrc < 0)
39 {
41 return FALSE;
42 }
43
44 if ((hDCDest == NULL) || (hDCSrc == NULL))
45 {
47 return FALSE;
48 }
49
50 TRACE("Locking DCs\n");
51 ahDC[0] = hDCDest;
52 ahDC[1] = hDCSrc ;
54 {
55 WARN("Invalid dc handle (dest=0x%p, src=0x%p) passed to NtGdiAlphaBlend\n", hDCDest, hDCSrc);
57 return FALSE;
58 }
59 DCDest = apObj[0];
60 DCSrc = apObj[1];
61
62 if (DCSrc->dctype == DCTYPE_INFO || DCDest->dctype == DCTYPE_INFO)
63 {
64 GDIOBJ_vUnlockObject(&DCSrc->BaseObject);
65 GDIOBJ_vUnlockObject(&DCDest->BaseObject);
66 /* Yes, Windows really returns TRUE in this case */
67 return TRUE;
68 }
69
70 DestRect.left = XOriginDest;
71 DestRect.top = YOriginDest;
72 DestRect.right = XOriginDest + WidthDest;
73 DestRect.bottom = YOriginDest + HeightDest;
74 IntLPtoDP(DCDest, (LPPOINT)&DestRect, 2);
75
76 DestRect.left += DCDest->ptlDCOrig.x;
77 DestRect.top += DCDest->ptlDCOrig.y;
78 DestRect.right += DCDest->ptlDCOrig.x;
79 DestRect.bottom += DCDest->ptlDCOrig.y;
80
81 if (DCDest->fs & (DC_ACCUM_APP|DC_ACCUM_WMGR))
82 {
83 IntUpdateBoundsRect(DCDest, &DestRect);
84 }
85
86 SourceRect.left = XOriginSrc;
87 SourceRect.top = YOriginSrc;
88 SourceRect.right = XOriginSrc + WidthSrc;
89 SourceRect.bottom = YOriginSrc + HeightSrc;
90 IntLPtoDP(DCSrc, (LPPOINT)&SourceRect, 2);
91
92 SourceRect.left += DCSrc->ptlDCOrig.x;
93 SourceRect.top += DCSrc->ptlDCOrig.y;
94 SourceRect.right += DCSrc->ptlDCOrig.x;
95 SourceRect.bottom += DCSrc->ptlDCOrig.y;
96
97 if (!DestRect.right ||
98 !DestRect.bottom ||
99 !SourceRect.right ||
100 !SourceRect.bottom)
101 {
102 GDIOBJ_vUnlockObject(&DCSrc->BaseObject);
103 GDIOBJ_vUnlockObject(&DCDest->BaseObject);
104 return TRUE;
105 }
106
107 /* Prepare DCs for blit */
108 TRACE("Preparing DCs for blit\n");
109 DC_vPrepareDCsForBlit(DCDest, &DestRect, DCSrc, &SourceRect);
110
111 /* Determine surfaces to be used in the bitblt */
112 BitmapDest = DCDest->dclevel.pSurface;
113 if (!BitmapDest)
114 {
115 bResult = FALSE ;
116 goto leave ;
117 }
118
119 BitmapSrc = DCSrc->dclevel.pSurface;
120 if (!BitmapSrc)
121 {
122 bResult = FALSE;
123 goto leave;
124 }
125
126 /* Create the XLATEOBJ. */
127 EXLATEOBJ_vInitXlateFromDCs(&exlo, DCSrc, DCDest);
128
129 /* Perform the alpha blend operation */
130 TRACE("Performing the alpha blend\n");
131 bResult = IntEngAlphaBlend(&BitmapDest->SurfObj,
132 &BitmapSrc->SurfObj,
133 (CLIPOBJ *)&DCDest->co,
134 &exlo.xlo,
135 &DestRect,
136 &SourceRect,
137 &BlendObj);
138
139 EXLATEOBJ_vCleanup(&exlo);
140leave :
141 TRACE("Finishing blit\n");
142 DC_vFinishBlit(DCDest, DCSrc);
143 GDIOBJ_vUnlockObject(&DCSrc->BaseObject);
144 GDIOBJ_vUnlockObject(&DCDest->BaseObject);
145
146 return bResult;
147}
148
151 HDC hDCDest,
152 INT XDest,
153 INT YDest,
154 INT Width,
155 INT Height,
156 HDC hDCSrc,
157 INT XSrc,
158 INT YSrc,
159 DWORD dwRop,
160 IN DWORD crBackColor,
161 IN FLONG fl)
162{
163
164 if (dwRop & CAPTUREBLT)
165 {
166 return NtGdiStretchBlt(hDCDest,
167 XDest,
168 YDest,
169 Width,
170 Height,
171 hDCSrc,
172 XSrc,
173 YSrc,
174 Width,
175 Height,
176 dwRop,
177 crBackColor);
178 }
179
180 dwRop = dwRop & ~(NOMIRRORBITMAP|CAPTUREBLT);
181
182 /* Forward to NtGdiMaskBlt */
183 // TODO: What's fl for? LOL not to send this to MaskBit!
184 return NtGdiMaskBlt(hDCDest,
185 XDest,
186 YDest,
187 Width,
188 Height,
189 hDCSrc,
190 XSrc,
191 YSrc,
192 NULL,
193 0,
194 0,
195 MAKEROP4(dwRop, dwRop),
196 crBackColor);
197}
198
201 HDC hdcDst,
202 INT xDst,
203 INT yDst,
204 INT cxDst,
205 INT cyDst,
206 HDC hdcSrc,
207 INT xSrc,
208 INT ySrc,
209 INT cxSrc,
210 INT cySrc,
211 COLORREF TransColor)
212{
213 PDC DCDest, DCSrc;
214 HDC ahDC[2];
215 PGDIOBJ apObj[2];
216 RECTL rcDest, rcSrc;
217 SURFACE *BitmapDest, *BitmapSrc = NULL;
218 ULONG TransparentColor = 0;
219 BOOL Ret = FALSE;
220 EXLATEOBJ exlo;
221
222 if ((hdcDst == NULL) || (hdcSrc == NULL))
223 {
225 return FALSE;
226 }
227
228 TRACE("Locking DCs\n");
229 ahDC[0] = hdcDst;
230 ahDC[1] = hdcSrc ;
232 {
233 WARN("Invalid dc handle (dest=0x%p, src=0x%p) passed to NtGdiAlphaBlend\n", hdcDst, hdcSrc);
235 return FALSE;
236 }
237 DCDest = apObj[0];
238 DCSrc = apObj[1];
239
240 if (DCSrc->dctype == DCTYPE_INFO || DCDest->dctype == DCTYPE_INFO)
241 {
242 GDIOBJ_vUnlockObject(&DCSrc->BaseObject);
243 GDIOBJ_vUnlockObject(&DCDest->BaseObject);
244 /* Yes, Windows really returns TRUE in this case */
245 return TRUE;
246 }
247
248 rcDest.left = xDst;
249 rcDest.top = yDst;
250 rcDest.right = rcDest.left + cxDst;
251 rcDest.bottom = rcDest.top + cyDst;
252 IntLPtoDP(DCDest, (LPPOINT)&rcDest, 2);
253
254 rcDest.left += DCDest->ptlDCOrig.x;
255 rcDest.top += DCDest->ptlDCOrig.y;
256 rcDest.right += DCDest->ptlDCOrig.x;
257 rcDest.bottom += DCDest->ptlDCOrig.y;
258
259 rcSrc.left = xSrc;
260 rcSrc.top = ySrc;
261 rcSrc.right = rcSrc.left + cxSrc;
262 rcSrc.bottom = rcSrc.top + cySrc;
263 IntLPtoDP(DCSrc, (LPPOINT)&rcSrc, 2);
264
265 rcSrc.left += DCSrc->ptlDCOrig.x;
266 rcSrc.top += DCSrc->ptlDCOrig.y;
267 rcSrc.right += DCSrc->ptlDCOrig.x;
268 rcSrc.bottom += DCSrc->ptlDCOrig.y;
269
270 if (DCDest->fs & (DC_ACCUM_APP|DC_ACCUM_WMGR))
271 {
272 IntUpdateBoundsRect(DCDest, &rcDest);
273 }
274
275 /* Prepare for blit */
276 DC_vPrepareDCsForBlit(DCDest, &rcDest, DCSrc, &rcSrc);
277
278 BitmapDest = DCDest->dclevel.pSurface;
279 if (!BitmapDest)
280 {
281 goto done;
282 }
283
284 BitmapSrc = DCSrc->dclevel.pSurface;
285 if (!BitmapSrc)
286 {
287 goto done;
288 }
289
290 /* Translate Transparent (RGB) Color to the source palette */
291 EXLATEOBJ_vInitialize(&exlo, &gpalRGB, BitmapSrc->ppal, 0, 0, 0);
292 TransparentColor = XLATEOBJ_iXlate(&exlo.xlo, (ULONG)TransColor);
293 EXLATEOBJ_vCleanup(&exlo);
294
295 EXLATEOBJ_vInitXlateFromDCs(&exlo, DCSrc, DCDest);
296
297 Ret = IntEngTransparentBlt(&BitmapDest->SurfObj, &BitmapSrc->SurfObj,
298 (CLIPOBJ *)&DCDest->co, &exlo.xlo, &rcDest, &rcSrc,
299 TransparentColor, 0);
300
301 EXLATEOBJ_vCleanup(&exlo);
302
303done:
304 DC_vFinishBlit(DCDest, DCSrc);
305 GDIOBJ_vUnlockObject(&DCDest->BaseObject);
306 GDIOBJ_vUnlockObject(&DCSrc->BaseObject);
307
308 return Ret;
309}
310
313 HDC hdcDest,
314 INT nXDest,
315 INT nYDest,
316 INT nWidth,
317 INT nHeight,
318 HDC hdcSrc,
319 INT nXSrc,
320 INT nYSrc,
321 HBITMAP hbmMask,
322 INT xMask,
323 INT yMask,
324 DWORD dwRop4,
325 IN DWORD crBackColor)
326{
327 PDC DCDest;
328 PDC DCSrc = NULL;
329 HDC ahDC[2];
330 PGDIOBJ apObj[2];
331 PDC_ATTR pdcattr = NULL;
332 SURFACE *BitmapDest, *BitmapSrc = NULL, *psurfMask = NULL;
333 RECTL DestRect, SourceRect;
334 POINTL SourcePoint, MaskPoint;
335 BOOL Status = FALSE;
336 EXLATEOBJ exlo;
337 XLATEOBJ *XlateObj = NULL;
338 BOOL UsesSource, UsesPattern;
339 ROP4 rop4;
340
342
343 if (!hdcDest)
344 {
345 return FALSE;
346 }
347
348 UsesSource = ROP4_USES_SOURCE(rop4);
349 UsesPattern = ROP4_USES_PATTERN(rop4);
350 if (!hdcSrc && (UsesSource || UsesPattern))
351 return FALSE;
352
353 /* Check if we need a mask and have a mask bitmap */
354 if (ROP4_USES_MASK(rop4) && (hbmMask != NULL))
355 {
356 /* Reference the mask bitmap */
357 psurfMask = SURFACE_ShareLockSurface(hbmMask);
358 if (psurfMask == NULL)
359 {
361 return FALSE;
362 }
363
364 /* Make sure the mask bitmap is 1 BPP */
365 if (gajBitsPerFormat[psurfMask->SurfObj.iBitmapFormat] != 1)
366 {
369 return FALSE;
370 }
371 }
372 else
373 {
374 /* We use NULL, if we need a mask, the Eng function will take care of
375 that and use the brushobject to get a mask */
376 psurfMask = NULL;
377 }
378
379 MaskPoint.x = xMask;
380 MaskPoint.y = yMask;
381
382 /* Take care of source and destination bitmap */
383 TRACE("Locking DCs\n");
384 ahDC[0] = hdcDest;
385 ahDC[1] = UsesSource ? hdcSrc : NULL;
387 {
388 WARN("Invalid dc handle (dest=0x%p, src=0x%p) passed to NtGdiMaskBlt\n", hdcDest, hdcSrc);
389 if(psurfMask) SURFACE_ShareUnlockSurface(psurfMask);
390 return FALSE;
391 }
392 DCDest = apObj[0];
393 DCSrc = apObj[1];
394
395 ASSERT(DCDest);
396 if (NULL == DCDest)
397 {
398 if(DCSrc) DC_UnlockDc(DCSrc);
399 WARN("Invalid destination dc handle (0x%p) passed to NtGdiMaskBlt\n", hdcDest);
400 if(psurfMask) SURFACE_ShareUnlockSurface(psurfMask);
402 return FALSE;
403 }
404
405 if (DCDest->dctype == DCTYPE_INFO)
406 {
407 if(DCSrc) DC_UnlockDc(DCSrc);
408 DC_UnlockDc(DCDest);
409 /* Yes, Windows really returns TRUE in this case */
410 if(psurfMask) SURFACE_ShareUnlockSurface(psurfMask);
411 return TRUE;
412 }
413
414 if (UsesSource)
415 {
416 ASSERT(DCSrc);
417 if (DCSrc->dctype == DCTYPE_INFO)
418 {
419 DC_UnlockDc(DCDest);
420 DC_UnlockDc(DCSrc);
421 /* Yes, Windows really returns TRUE in this case */
422 if(psurfMask) SURFACE_ShareUnlockSurface(psurfMask);
423 return TRUE;
424 }
425 }
426
427 pdcattr = DCDest->pdcattr;
428
429 DestRect.left = nXDest;
430 DestRect.top = nYDest;
431 DestRect.right = nXDest + nWidth;
432 DestRect.bottom = nYDest + nHeight;
433 IntLPtoDP(DCDest, (LPPOINT)&DestRect, 2);
434
435 DestRect.left += DCDest->ptlDCOrig.x;
436 DestRect.top += DCDest->ptlDCOrig.y;
437 DestRect.right += DCDest->ptlDCOrig.x;
438 DestRect.bottom += DCDest->ptlDCOrig.y;
439
440 if (DCDest->fs & (DC_ACCUM_APP|DC_ACCUM_WMGR))
441 {
442 IntUpdateBoundsRect(DCDest, &DestRect);
443 }
444
445 SourcePoint.x = nXSrc;
446 SourcePoint.y = nYSrc;
447
448 if (UsesSource)
449 {
450 IntLPtoDP(DCSrc, (LPPOINT)&SourcePoint, 1);
451
452 SourcePoint.x += DCSrc->ptlDCOrig.x;
453 SourcePoint.y += DCSrc->ptlDCOrig.y;
454 /* Calculate Source Rect */
455 SourceRect.left = SourcePoint.x;
456 SourceRect.top = SourcePoint.y;
457 SourceRect.right = SourcePoint.x + DestRect.right - DestRect.left;
458 SourceRect.bottom = SourcePoint.y + DestRect.bottom - DestRect.top ;
459 }
460 else
461 {
462 SourceRect.left = 0;
463 SourceRect.top = 0;
464 SourceRect.right = 0;
465 SourceRect.bottom = 0;
466 }
467
468 /* Prepare blit */
469 DC_vPrepareDCsForBlit(DCDest, &DestRect, DCSrc, &SourceRect);
470
471 if (pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY))
472 DC_vUpdateFillBrush(DCDest);
473
474 /* Determine surfaces to be used in the bitblt */
475 BitmapDest = DCDest->dclevel.pSurface;
476 if (!BitmapDest)
477 goto cleanup;
478
479 if (UsesSource)
480 {
481 BitmapSrc = DCSrc->dclevel.pSurface;
482 if (!BitmapSrc)
483 goto cleanup;
484
485 /* Create the XLATEOBJ. */
486 EXLATEOBJ_vInitXlateFromDCsEx(&exlo, DCSrc, DCDest, crBackColor);
487 XlateObj = &exlo.xlo;
488 }
489
490 TRACE("DestRect: (%d,%d)-(%d,%d) and SourcePoint is (%d,%d)\n",
491 DestRect.left, DestRect.top, DestRect.right, DestRect.bottom,
492 SourcePoint.x, SourcePoint.y);
493
494 TRACE("nWidth is '%d' and nHeight is '%d'.\n", nWidth, nHeight);
495
496 /* Fix BitBlt so that it will not flip left to right */
497 if ((DestRect.left > DestRect.right) && (nWidth < 0))
498 {
499 SourcePoint.x += nWidth;
500 nWidth = -nWidth;
501 }
502
503 /* Fix BitBlt so that it will not flip top to bottom */
504 if ((DestRect.top > DestRect.bottom) && (nHeight < 0))
505 {
506 SourcePoint.y += nHeight;
507 nHeight = -nHeight;
508 }
509
510 /* Make Well Ordered so that we don't flip either way */
511 RECTL_vMakeWellOrdered(&DestRect);
512
513 /* Perform the bitblt operation */
514 Status = IntEngBitBlt(&BitmapDest->SurfObj,
515 BitmapSrc ? &BitmapSrc->SurfObj : NULL,
516 psurfMask ? &psurfMask->SurfObj : NULL,
517 (CLIPOBJ *)&DCDest->co,
518 XlateObj,
519 &DestRect,
520 &SourcePoint,
521 &MaskPoint,
522 &DCDest->eboFill.BrushObject,
523 &DCDest->dclevel.pbrFill->ptOrigin,
524 rop4);
525
526 if (UsesSource)
527 EXLATEOBJ_vCleanup(&exlo);
528cleanup:
529 DC_vFinishBlit(DCDest, DCSrc);
530 if (UsesSource)
531 {
532 DC_UnlockDc(DCSrc);
533 }
534 DC_UnlockDc(DCDest);
535 if(psurfMask) SURFACE_ShareUnlockSurface(psurfMask);
536
537 if (!Status)
539
540 return Status;
541}
542
543BOOL
546 IN HDC hdcTrg,
547 IN LPPOINT pptlTrg,
548 IN HDC hdcSrc,
549 IN INT xSrc,
550 IN INT ySrc,
551 IN INT cxSrc,
552 IN INT cySrc,
553 IN HBITMAP hbmMask,
554 IN INT xMask,
555 IN INT yMask,
556 IN DWORD crBackColor)
557{
558 FIXME("NtGdiPlgBlt: unimplemented.\n");
559 return FALSE;
560}
561
562BOOL
563NTAPI
565 HDC hDCDest,
566 INT XOriginDest,
567 INT YOriginDest,
568 INT WidthDest,
569 INT HeightDest,
570 HDC hDCSrc,
571 INT XOriginSrc,
572 INT YOriginSrc,
573 INT WidthSrc,
574 INT HeightSrc,
575 DWORD dwRop4,
576 IN DWORD dwBackColor,
577 HDC hDCMask,
578 INT XOriginMask,
579 INT YOriginMask)
580{
581 PDC DCDest;
582 PDC DCSrc = NULL;
583 PDC DCMask = NULL;
584 HDC ahDC[3];
585 PGDIOBJ apObj[3];
586 PDC_ATTR pdcattr;
587 SURFACE *BitmapDest, *BitmapSrc = NULL;
588 SURFACE *BitmapMask = NULL;
589 RECTL DestRect;
590 RECTL SourceRect;
591 POINTL MaskPoint;
592 BOOL Status = FALSE;
593 EXLATEOBJ exlo;
594 XLATEOBJ *XlateObj = NULL;
595 POINTL BrushOrigin;
596 BOOL UsesSource;
597 BOOL UsesMask;
598 ROP4 rop4;
599 BOOL Case0000, Case0101, Case1010, CaseExcept;
600
602
603 UsesSource = ROP4_USES_SOURCE(rop4);
604 UsesMask = ROP4_USES_MASK(rop4);
605
606 if (0 == WidthDest || 0 == HeightDest || 0 == WidthSrc || 0 == HeightSrc)
607 {
609 return TRUE;
610 }
611
612 if (!hDCDest || (UsesSource && !hDCSrc) || (UsesMask && !hDCMask))
613 {
615 return FALSE;
616 }
617
618 ahDC[0] = hDCDest;
619 ahDC[1] = UsesSource ? hDCSrc : NULL;
620 ahDC[2] = UsesMask ? hDCMask : NULL;
622 {
623 WARN("Invalid dc handle (dest=0x%p, src=0x%p) passed to GreStretchBltMask\n", hDCDest, hDCSrc);
625 return FALSE;
626 }
627 DCDest = apObj[0];
628 DCSrc = apObj[1];
629 DCMask = apObj[2];
630
631 if (DCDest->dctype == DCTYPE_INFO)
632 {
633 if(DCSrc) GDIOBJ_vUnlockObject(&DCSrc->BaseObject);
634 if(DCMask) GDIOBJ_vUnlockObject(&DCMask->BaseObject);
635 GDIOBJ_vUnlockObject(&DCDest->BaseObject);
636 /* Yes, Windows really returns TRUE in this case */
637 return TRUE;
638 }
639
640 if (UsesSource)
641 {
642 if (DCSrc->dctype == DCTYPE_INFO)
643 {
644 GDIOBJ_vUnlockObject(&DCDest->BaseObject);
645 GDIOBJ_vUnlockObject(&DCSrc->BaseObject);
646 if(DCMask) GDIOBJ_vUnlockObject(&DCMask->BaseObject);
647 /* Yes, Windows really returns TRUE in this case */
648 return TRUE;
649 }
650 }
651
652
653 Case0000 = ((WidthDest < 0) && (HeightDest < 0) && (WidthSrc < 0) && (HeightSrc < 0));
654 Case0101 = ((WidthDest < 0) && (HeightDest > 0) && (WidthSrc < 0) && (HeightSrc > 0));
655 Case1010 = ((WidthDest > 0) && (HeightDest < 0) && (WidthSrc > 0) && (HeightSrc < 0));
656 CaseExcept = (Case0000 || Case0101 || Case1010);
657
658 pdcattr = DCDest->pdcattr;
659
660 DestRect.left = XOriginDest;
661 DestRect.top = YOriginDest;
662 DestRect.right = XOriginDest+WidthDest;
663 DestRect.bottom = YOriginDest+HeightDest;
664
665 /* Account for possible negative span values */
666 if ((WidthDest < 0) && !CaseExcept)
667 {
668 DestRect.left++;
669 DestRect.right++;
670 }
671 if ((HeightDest < 0) && !CaseExcept)
672 {
673 DestRect.top++;
674 DestRect.bottom++;
675 }
676
677 IntLPtoDP(DCDest, (LPPOINT)&DestRect, 2);
678
679 DestRect.left += DCDest->ptlDCOrig.x;
680 DestRect.top += DCDest->ptlDCOrig.y;
681 DestRect.right += DCDest->ptlDCOrig.x;
682 DestRect.bottom += DCDest->ptlDCOrig.y;
683
684 if (DCDest->fs & (DC_ACCUM_APP|DC_ACCUM_WMGR))
685 {
686 IntUpdateBoundsRect(DCDest, &DestRect);
687 }
688
689 SourceRect.left = XOriginSrc;
690 SourceRect.top = YOriginSrc;
691 SourceRect.right = XOriginSrc+WidthSrc;
692 SourceRect.bottom = YOriginSrc+HeightSrc;
693
694 /* Account for possible negative span values */
695 if ((WidthSrc < 0) && !CaseExcept)
696 {
697 SourceRect.left++;
698 SourceRect.right++;
699 }
700 if ((HeightSrc < 0) && !CaseExcept)
701 {
702 SourceRect.top++;
703 SourceRect.bottom++;
704 }
705
706 if (UsesSource)
707 {
708 IntLPtoDP(DCSrc, (LPPOINT)&SourceRect, 2);
709
710 SourceRect.left += DCSrc->ptlDCOrig.x;
711 SourceRect.top += DCSrc->ptlDCOrig.y;
712 SourceRect.right += DCSrc->ptlDCOrig.x;
713 SourceRect.bottom += DCSrc->ptlDCOrig.y;
714 }
715
716 BrushOrigin.x = 0;
717 BrushOrigin.y = 0;
718
719 /* Only prepare Source and Dest, hdcMask represents a DIB */
720 DC_vPrepareDCsForBlit(DCDest, &DestRect, DCSrc, &SourceRect);
721
722 if (pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY))
723 DC_vUpdateFillBrush(DCDest);
724
725 /* Determine surfaces to be used in the bitblt */
726 BitmapDest = DCDest->dclevel.pSurface;
727 if (BitmapDest == NULL)
728 goto failed;
729 if (UsesSource)
730 {
731 BitmapSrc = DCSrc->dclevel.pSurface;
732 if (BitmapSrc == NULL)
733 goto failed;
734
735 /* Create the XLATEOBJ. */
736 EXLATEOBJ_vInitXlateFromDCsEx(&exlo, DCSrc, DCDest, dwBackColor);
737 XlateObj = &exlo.xlo;
738 }
739
740 /* Offset the brush */
741 BrushOrigin.x += DCDest->ptlDCOrig.x;
742 BrushOrigin.y += DCDest->ptlDCOrig.y;
743
744 /* Make mask surface for source surface */
745 if (BitmapSrc && DCMask)
746 {
747 BitmapMask = DCMask->dclevel.pSurface;
748 if (BitmapMask &&
749 (BitmapMask->SurfObj.sizlBitmap.cx < WidthSrc ||
750 BitmapMask->SurfObj.sizlBitmap.cy < HeightSrc))
751 {
752 WARN("%dx%d mask is smaller than %dx%d bitmap\n",
753 BitmapMask->SurfObj.sizlBitmap.cx, BitmapMask->SurfObj.sizlBitmap.cy,
754 WidthSrc, HeightSrc);
755 EXLATEOBJ_vCleanup(&exlo);
756 goto failed;
757 }
758 /* Create mask offset point */
759 MaskPoint.x = XOriginMask;
760 MaskPoint.y = YOriginMask;
761 IntLPtoDP(DCMask, &MaskPoint, 1);
762 MaskPoint.x += DCMask->ptlDCOrig.x;
763 MaskPoint.y += DCMask->ptlDCOrig.y;
764 }
765
766 TRACE("Calling IntEngStrethBlt SourceRect: (%d,%d)-(%d,%d) and DestRect: (%d,%d)-(%d,%d).\n",
767 SourceRect.left, SourceRect.top, SourceRect.right, SourceRect.bottom,
768 DestRect.left, DestRect.top, DestRect.right, DestRect.bottom);
769
770 /* Perform the bitblt operation */
771 Status = IntEngStretchBlt(&BitmapDest->SurfObj,
772 BitmapSrc ? &BitmapSrc->SurfObj : NULL,
773 BitmapMask ? &BitmapMask->SurfObj : NULL,
774 (CLIPOBJ *)&DCDest->co,
775 XlateObj,
776 &DCDest->dclevel.ca,
777 &DestRect,
778 &SourceRect,
779 BitmapMask ? &MaskPoint : NULL,
780 &DCDest->eboFill.BrushObject,
781 &BrushOrigin,
782 rop4);
783 if (UsesSource)
784 {
785 EXLATEOBJ_vCleanup(&exlo);
786 }
787
788failed:
789 DC_vFinishBlit(DCDest, DCSrc);
790 if (UsesSource)
791 {
792 DC_UnlockDc(DCSrc);
793 }
794 if (DCMask)
795 {
796 DC_UnlockDc(DCMask);
797 }
798 DC_UnlockDc(DCDest);
799
800 return Status;
801}
802
803
806 HDC hDCDest,
807 INT XOriginDest,
808 INT YOriginDest,
809 INT WidthDest,
810 INT HeightDest,
811 HDC hDCSrc,
812 INT XOriginSrc,
813 INT YOriginSrc,
814 INT WidthSrc,
815 INT HeightSrc,
816 DWORD dwRop3,
817 IN DWORD dwBackColor)
818{
819 dwRop3 = dwRop3 & ~(NOMIRRORBITMAP|CAPTUREBLT);
820
821 return GreStretchBltMask(
822 hDCDest,
823 XOriginDest,
824 YOriginDest,
825 WidthDest,
826 HeightDest,
827 hDCSrc,
828 XOriginSrc,
829 YOriginSrc,
830 WidthSrc,
831 HeightSrc,
832 MAKEROP4(dwRop3 & 0xFF0000, dwRop3),
833 dwBackColor,
834 NULL,
835 0,
836 0);
837}
838
839
842 PDC pdc,
843 INT XLeft,
844 INT YLeft,
845 INT Width,
846 INT Height,
847 DWORD dwRop3,
848 PEBRUSHOBJ pebo)
849{
850 RECTL DestRect;
851 SURFACE *psurf;
852 POINTL BrushOrigin;
853 BOOL ret;
854 PBRUSH pbrush;
855
856 ASSERT(pebo);
857 pbrush = pebo->pbrush;
858 ASSERT(pbrush);
859
860 if (pbrush->flAttrs & BR_IS_NULL)
861 {
862 return TRUE;
863 }
864
865 if (Width >= 0)
866 {
867 DestRect.left = XLeft;
868 DestRect.right = XLeft + Width;
869 }
870 else
871 {
872 DestRect.left = XLeft + Width;
873 DestRect.right = XLeft;
874 }
875
876 if (Height >= 0)
877 {
878 DestRect.top = YLeft;
879 DestRect.bottom = YLeft + Height;
880 }
881 else
882 {
883 DestRect.top = YLeft + Height;
884 DestRect.bottom = YLeft;
885 }
886
887 IntLPtoDP(pdc, (LPPOINT)&DestRect, 2);
888
889 DestRect.left += pdc->ptlDCOrig.x;
890 DestRect.top += pdc->ptlDCOrig.y;
891 DestRect.right += pdc->ptlDCOrig.x;
892 DestRect.bottom += pdc->ptlDCOrig.y;
893
894 if (pdc->fs & (DC_ACCUM_APP|DC_ACCUM_WMGR))
895 {
896 IntUpdateBoundsRect(pdc, &DestRect);
897 }
898
899#ifdef _USE_DIBLIB_
900 BrushOrigin.x = pbrush->ptOrigin.x + pdc->ptlDCOrig.x + XLeft;
901 BrushOrigin.y = pbrush->ptOrigin.y + pdc->ptlDCOrig.y + YLeft;
902#else
903 BrushOrigin.x = pbrush->ptOrigin.x + pdc->ptlDCOrig.x;
904 BrushOrigin.y = pbrush->ptOrigin.y + pdc->ptlDCOrig.y;
905#endif
906
907 DC_vPrepareDCsForBlit(pdc, &DestRect, NULL, NULL);
908
909 psurf = pdc->dclevel.pSurface;
910
911 ret = IntEngBitBlt(&psurf->SurfObj,
912 NULL,
913 NULL,
914 (CLIPOBJ *)&pdc->co,
915 NULL,
916 &DestRect,
917 NULL,
918 NULL,
919 &pebo->BrushObject,
920 &BrushOrigin,
921 WIN32_ROP3_TO_ENG_ROP4(dwRop3));
922
923 DC_vFinishBlit(pdc, NULL);
924
925 return ret;
926}
927
930 HDC hDC,
931 DWORD dwRop,
932 PPATRECT pRects,
933 INT cRects,
935{
936 INT i;
937 PBRUSH pbrush;
938 PDC pdc;
939 EBRUSHOBJ eboFill;
940
941 pdc = DC_LockDc(hDC);
942 if (!pdc)
943 {
945 return FALSE;
946 }
947
948 if (pdc->dctype == DCTYPE_INFO)
949 {
950 DC_UnlockDc(pdc);
951 /* Yes, Windows really returns TRUE in this case */
952 return TRUE;
953 }
954
955 for (i = 0; i < cRects; i++)
956 {
957 pbrush = BRUSH_ShareLockBrush(pRects->hBrush);
958
959 /* Check if we could lock the brush */
960 if (pbrush != NULL)
961 {
962 /* Initialize a brush object */
963 EBRUSHOBJ_vInitFromDC(&eboFill, pbrush, pdc);
964
965 IntPatBlt(
966 pdc,
967 pRects->r.left,
968 pRects->r.top,
969 pRects->r.right,
970 pRects->r.bottom,
971 dwRop,
972 &eboFill);
973
974 /* Cleanup the brush object and unlock the brush */
975 EBRUSHOBJ_vCleanup(&eboFill);
977 }
978 pRects++;
979 }
980
981 DC_UnlockDc(pdc);
982
983 return TRUE;
984}
985
986BOOL
989 _In_ HDC hdcDest,
990 _In_ INT x,
991 _In_ INT y,
992 _In_ INT cx,
993 _In_ INT cy,
994 _In_ DWORD dwRop)
995{
996 BOOL bResult;
997 PDC pdc;
998
999 /* Convert the ROP3 to a ROP4 */
1000 dwRop = MAKEROP4(dwRop & 0xFF0000, dwRop);
1001
1002 /* Check if the rop uses a source */
1003 if (WIN32_ROP4_USES_SOURCE(dwRop))
1004 {
1005 /* This is not possible */
1006 return FALSE;
1007 }
1008
1009 /* Lock the DC */
1010 pdc = DC_LockDc(hdcDest);
1011 if (pdc == NULL)
1012 {
1014 return FALSE;
1015 }
1016
1017 /* Check if the DC has no surface (empty mem or info DC) */
1018 if (pdc->dclevel.pSurface == NULL)
1019 {
1020 /* Nothing to do, Windows returns TRUE! */
1021 DC_UnlockDc(pdc);
1022 return TRUE;
1023 }
1024
1025 /* Update the fill brush, if necessary */
1026 if (pdc->pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY))
1028
1029 /* Call the internal function */
1030 bResult = IntPatBlt(pdc, x, y, cx, cy, dwRop, &pdc->eboFill);
1031
1032 /* Unlock the DC and return the result */
1033 DC_UnlockDc(pdc);
1034 return bResult;
1035}
1036
1037BOOL
1040 HDC hDC,
1041 DWORD dwRop,
1042 IN PPOLYPATBLT pRects,
1043 IN DWORD cRects,
1044 IN DWORD Mode)
1045{
1046 PPATRECT rb = NULL;
1048 BOOL Ret;
1049
1050 if (cRects > 0)
1051 {
1053 if (!rb)
1054 {
1056 return FALSE;
1057 }
1058 _SEH2_TRY
1059 {
1060 ProbeForRead(pRects,
1061 cRects * sizeof(PATRECT),
1062 1);
1063 RtlCopyMemory(rb,
1064 pRects,
1065 cRects * sizeof(PATRECT));
1066 }
1068 {
1070 }
1071 _SEH2_END;
1072
1073 if (!NT_SUCCESS(Status))
1074 {
1077 return FALSE;
1078 }
1079 }
1080
1081 Ret = IntGdiPolyPatBlt(hDC, dwRop, rb, cRects, Mode);
1082
1083 if (cRects > 0)
1085
1086 return Ret;
1087}
1088
1089static
1090BOOL
1093 _In_ PDC pdc,
1094 _Inout_ PREGION prgnDest,
1095 _In_ PREGION prgnSrc)
1096{
1097 if (IntGdiCombineRgn(prgnDest, prgnSrc, NULL, RGN_COPY) == ERROR)
1098 return FALSE;
1099
1100 return REGION_bXformRgn(prgnDest, DC_pmxWorldToDevice(pdc));
1101}
1102
1103BOOL
1106 _In_ PDC pdc,
1107 _In_ PREGION prgn,
1110 _In_ ROP4 rop4)
1111{
1112 PREGION prgnClip;
1113 XCLIPOBJ xcoClip;
1114 BOOL bResult;
1115 NT_ASSERT((pdc != NULL) && (prgn != NULL));
1116
1117 /* Check if we have a surface */
1118 if (pdc->dclevel.pSurface == NULL)
1119 {
1120 return TRUE;
1121 }
1122
1123 /* Create an empty clip region */
1124 prgnClip = IntSysCreateRectpRgn(0, 0, 0, 0);
1125 if (prgnClip == NULL)
1126 {
1127 return FALSE;
1128 }
1129
1130 /* Transform given region into device coordinates */
1131 if (!REGION_LPTODP(pdc, prgnClip, prgn))
1132 {
1133 REGION_Delete(prgnClip);
1134 return FALSE;
1135 }
1136
1137 /* Intersect with the system or RAO region (these are (atm) without DC-origin) */
1138 if (pdc->prgnRao)
1139 IntGdiCombineRgn(prgnClip, prgnClip, pdc->prgnRao, RGN_AND);
1140 else
1141 IntGdiCombineRgn(prgnClip, prgnClip, pdc->prgnVis, RGN_AND);
1142
1143 /* Now account for the DC-origin */
1144 if (!REGION_bOffsetRgn(prgnClip, pdc->ptlDCOrig.x, pdc->ptlDCOrig.y))
1145 {
1146 REGION_Delete(prgnClip);
1147 return FALSE;
1148 }
1149
1150 if (pdc->fs & (DC_ACCUM_APP|DC_ACCUM_WMGR))
1151 {
1152 RECTL rcrgn;
1153 REGION_GetRgnBox(prgnClip, &rcrgn);
1154 IntUpdateBoundsRect(pdc, &rcrgn);
1155 }
1156
1157 /* Prepare the DC */
1158 DC_vPrepareDCsForBlit(pdc, &prgnClip->rdh.rcBound, NULL, NULL);
1159
1160 /* Initialize a clip object */
1161 IntEngInitClipObj(&xcoClip);
1162 IntEngUpdateClipRegion(&xcoClip,
1163 prgnClip->rdh.nCount,
1164 prgnClip->Buffer,
1165 &prgnClip->rdh.rcBound);
1166
1167 /* Call the Eng or Drv function */
1168 bResult = IntEngBitBlt(&pdc->dclevel.pSurface->SurfObj,
1169 NULL,
1170 NULL,
1171 (CLIPOBJ *)&xcoClip,
1172 NULL,
1173 &prgnClip->rdh.rcBound,
1174 NULL,
1175 NULL,
1176 pbo,
1177 pptlBrush,
1178 rop4);
1179
1180 /* Cleanup */
1181 DC_vFinishBlit(pdc, NULL);
1182 REGION_Delete(prgnClip);
1183 IntEngFreeClipResources(&xcoClip);
1184
1185 /* Return the result */
1186 return bResult;
1187}
1188
1189BOOL
1191 _In_ PDC pdc,
1192 _In_ PREGION prgn,
1193 _In_opt_ PBRUSH pbrFill)
1194{
1195 PREGION prgnClip;
1196 XCLIPOBJ xcoClip;
1197 EBRUSHOBJ eboFill;
1198 BRUSHOBJ *pbo;
1199 BOOL bRet;
1200 DWORD rop2Fg;
1201 MIX mix;
1202 NT_ASSERT((pdc != NULL) && (prgn != NULL));
1203
1204 if (pdc->dclevel.pSurface == NULL)
1205 {
1206 return TRUE;
1207 }
1208
1209 prgnClip = IntSysCreateRectpRgn(0, 0, 0, 0);
1210 if (prgnClip == NULL)
1211 {
1212 return FALSE;
1213 }
1214
1215 /* Transform region into device coordinates */
1216 if (!REGION_LPTODP(pdc, prgnClip, prgn))
1217 {
1218 REGION_Delete(prgnClip);
1219 return FALSE;
1220 }
1221
1222 /* Intersect with the system or RAO region (these are (atm) without DC-origin) */
1223 if (pdc->prgnRao)
1224 IntGdiCombineRgn(prgnClip, prgnClip, pdc->prgnRao, RGN_AND);
1225 else
1226 IntGdiCombineRgn(prgnClip, prgnClip, pdc->prgnVis, RGN_AND);
1227
1228 /* Now account for the DC-origin */
1229 if (!REGION_bOffsetRgn(prgnClip, pdc->ptlDCOrig.x, pdc->ptlDCOrig.y))
1230 {
1231 REGION_Delete(prgnClip);
1232 return FALSE;
1233 }
1234
1235 if (pdc->fs & (DC_ACCUM_APP|DC_ACCUM_WMGR))
1236 {
1237 RECTL rcrgn;
1238 REGION_GetRgnBox(prgnClip, &rcrgn);
1239 IntUpdateBoundsRect(pdc, &rcrgn);
1240 }
1241
1242 IntEngInitClipObj(&xcoClip);
1243 IntEngUpdateClipRegion(&xcoClip,
1244 prgnClip->rdh.nCount,
1245 prgnClip->Buffer,
1246 &prgnClip->rdh.rcBound );
1247
1248 /* Get the FG rop and create a MIX based on the BK mode */
1249 rop2Fg = FIXUP_ROP2(pdc->pdcattr->jROP2);
1250 mix = rop2Fg | (pdc->pdcattr->jBkMode == OPAQUE ? rop2Fg : R2_NOP) << 8;
1251
1252 /* Prepare DC for blit */
1253 DC_vPrepareDCsForBlit(pdc, &prgnClip->rdh.rcBound, NULL, NULL);
1254
1255 /* Check if we have a fill brush */
1256 if (pbrFill != NULL)
1257 {
1258 /* Initialize the brush object */
1260 EBRUSHOBJ_vInit(&eboFill, pbrFill, pdc->dclevel.pSurface, 0x00FFFFFF, 0, NULL);
1261 pbo = &eboFill.BrushObject;
1262 }
1263 else
1264 {
1265 /* Update the fill brush if needed */
1266 if (pdc->pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY))
1268
1269 /* Use the DC brush object */
1270 pbo = &pdc->eboFill.BrushObject;
1271 }
1272
1273 /* Call the internal function */
1274 bRet = IntEngPaint(&pdc->dclevel.pSurface->SurfObj,
1275 (CLIPOBJ *)&xcoClip,
1276 pbo,
1277 &pdc->pdcattr->ptlBrushOrigin,
1278 mix);
1279
1280 DC_vFinishBlit(pdc, NULL);
1281 REGION_Delete(prgnClip);
1282 IntEngFreeClipResources(&xcoClip);
1283
1284 // Fill the region
1285 return bRet;
1286}
1287
1288BOOL
1291 _In_ PDC pdc,
1292 _In_ PREGION prgn)
1293{
1294 return IntGdiFillRgn(pdc, prgn, NULL);
1295}
1296
1297BOOL
1300 _In_ HDC hdc,
1301 _In_ HRGN hrgn,
1302 _In_ HBRUSH hbrush)
1303{
1304 PDC pdc;
1305 PREGION prgn;
1306 PBRUSH pbrFill;
1307 BOOL bResult;
1308
1309 /* Lock the DC */
1310 pdc = DC_LockDc(hdc);
1311 if (pdc == NULL)
1312 {
1313 ERR("Failed to lock hdc %p\n", hdc);
1314 return FALSE;
1315 }
1316
1317 /* Check if the DC has no surface (empty mem or info DC) */
1318 if (pdc->dclevel.pSurface == NULL)
1319 {
1320 DC_UnlockDc(pdc);
1321 return TRUE;
1322 }
1323
1324 /* Lock the region */
1325 prgn = REGION_LockRgn(hrgn);
1326 if (prgn == NULL)
1327 {
1328 ERR("Failed to lock hrgn %p\n", hrgn);
1329 DC_UnlockDc(pdc);
1330 return FALSE;
1331 }
1332
1333 /* Lock the brush */
1334 pbrFill = BRUSH_ShareLockBrush(hbrush);
1335 if (pbrFill == NULL)
1336 {
1337 ERR("Failed to lock hbrush %p\n", hbrush);
1338 REGION_UnlockRgn(prgn);
1339 DC_UnlockDc(pdc);
1340 return FALSE;
1341 }
1342
1343 /* Call the internal function */
1344 bResult = IntGdiFillRgn(pdc, prgn, pbrFill);
1345
1346 /* Cleanup locks */
1347 BRUSH_ShareUnlockBrush(pbrFill);
1348 REGION_UnlockRgn(prgn);
1349 DC_UnlockDc(pdc);
1350
1351 return bResult;
1352}
1353
1354BOOL
1357 _In_ HDC hdc,
1358 _In_ HRGN hrgn,
1359 _In_ HBRUSH hbrush,
1360 _In_ INT xWidth,
1361 _In_ INT yHeight)
1362{
1363 HRGN hrgnFrame;
1364 BOOL bResult;
1365
1366 hrgnFrame = GreCreateFrameRgn(hrgn, xWidth, yHeight);
1367 if (hrgnFrame == NULL)
1368 {
1369 return FALSE;
1370 }
1371
1372 bResult = NtGdiFillRgn(hdc, hrgnFrame, hbrush);
1373
1374 GreDeleteObject(hrgnFrame);
1375 return bResult;
1376}
1377
1378BOOL
1381 _In_ HDC hdc,
1382 _In_ HRGN hrgn)
1383{
1384 BOOL bResult;
1385 PDC pdc;
1386 PREGION prgn;
1387
1388 /* Lock the DC */
1389 pdc = DC_LockDc(hdc);
1390 if (pdc == NULL)
1391 {
1393 return FALSE;
1394 }
1395
1396 /* Check if the DC has no surface (empty mem or info DC) */
1397 if (pdc->dclevel.pSurface == NULL)
1398 {
1399 /* Nothing to do, Windows returns TRUE! */
1400 DC_UnlockDc(pdc);
1401 return TRUE;
1402 }
1403
1404 /* Lock the region */
1405 prgn = REGION_LockRgn(hrgn);
1406 if (prgn == NULL)
1407 {
1408 DC_UnlockDc(pdc);
1409 return FALSE;
1410 }
1411
1412 /* Call the internal function */
1413 bResult = IntGdiBitBltRgn(pdc,
1414 prgn,
1415 NULL, // pbo
1416 NULL, // pptlBrush,
1418
1419 /* Unlock the region and DC and return the result */
1420 REGION_UnlockRgn(prgn);
1421 DC_UnlockDc(pdc);
1422 return bResult;
1423}
1424
1428 _In_ HDC hdc,
1429 _In_ INT x,
1430 _In_ INT y,
1431 _In_ COLORREF crColor)
1432{
1433 PDC pdc;
1434 ULONG iOldColor, iSolidColor;
1435 BOOL bResult;
1436 PEBRUSHOBJ pebo;
1437 ULONG ulDirty;
1438 EXLATEOBJ exlo;
1439
1440 /* Lock the DC */
1441 pdc = DC_LockDc(hdc);
1442 if (!pdc)
1443 {
1444 return CLR_INVALID;
1445 }
1446
1447 /* Check if the DC has no surface (empty mem or info DC) */
1448 if (pdc->dclevel.pSurface == NULL)
1449 {
1450 /* Fail! */
1451 DC_UnlockDc(pdc);
1452 return CLR_INVALID;
1453 }
1454
1455 if (pdc->fs & (DC_ACCUM_APP|DC_ACCUM_WMGR))
1456 {
1457 RECTL rcDst;
1458
1459 RECTL_vSetRect(&rcDst, x, y, x+1, y+1);
1460
1461 IntLPtoDP(pdc, (LPPOINT)&rcDst, 2);
1462
1463 rcDst.left += pdc->ptlDCOrig.x;
1464 rcDst.top += pdc->ptlDCOrig.y;
1465 rcDst.right += pdc->ptlDCOrig.x;
1466 rcDst.bottom += pdc->ptlDCOrig.y;
1467
1468 IntUpdateBoundsRect(pdc, &rcDst);
1469 }
1470
1471 /* Translate the color to the target format */
1472 iSolidColor = TranslateCOLORREF(pdc, crColor);
1473
1474 /* Use the DC's text brush, which is always a solid brush */
1475 pebo = &pdc->eboText;
1476
1477 /* Save the old solid color and set the one for the pixel */
1478 iOldColor = EBRUSHOBJ_iSetSolidColor(pebo, iSolidColor);
1479
1480 /* Save dirty flags and reset dirty text brush flag */
1481 ulDirty = pdc->pdcattr->ulDirty_;
1482 pdc->pdcattr->ulDirty_ &= ~DIRTY_TEXT;
1483
1484 /* Call the internal function */
1485 bResult = IntPatBlt(pdc, x, y, 1, 1, PATCOPY, pebo);
1486
1487 /* Restore old text brush color and dirty flags */
1488 EBRUSHOBJ_iSetSolidColor(pebo, iOldColor);
1489 pdc->pdcattr->ulDirty_ = ulDirty;
1490
1492 /* Initialize an XLATEOBJ from the target surface to RGB without using BkColor */
1494 pdc->dclevel.pSurface->ppal,
1495 &gpalRGB,
1498 CLR_INVALID);
1499
1500 /* Translate the color back to RGB */
1501 crColor = XLATEOBJ_iXlate(&exlo.xlo, iSolidColor);
1502
1503 /* Cleanup and return the target format color */
1504 EXLATEOBJ_vCleanup(&exlo);
1505
1506 /* Unlock the DC */
1507 DC_UnlockDc(pdc);
1508
1509 /* Return the new RGB color or CLR_INVALID (-1) on failure */
1510 return bResult ? crColor : CLR_INVALID;
1511}
1512
1516 _In_ HDC hdc,
1517 _In_ INT x,
1518 _In_ INT y)
1519{
1520 PDC pdc;
1521 ULONG ulRGBColor = CLR_INVALID;
1522 POINTL ptlSrc;
1523 RECT rcDest;
1524 PSURFACE psurfSrc, psurfDest;
1525
1526 /* Lock the DC */
1527 pdc = DC_LockDc(hdc);
1528 if (!pdc)
1529 {
1531 return CLR_INVALID;
1532 }
1533
1534 /* Check if the DC has no surface (empty mem or info DC) */
1535 if (pdc->dclevel.pSurface == NULL)
1536 {
1537 /* Fail! */
1538 goto leave;
1539 }
1540
1541 /* Get the logical coordinates */
1542 ptlSrc.x = x;
1543 ptlSrc.y = y;
1544
1545 /* Translate coordinates to device coordinates */
1546 IntLPtoDP(pdc, &ptlSrc, 1);
1547 ptlSrc.x += pdc->ptlDCOrig.x;
1548 ptlSrc.y += pdc->ptlDCOrig.y;
1549
1550 rcDest.left = x;
1551 rcDest.top = y;
1552 rcDest.right = x + 1;
1553 rcDest.bottom = y + 1;
1554
1555 /* Prepare DC for blit */
1556 DC_vPrepareDCsForBlit(pdc, &rcDest, NULL, NULL);
1557
1558 /* Check if the pixel is outside the surface */
1559 psurfSrc = pdc->dclevel.pSurface;
1560 if ((ptlSrc.x >= psurfSrc->SurfObj.sizlBitmap.cx) ||
1561 (ptlSrc.y >= psurfSrc->SurfObj.sizlBitmap.cy) ||
1562 (ptlSrc.x < 0) ||
1563 (ptlSrc.y < 0))
1564 {
1565 /* Fail! */
1566 goto leave;
1567 }
1568
1569 /* Allocate a surface */
1571 1,
1572 1,
1573 BMF_32BPP,
1574 0,
1575 0,
1576 0,
1577 &ulRGBColor);
1578 if (psurfDest)
1579 {
1580 RECTL rclDest = {0, 0, 1, 1};
1581 EXLATEOBJ exlo;
1582
1583 /* Translate from the source palette to RGB color without BkColor */
1585 psurfSrc->ppal,
1586 &gpalRGB,
1589 CLR_INVALID);
1590
1591 /* Call the copy bits function */
1592 EngCopyBits(&psurfDest->SurfObj,
1593 &psurfSrc->SurfObj,
1594 NULL,
1595 &exlo.xlo,
1596 &rclDest,
1597 &ptlSrc);
1598
1599 /* Cleanup the XLATEOBJ */
1600 EXLATEOBJ_vCleanup(&exlo);
1601
1602 /* Delete the surface */
1603 GDIOBJ_vDeleteObject(&psurfDest->BaseObject);
1604
1605 /* The top byte is zero */
1606 ulRGBColor &= 0x00FFFFFF;
1607 }
1608
1609leave:
1610
1611 /* Unlock the DC */
1612 DC_vFinishBlit(pdc, NULL);
1613 DC_UnlockDc(pdc);
1614
1615 /* Return the new RGB color or -1 on failure */
1616 return ulRGBColor;
1617}
1618
static HDC hDC
Definition: 3dtext.c:33
static HRGN hrgn
static HBRUSH hbrush
LONG NTSTATUS
Definition: precomp.h:26
#define FIXME(fmt,...)
Definition: precomp.h:53
#define WARN(fmt,...)
Definition: precomp.h:61
#define ERR(fmt,...)
Definition: precomp.h:57
#define DBG_DEFAULT_CHANNEL(ch)
Definition: debug.h:106
#define leave
Definition: btrfs_drv.h:138
FORCEINLINE PMATRIX DC_pmxWorldToDevice(PDC pdc)
Definition: coord.h:135
static BOOLEAN IntLPtoDP(DC *pdc, PPOINTL ppt, UINT count)
Definition: coord.h:182
VOID FASTCALL DC_vPrepareDCsForBlit(PDC pdcDest, const RECT *rcDest, PDC pdcSrc, const RECT *rcSrc)
Definition: dclife.c:505
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
@ DCTYPE_INFO
Definition: dc.h:43
VOID FASTCALL DC_vUpdateFillBrush(PDC pdc)
Definition: dcobjs.c:16
@ DC_ACCUM_APP
Definition: dc.h:25
@ DC_ACCUM_WMGR
Definition: dc.h:24
ULONG TranslateCOLORREF(PDC pdc, COLORREF crColor)
Definition: dcutil.c:869
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
static const BLENDFUNCTION BlendFunc
Definition: general.c:34
#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
return ret
Definition: mutex.c:146
VOID NTAPI EBRUSHOBJ_vInitFromDC(EBRUSHOBJ *pebo, PBRUSH pbrush, PDC pdc)
Definition: engbrush.c:112
VOID NTAPI EBRUSHOBJ_vCleanup(EBRUSHOBJ *pebo)
Definition: engbrush.c:175
VOID NTAPI EBRUSHOBJ_vInit(EBRUSHOBJ *pebo, PBRUSH pbrush, PSURFACE psurf, COLORREF crBackgroundClr, COLORREF crForegroundClr, PPALETTE ppalDC)
Definition: engbrush.c:52
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define PagedPool
Definition: env_spec_w32.h:308
#define ERROR(name)
Definition: error_private.h:53
VOID NTAPI ProbeForRead(IN CONST VOID *Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:102
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
#define BRUSH_ShareLockBrush(hBrush)
Definition: brush.h:117
#define BRUSH_ShareUnlockBrush(pBrush)
Definition: brush.h:118
FORCEINLINE ULONG EBRUSHOBJ_iSetSolidColor(EBRUSHOBJ *pebo, ULONG iSolidColor)
Definition: brush.h:187
#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
_In_ ULONG Mode
Definition: hubbusif.h:303
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:90
#define ROP4_USES_PATTERN(Rop4)
Definition: inteng.h:46
BOOL FASTCALL IntEngTransparentBlt(SURFOBJ *Dest, SURFOBJ *Source, CLIPOBJ *Clip, XLATEOBJ *ColorTranslation, PRECTL DestRect, PRECTL SourceRect, ULONG iTransColor, ULONG Reserved)
Definition: transblt.c:207
BOOL APIENTRY IntEngStretchBlt(SURFOBJ *DestObj, SURFOBJ *SourceObj, SURFOBJ *Mask, CLIPOBJ *ClipRegion, XLATEOBJ *ColorTranslation, COLORADJUSTMENT *pca, RECTL *DestRect, RECTL *SourceRect, POINTL *pMaskOrigin, BRUSHOBJ *Brush, POINTL *BrushOrigin, ULONG Mode)
#define ROP4_USES_MASK(Rop4)
Definition: inteng.h:47
#define ROP4_USES_SOURCE(Rop4)
Definition: inteng.h:45
BOOL APIENTRY IntEngPaint(_In_ SURFOBJ *pso, _In_ CLIPOBJ *pco, _In_ BRUSHOBJ *pbo, _In_ POINTL *pptlBrushOrg, _In_ __in_data_source(USER_MODE) MIX mix)
Definition: paint.c:85
#define WIN32_ROP3_TO_ENG_ROP4(dwRop4)
Definition: intgdi.h:4
#define WIN32_ROP4_USES_SOURCE(Rop)
Definition: intgdi.h:7
#define FIXUP_ROP2(rop2)
Definition: intgdi.h:10
#define WIN32_ROP4_TO_ENG_ROP4(dwRop4)
Definition: intgdi.h:5
#define ASSERT(a)
Definition: mode.c:44
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1109
HDC hdc
Definition: main.c:9
static HBITMAP
Definition: button.c:44
static HDC
Definition: imagelist.c:88
#define _Inout_
Definition: no_sal2.h:162
#define _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
#define FASTCALL
Definition: nt_native.h:50
unsigned long FLONG
Definition: ntbasedef.h:378
#define DIRTY_FILL
Definition: ntgdihdl.h:123
#define DC_BRUSH_DIRTY
Definition: ntgdihdl.h:135
@ GDIObjType_DC_TYPE
Definition: ntgdityp.h:121
long LONG
Definition: pedump.c:60
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
_Out_opt_ int * cx
Definition: commctrl.h:585
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:181
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:82
#define _SEH2_END
Definition: pseh2_64.h:171
#define _SEH2_TRY
Definition: pseh2_64.h:71
#define STATUS_SUCCESS
Definition: shellext.h:65
#define TRACE(s)
Definition: solgame.cpp:4
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
BLENDFUNCTION BlendFunction
Definition: winddi.h:224
Definition: types.h:101
ULONG ulDirty_
Definition: ntgdihdl.h:294
PBRUSH pbrush
Definition: brush.h:88
BRUSHOBJ BrushObject
Definition: brush.h:71
XLATEOBJ xlo
Definition: xlateobj.h:21
RECT r
Definition: ntgdityp.h:484
HBRUSH hBrush
Definition: ntgdityp.h:485
LONG y
Definition: windef.h:130
LONG x
Definition: windef.h:129
Definition: region.h:8
RECTL * Buffer
Definition: region.h:16
RGNDATAHEADER rdh
Definition: region.h:15
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
BASEOBJECT BaseObject
Definition: surface.h:6
SIZEL sizlBitmap
Definition: winddi.h:1209
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
LONG right
Definition: windef.h:108
LONG bottom
Definition: windef.h:109
LONG top
Definition: windef.h:107
LONG left
Definition: windef.h:106
#define NTAPI
Definition: typedefs.h:36
int32_t INT
Definition: typedefs.h:58
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
#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
#define ROP4_DSTINVERT
Definition: dib.h:7
BOOL APIENTRY IntEngAlphaBlend(_Inout_ SURFOBJ *psoDest, _In_ SURFOBJ *psoSource, _In_opt_ CLIPOBJ *pco, _In_opt_ XLATEOBJ *pxlo, _In_ RECTL *prclDest, _In_ RECTL *prclSrc, _In_ BLENDOBJ *pBlendObj)
Definition: alphablend.c:198
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 IntEngUpdateClipRegion(XCLIPOBJ *Clip, ULONG count, const RECTL *pRect, const RECTL *rcBounds)
Definition: clip.c:173
VOID FASTCALL IntEngFreeClipResources(XCLIPOBJ *Clip)
Definition: clip.c:164
VOID FASTCALL IntEngInitClipObj(XCLIPOBJ *Clip)
Definition: clip.c:158
VOID FASTCALL SetLastNtError(_In_ NTSTATUS Status)
Definition: error.c:31
UCHAR gajBitsPerFormat[11]
Definition: surface.c:21
PSURFACE NTAPI SURFACE_AllocSurface(_In_ USHORT iType, _In_ ULONG cx, _In_ ULONG cy, _In_ ULONG iFormat, _In_ ULONG fjBitmap, _In_opt_ ULONG cjWidth, _In_opt_ ULONG cjBufSize, _In_opt_ PVOID pvBits)
Definition: surface.c:116
#define SURFACE_ShareUnlockSurface(pBMObj)
Definition: surface.h:102
#define SURFACE_ShareLockSurface(hBMObj)
Definition: surface.h:91
BOOL APIENTRY NtGdiPolyPatBlt(HDC hDC, DWORD dwRop, IN PPOLYPATBLT pRects, IN DWORD cRects, IN DWORD Mode)
Definition: bitblt.c:1039
BOOL APIENTRY IntGdiBitBltRgn(_In_ PDC pdc, _In_ PREGION prgn, _In_opt_ BRUSHOBJ *pbo, _In_opt_ POINTL *pptlBrush, _In_ ROP4 rop4)
Definition: bitblt.c:1105
BOOL APIENTRY NtGdiPatBlt(_In_ HDC hdcDest, _In_ INT x, _In_ INT y, _In_ INT cx, _In_ INT cy, _In_ DWORD dwRop)
Definition: bitblt.c:988
BOOL FASTCALL IntGdiPaintRgn(_In_ PDC pdc, _In_ PREGION prgn)
Definition: bitblt.c:1290
BOOL FASTCALL IntGdiPolyPatBlt(HDC hDC, DWORD dwRop, PPATRECT pRects, INT cRects, ULONG Reserved)
Definition: bitblt.c:929
static BOOL FASTCALL REGION_LPTODP(_In_ PDC pdc, _Inout_ PREGION prgnDest, _In_ PREGION prgnSrc)
Definition: bitblt.c:1092
BOOL APIENTRY NtGdiInvertRgn(_In_ HDC hdc, _In_ HRGN hrgn)
Definition: bitblt.c:1380
COLORREF APIENTRY NtGdiGetPixel(_In_ HDC hdc, _In_ INT x, _In_ INT y)
Definition: bitblt.c:1515
BOOL APIENTRY NtGdiStretchBlt(HDC hDCDest, INT XOriginDest, INT YOriginDest, INT WidthDest, INT HeightDest, HDC hDCSrc, INT XOriginSrc, INT YOriginSrc, INT WidthSrc, INT HeightSrc, DWORD dwRop3, IN DWORD dwBackColor)
Definition: bitblt.c:805
BOOL IntGdiFillRgn(_In_ PDC pdc, _In_ PREGION prgn, _In_opt_ PBRUSH pbrFill)
Definition: bitblt.c:1190
BOOL APIENTRY NtGdiMaskBlt(HDC hdcDest, INT nXDest, INT nYDest, INT nWidth, INT nHeight, HDC hdcSrc, INT nXSrc, INT nYSrc, HBITMAP hbmMask, INT xMask, INT yMask, DWORD dwRop4, IN DWORD crBackColor)
Definition: bitblt.c:312
BOOL APIENTRY NtGdiFrameRgn(_In_ HDC hdc, _In_ HRGN hrgn, _In_ HBRUSH hbrush, _In_ INT xWidth, _In_ INT yHeight)
Definition: bitblt.c:1356
BOOL FASTCALL IntPatBlt(PDC pdc, INT XLeft, INT YLeft, INT Width, INT Height, DWORD dwRop3, PEBRUSHOBJ pebo)
Definition: bitblt.c:841
BOOL APIENTRY NtGdiTransparentBlt(HDC hdcDst, INT xDst, INT yDst, INT cxDst, INT cyDst, HDC hdcSrc, INT xSrc, INT ySrc, INT cxSrc, INT cySrc, COLORREF TransColor)
Definition: bitblt.c:200
BOOL NTAPI GreStretchBltMask(HDC hDCDest, INT XOriginDest, INT YOriginDest, INT WidthDest, INT HeightDest, HDC hDCSrc, INT XOriginSrc, INT YOriginSrc, INT WidthSrc, INT HeightSrc, DWORD dwRop4, IN DWORD dwBackColor, HDC hDCMask, INT XOriginMask, INT YOriginMask)
Definition: bitblt.c:564
BOOL APIENTRY NtGdiAlphaBlend(HDC hDCDest, LONG XOriginDest, LONG YOriginDest, LONG WidthDest, LONG HeightDest, HDC hDCSrc, LONG XOriginSrc, LONG YOriginSrc, LONG WidthSrc, LONG HeightSrc, BLENDFUNCTION BlendFunc, HANDLE hcmXform)
Definition: bitblt.c:13
BOOL APIENTRY NtGdiPlgBlt(IN HDC hdcTrg, IN LPPOINT pptlTrg, IN HDC hdcSrc, IN INT xSrc, IN INT ySrc, IN INT cxSrc, IN INT cySrc, IN HBITMAP hbmMask, IN INT xMask, IN INT yMask, IN DWORD crBackColor)
Definition: bitblt.c:545
COLORREF APIENTRY NtGdiSetPixel(_In_ HDC hdc, _In_ INT x, _In_ INT y, _In_ COLORREF crColor)
Definition: bitblt.c:1427
BOOL APIENTRY NtGdiFillRgn(_In_ HDC hdc, _In_ HRGN hrgn, _In_ HBRUSH hbrush)
Definition: bitblt.c:1299
BOOL APIENTRY NtGdiBitBlt(HDC hDCDest, INT XDest, INT YDest, INT Width, INT Height, HDC hDCSrc, INT XSrc, INT YSrc, DWORD dwRop, IN DWORD crBackColor, IN FLONG fl)
Definition: bitblt.c:150
BOOL NTAPI GreDeleteObject(HGDIOBJ hobj)
Definition: gdiobj.c:1165
BOOL NTAPI GDIOBJ_bLockMultipleObjects(IN ULONG ulCount, IN HGDIOBJ *ahObj, OUT PGDIOBJ *apObj, IN UCHAR objt)
Definition: gdiobj.c:1038
VOID NTAPI GDIOBJ_vUnlockObject(POBJ pobj)
Definition: gdiobj.c:887
VOID NTAPI GDIOBJ_vDeleteObject(POBJ pobj)
Definition: gdiobj.c:1118
PALETTE gpalRGB
Definition: palette.c:20
VOID FASTCALL RECTL_vMakeWellOrdered(_Inout_ RECTL *prcl)
Definition: rect.c:81
FORCEINLINE VOID RECTL_vSetRect(_Out_ RECTL *prcl, _In_ LONG left, _In_ LONG top, _In_ LONG right, _In_ LONG bottom)
Definition: rect.h:5
VOID FASTCALL REGION_Delete(PREGION pRgn)
Definition: region.c:2449
PREGION FASTCALL REGION_LockRgn(_In_ HRGN hrgn)
Definition: region.c:2358
BOOL FASTCALL REGION_bXformRgn(_Inout_ PREGION prgn, _In_ PMATRIX pmx)
Definition: region.c:2066
VOID FASTCALL REGION_UnlockRgn(_In_ PREGION prgn)
Definition: region.c:2373
INT FASTCALL REGION_GetRgnBox(PREGION Rgn, PRECTL pRect)
Definition: region.c:2543
PREGION FASTCALL IntSysCreateRectpRgn(INT LeftRect, INT TopRect, INT RightRect, INT BottomRect)
Definition: region.c:2407
HRGN FASTCALL GreCreateFrameRgn(HRGN hrgn, INT cx, INT cy)
Definition: region.c:2025
BOOL FASTCALL REGION_bOffsetRgn(_Inout_ PREGION prgn, _In_ INT cx, _In_ INT cy)
Definition: region.c:2707
INT FASTCALL IntGdiCombineRgn(PREGION prgnDest, PREGION prgnSrc1, PREGION prgnSrc2, INT iCombineMode)
Definition: region.c:2487
#define GDITAG_PLGBLT_DATA
Definition: tags.h:151
#define STYPE_BITMAP
Definition: winddi.h:1175
_In_ PATHOBJ _In_ CLIPOBJ _In_ BRUSHOBJ _In_ POINTL _In_ MIX mix
Definition: winddi.h:3595
_In_ FLONG fl
Definition: winddi.h:1279
ENGAPI ULONG APIENTRY XLATEOBJ_iXlate(_In_ XLATEOBJ *pxlo, _In_ ULONG iColor)
Definition: xlateobj.c:909
_In_ HANDLE hcmXform
Definition: winddi.h:3687
_In_opt_ SURFOBJ _In_opt_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL _In_opt_ POINTL _In_opt_ POINTL _In_opt_ BRUSHOBJ _In_opt_ POINTL _In_ ROP4 rop4
Definition: winddi.h:3442
_In_opt_ SURFOBJ _In_opt_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL _In_opt_ POINTL _In_opt_ POINTL _In_opt_ BRUSHOBJ _In_opt_ POINTL * pptlBrush
Definition: winddi.h:3441
ENGAPI BOOL APIENTRY EngCopyBits(_In_ SURFOBJ *psoDest, _In_ SURFOBJ *psoSrc, _In_opt_ CLIPOBJ *pco, _In_opt_ XLATEOBJ *pxlo, _In_ __in_data_source(USER_MODE) RECTL *prclDest, _In_ __in_data_source(USER_MODE) POINTL *pptlSrc)
#define BMF_32BPP
Definition: winddi.h:360
_In_opt_ SURFOBJ _In_opt_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL _In_opt_ POINTL _In_opt_ POINTL _In_opt_ BRUSHOBJ * pbo
Definition: winddi.h:3440
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:22
ULONG MIX
Definition: winddi.h:129
ULONG ROP4
Definition: winddi.h:128
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
DWORD COLORREF
Definition: windef.h:100
#define NOMIRRORBITMAP
Definition: wingdi.h:1377
#define R2_NOP
Definition: wingdi.h:346
#define RGN_COPY
Definition: wingdi.h:357
#define RGN_AND
Definition: wingdi.h:356
#define CLR_INVALID
Definition: wingdi.h:883
#define PATCOPY
Definition: wingdi.h:335
#define OPAQUE
Definition: wingdi.h:949
#define CAPTUREBLT
Definition: wingdi.h:1376
#define MAKEROP4(f, b)
Definition: wingdi.h:3392
#define NT_ASSERT
Definition: rtlfuncs.h:3327
static HDC hdcSrc
Definition: xlate.c:32
static HDC hdcDst
Definition: xlate.c:32
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
VOID NTAPI EXLATEOBJ_vInitXlateFromDCsEx(_Out_ EXLATEOBJ *pexlo, _In_ PDC pdcSrc, _In_ PDC pdcDst, _In_ COLORREF crBackColor)
Definition: xlateobj.c:849
VOID NTAPI EXLATEOBJ_vInitXlateFromDCs(_Out_ EXLATEOBJ *pexlo, _In_ PDC pdcSrc, _In_ PDC pdcDst)
Definition: xlateobj.c:826