ReactOS  0.4.14-dev-50-g13bb5e2
gdibatch.c File Reference
#include <win32k.h>
#include <debug.h>
Include dependency graph for gdibatch.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

BOOL FASTCALL IntPatBlt (PDC, INT, INT, INT, INT, DWORD, PEBRUSHOBJ)
 
BOOL APIENTRY IntExtTextOutW (IN PDC, IN INT, IN INT, IN UINT, IN OPTIONAL PRECTL, IN LPCWSTR, IN INT, IN OPTIONAL LPINT, IN DWORD)
 
VOID FASTCALL DoDeviceSync (SURFOBJ *Surface, PRECTL Rect, FLONG fl)
 
VOID FASTCALL SynchronizeDriver (FLONG Flags)
 
ULONG FASTCALL GdiFlushUserBatch (PDC dc, PGDIBATCHHDR pHdr)
 
__kernel_entry NTSTATUS APIENTRY NtGdiFlush (VOID)
 
NTSTATUS APIENTRY NtGdiFlushUserBatch (VOID)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 4 of file gdibatch.c.

Function Documentation

◆ DoDeviceSync()

VOID FASTCALL DoDeviceSync ( SURFOBJ Surface,
PRECTL  Rect,
FLONG  fl 
)

Definition at line 22 of file gdibatch.c.

23 {
24  PPDEVOBJ Device = (PDEVOBJ*)Surface->hdev;
25 // No punting and "Handle to a surface, provided that the surface is device-managed.
26 // Otherwise, dhsurf is zero".
27  if (!(Device->flFlags & PDEV_DRIVER_PUNTED_CALL) && (Surface->dhsurf))
28  {
29  if (Device->DriverFunctions.SynchronizeSurface)
30  {
31  Device->DriverFunctions.SynchronizeSurface(Surface, Rect, fl);
32  }
33  else
34  {
35  if (Device->DriverFunctions.Synchronize)
36  {
37  Device->DriverFunctions.Synchronize(Surface->dhpdev, Rect);
38  }
39  }
40  }
41 }
DHPDEV dhpdev
Definition: winddi.h:1207
_In_ PIRP _In_ PDEVICE_OBJECT Device
Definition: fatprocs.h:2020
DHSURF dhsurf
Definition: winddi.h:1205
_In_ FLONG fl
Definition: winddi.h:1279
if(!(yy_init))
Definition: macro.lex.yy.c:714
HDEV hdev
Definition: winddi.h:1208

Referenced by SynchronizeDriver().

◆ GdiFlushUserBatch()

ULONG FASTCALL GdiFlushUserBatch ( PDC  dc,
PGDIBATCHHDR  pHdr 
)

Definition at line 70 of file gdibatch.c.

71 {
72  ULONG Cmd = 0, Size = 0;
73  PDC_ATTR pdcattr = NULL;
74 
75  if (dc)
76  {
77  pdcattr = dc->pdcattr;
78  }
79 
80  _SEH2_TRY
81  {
82  Cmd = pHdr->Cmd;
83  Size = pHdr->Size; // Return the full size of the structure.
84  }
86  {
87  DPRINT1("WARNING! GdiBatch Fault!\n");
88  _SEH2_YIELD(return 0;)
89  }
90  _SEH2_END;
91 
92  switch(Cmd)
93  {
94  case GdiBCPatBlt:
95  {
96  PGDIBSPATBLT pgDPB;
97  DWORD dwRop, flags;
98  HBRUSH hOrgBrush;
99  COLORREF crColor, crBkColor, crBrushClr;
100  ULONG ulForegroundClr, ulBackgroundClr, ulBrushClr;
101  if (!dc) break;
102  pgDPB = (PGDIBSPATBLT) pHdr;
103  /* Convert the ROP3 to a ROP4 */
104  dwRop = pgDPB->dwRop;
105  dwRop = MAKEROP4(dwRop & 0xFF0000, dwRop);
106  /* Check if the rop uses a source */
107  if (WIN32_ROP4_USES_SOURCE(dwRop))
108  {
109  /* This is not possible */
110  break;
111  }
112  /* Check if the DC has no surface (empty mem or info DC) */
113  if (dc->dclevel.pSurface == NULL)
114  {
115  /* Nothing to do */
116  break;
117  }
118  // Save current attributes and flags
119  crColor = dc->pdcattr->crForegroundClr;
120  crBkColor = dc->pdcattr->ulBackgroundClr;
121  crBrushClr = dc->pdcattr->crBrushClr;
122  ulForegroundClr = dc->pdcattr->ulForegroundClr;
123  ulBackgroundClr = dc->pdcattr->ulBackgroundClr;
124  ulBrushClr = dc->pdcattr->ulBrushClr;
125  hOrgBrush = dc->pdcattr->hbrush;
126  flags = dc->pdcattr->ulDirty_ & (DIRTY_BACKGROUND | DIRTY_TEXT | DIRTY_FILL | DC_BRUSH_DIRTY);
127  // Set the attribute snapshot
128  dc->pdcattr->hbrush = pgDPB->hbrush;
129  dc->pdcattr->crForegroundClr = pgDPB->crForegroundClr;
130  dc->pdcattr->crBackgroundClr = pgDPB->crBackgroundClr;
131  dc->pdcattr->crBrushClr = pgDPB->crBrushClr;
132  dc->pdcattr->ulForegroundClr = pgDPB->ulForegroundClr;
133  dc->pdcattr->ulBackgroundClr = pgDPB->ulBackgroundClr;
134  dc->pdcattr->ulBrushClr = pgDPB->ulBrushClr;
135  // Process dirty attributes if any.
136  if (dc->pdcattr->ulDirty_ & (DIRTY_FILL | DC_BRUSH_DIRTY))
138  if (dc->pdcattr->ulDirty_ & DIRTY_TEXT)
140  if (pdcattr->ulDirty_ & DIRTY_BACKGROUND)
142  /* Call the internal function */
143  IntPatBlt(dc, pgDPB->nXLeft, pgDPB->nYLeft, pgDPB->nWidth, pgDPB->nHeight, dwRop, &dc->eboFill);
144  // Restore attributes and flags
145  dc->pdcattr->hbrush = hOrgBrush;
146  dc->pdcattr->crForegroundClr = crColor;
147  dc->pdcattr->crBackgroundClr = crBkColor;
148  dc->pdcattr->crBrushClr = crBrushClr;
149  dc->pdcattr->ulForegroundClr = ulForegroundClr;
150  dc->pdcattr->ulBackgroundClr = ulBackgroundClr;
151  dc->pdcattr->ulBrushClr = ulBrushClr;
152  dc->pdcattr->ulDirty_ |= flags;
153  break;
154  }
155 
156  case GdiBCPolyPatBlt:
157  {
158  PGDIBSPPATBLT pgDPB;
159  EBRUSHOBJ eboFill;
160  PBRUSH pbrush;
161  PPATRECT pRects;
162  INT i;
163  DWORD dwRop, flags;
164  COLORREF crColor, crBkColor, crBrushClr;
165  ULONG ulForegroundClr, ulBackgroundClr, ulBrushClr;
166  if (!dc) break;
167  pgDPB = (PGDIBSPPATBLT) pHdr;
168  /* Convert the ROP3 to a ROP4 */
169  dwRop = pgDPB->rop4;
170  dwRop = MAKEROP4(dwRop & 0xFF0000, dwRop);
171  /* Check if the rop uses a source */
172  if (WIN32_ROP4_USES_SOURCE(dwRop))
173  {
174  /* This is not possible */
175  break;
176  }
177  /* Check if the DC has no surface (empty mem or info DC) */
178  if (dc->dclevel.pSurface == NULL)
179  {
180  /* Nothing to do */
181  break;
182  }
183  // Save current attributes and flags
184  crColor = dc->pdcattr->crForegroundClr;
185  crBkColor = dc->pdcattr->ulBackgroundClr;
186  crBrushClr = dc->pdcattr->crBrushClr;
187  ulForegroundClr = dc->pdcattr->ulForegroundClr;
188  ulBackgroundClr = dc->pdcattr->ulBackgroundClr;
189  ulBrushClr = dc->pdcattr->ulBrushClr;
190  flags = dc->pdcattr->ulDirty_ & (DIRTY_BACKGROUND | DIRTY_TEXT | DIRTY_FILL | DC_BRUSH_DIRTY);
191  // Set the attribute snapshot
192  dc->pdcattr->crForegroundClr = pgDPB->crForegroundClr;
193  dc->pdcattr->crBackgroundClr = pgDPB->crBackgroundClr;
194  dc->pdcattr->crBrushClr = pgDPB->crBrushClr;
195  dc->pdcattr->ulForegroundClr = pgDPB->ulForegroundClr;
196  dc->pdcattr->ulBackgroundClr = pgDPB->ulBackgroundClr;
197  dc->pdcattr->ulBrushClr = pgDPB->ulBrushClr;
198  // Process dirty attributes if any
199  if (dc->pdcattr->ulDirty_ & DIRTY_TEXT)
201  if (pdcattr->ulDirty_ & DIRTY_BACKGROUND)
203 
204  DPRINT1("GdiBCPolyPatBlt Testing\n");
205  pRects = &pgDPB->pRect[0];
206 
207  for (i = 0; i < pgDPB->Count; i++)
208  {
209  pbrush = BRUSH_ShareLockBrush(pRects->hBrush);
210 
211  /* Check if we could lock the brush */
212  if (pbrush != NULL)
213  {
214  /* Initialize a brush object */
215  EBRUSHOBJ_vInitFromDC(&eboFill, pbrush, dc);
216 
217  IntPatBlt(
218  dc,
219  pRects->r.left,
220  pRects->r.top,
221  pRects->r.right,
222  pRects->r.bottom,
223  dwRop,
224  &eboFill);
225 
226  /* Cleanup the brush object and unlock the brush */
227  EBRUSHOBJ_vCleanup(&eboFill);
228  BRUSH_ShareUnlockBrush(pbrush);
229  }
230  pRects++;
231  }
232 
233  // Restore attributes and flags
234  dc->pdcattr->crForegroundClr = crColor;
235  dc->pdcattr->crBackgroundClr = crBkColor;
236  dc->pdcattr->crBrushClr = crBrushClr;
237  dc->pdcattr->ulForegroundClr = ulForegroundClr;
238  dc->pdcattr->ulBackgroundClr = ulBackgroundClr;
239  dc->pdcattr->ulBrushClr = ulBrushClr;
240  dc->pdcattr->ulDirty_ |= flags;
241  break;
242  }
243 
244  case GdiBCTextOut:
245  {
246  PGDIBSTEXTOUT pgO;
247  COLORREF crColor = -1, crBkColor;
248  ULONG ulForegroundClr, ulBackgroundClr;
249  DWORD flags = 0, flXform = 0, saveflags, saveflXform = 0;
250  FLONG flTextAlign = -1;
251  HANDLE hlfntNew;
252  PRECTL lprc;
253  USHORT jBkMode;
254  LONG lBkMode;
255  POINTL ptlViewportOrg;
256  if (!dc) break;
257  pgO = (PGDIBSTEXTOUT) pHdr;
258 
259  // Save current attributes, flags and Set the attribute snapshots
261 
262  // In this instance check for differences and set the appropriate dirty flags.
263  if ( dc->pdcattr->crForegroundClr != pgO->crForegroundClr)
264  {
265  crColor = dc->pdcattr->crForegroundClr;
266  dc->pdcattr->crForegroundClr = pgO->crForegroundClr;
267  ulForegroundClr = dc->pdcattr->ulForegroundClr;
268  dc->pdcattr->ulForegroundClr = pgO->ulForegroundClr;
270  }
271  if (dc->pdcattr->crBackgroundClr != pgO->crBackgroundClr)
272  {
273  crBkColor = dc->pdcattr->ulBackgroundClr;
274  dc->pdcattr->crBackgroundClr = pgO->crBackgroundClr;
275  ulBackgroundClr = dc->pdcattr->ulBackgroundClr;
276  dc->pdcattr->ulBackgroundClr = pgO->ulBackgroundClr;
278  }
279  if (dc->pdcattr->flTextAlign != pgO->flTextAlign)
280  {
281  flTextAlign = dc->pdcattr->flTextAlign;
282  dc->pdcattr->flTextAlign = pgO->flTextAlign;
283  }
284  if (dc->pdcattr->hlfntNew != pgO->hlfntNew)
285  {
286  hlfntNew = dc->pdcattr->hlfntNew;
287  dc->pdcattr->hlfntNew = pgO->hlfntNew;
288  dc->pdcattr->ulDirty_ &= ~SLOW_WIDTHS;
289  flags |= DIRTY_CHARSET;
290  }
291 
292  if ( dc->pdcattr->ptlViewportOrg.x != pgO->ptlViewportOrg.x ||
293  dc->pdcattr->ptlViewportOrg.y != pgO->ptlViewportOrg.y )
294  {
295  saveflXform = dc->pdcattr->flXform & (PAGE_XLATE_CHANGED|WORLD_XFORM_CHANGED|DEVICE_TO_WORLD_INVALID);
296  ptlViewportOrg = dc->pdcattr->ptlViewportOrg;
297  dc->pdcattr->ptlViewportOrg = pgO->ptlViewportOrg;
299  }
300 
301  dc->pdcattr->flXform |= flXform;
302  dc->pdcattr->ulDirty_ |= flags;
303 
304  jBkMode = dc->pdcattr->jBkMode;
305  dc->pdcattr->jBkMode = pgO->lBkMode;
306  lBkMode = dc->pdcattr->lBkMode;
307  dc->pdcattr->lBkMode = pgO->lBkMode;
308 
309  lprc = (pgO->Options & GDIBS_NORECT) ? NULL : &pgO->Rect;
310  pgO->Options &= ~GDIBS_NORECT;
311 
313  pgO->x,
314  pgO->y,
315  pgO->Options,
316  lprc,
317  (LPCWSTR)&pgO->String[pgO->Size/sizeof(WCHAR)],
318  pgO->cbCount,
319  pgO->Size ? (LPINT)&pgO->Buffer : NULL,
320  pgO->iCS_CP );
321 
322  // Restore attributes and flags
323  dc->pdcattr->jBkMode = jBkMode;
324  dc->pdcattr->lBkMode = lBkMode;
325 
326  if (saveflXform)
327  {
328  dc->pdcattr->ptlViewportOrg = ptlViewportOrg;
329  dc->pdcattr->flXform |= saveflXform|flXform;
330  }
331 
332  if (flags & DIRTY_TEXT && crColor != -1)
333  {
334  dc->pdcattr->crForegroundClr = crColor;
335  dc->pdcattr->ulForegroundClr = ulForegroundClr;
336  }
337  if (flags & DIRTY_BACKGROUND)
338  {
339  dc->pdcattr->crBackgroundClr = crBkColor;
340  dc->pdcattr->ulBackgroundClr = ulBackgroundClr;
341  }
342  if (flTextAlign != -1)
343  {
344  dc->pdcattr->flTextAlign = flTextAlign;
345  }
346 
347  if (flags & DIRTY_CHARSET)
348  {
349  dc->pdcattr->hlfntNew = hlfntNew;
350  dc->pdcattr->ulDirty_ &= ~SLOW_WIDTHS;
351  }
352  dc->pdcattr->ulDirty_ |= saveflags | flags;
353  dc->pdcattr->flXform |= saveflXform | flXform;
354  break;
355  }
356 
357  case GdiBCExtTextOut:
358  {
359  PGDIBSEXTTEXTOUT pgO;
360  COLORREF crBkColor;
361  ULONG ulBackgroundClr;
362  POINTL ptlViewportOrg;
363  DWORD flags = 0, flXform = 0, saveflags, saveflXform = 0;
364  if (!dc) break;
365  pgO = (PGDIBSEXTTEXTOUT) pHdr;
366 
367  saveflags = dc->pdcattr->ulDirty_ & (DIRTY_BACKGROUND|DIRTY_TEXT|DIRTY_FILL|DC_BRUSH_DIRTY|DIRTY_CHARSET);
368 
369  if (dc->pdcattr->crBackgroundClr != pgO->ulBackgroundClr)
370  {
371  crBkColor = dc->pdcattr->crBackgroundClr;
372  ulBackgroundClr = dc->pdcattr->ulBackgroundClr;
373  dc->pdcattr->crBackgroundClr = pgO->ulBackgroundClr;
374  dc->pdcattr->ulBackgroundClr = pgO->ulBackgroundClr;
376  }
377 
378  if ( dc->pdcattr->ptlViewportOrg.x != pgO->ptlViewportOrg.x ||
379  dc->pdcattr->ptlViewportOrg.y != pgO->ptlViewportOrg.y )
380  {
381  saveflXform = dc->pdcattr->flXform & (PAGE_XLATE_CHANGED|WORLD_XFORM_CHANGED|DEVICE_TO_WORLD_INVALID);
382  ptlViewportOrg = dc->pdcattr->ptlViewportOrg;
383  dc->pdcattr->ptlViewportOrg = pgO->ptlViewportOrg;
385  }
386 
387  dc->pdcattr->flXform |= flXform;
388  dc->pdcattr->ulDirty_ |= flags;
389 
391  0,
392  0,
393  pgO->Options,
394  &pgO->Rect,
395  NULL,
396  pgO->Count,
397  NULL,
398  0 );
399 
400  if (saveflXform)
401  {
402  dc->pdcattr->ptlViewportOrg = ptlViewportOrg;
403  dc->pdcattr->flXform |= saveflXform|flXform;
404  }
405 
406  if (flags & DIRTY_BACKGROUND)
407  {
408  dc->pdcattr->crBackgroundClr = crBkColor;
409  dc->pdcattr->ulBackgroundClr = ulBackgroundClr;
410  }
411  dc->pdcattr->ulDirty_ |= saveflags | flags;
412  dc->pdcattr->flXform |= saveflXform | flXform;
413  break;
414  }
415 
416  case GdiBCSetBrushOrg:
417  {
418  PGDIBSSETBRHORG pgSBO;
419  if (!dc) break;
420  pgSBO = (PGDIBSSETBRHORG) pHdr;
421  pdcattr->ptlBrushOrigin = pgSBO->ptlBrushOrigin;
423  break;
424  }
425 
426  case GdiBCExtSelClipRgn:
427  {
428  PGDIBSEXTSELCLPRGN pgO;
429  if (!dc) break;
430  pgO = (PGDIBSEXTSELCLPRGN) pHdr;
431  IntGdiExtSelectClipRect( dc, &pgO->rcl, pgO->fnMode);
432  break;
433  }
434 
435  case GdiBCSelObj:
436  {
437  PGDIBSOBJECT pgO;
438 
439  if (!dc) break;
440  pgO = (PGDIBSOBJECT) pHdr;
441 
442  DC_hSelectFont(dc, (HFONT)pgO->hgdiobj);
443  break;
444  }
445 
446  case GdiBCDelRgn:
447  DPRINT("Delete Region Object!\n");
448  /* Fall through */
449  case GdiBCDelObj:
450  {
451  PGDIBSOBJECT pgO = (PGDIBSOBJECT) pHdr;
452  GreDeleteObject( pgO->hgdiobj );
453  break;
454  }
455 
456  default:
457  break;
458  }
459 
460  return Size;
461 }
ULONG Buffer[1]
Definition: ntgdityp.h:528
#define BRUSH_ShareUnlockBrush(pBrush)
Definition: brush.h:114
DWORD rop4
Definition: ntgdityp.h:490
struct _GDIBSPATBLT * PGDIBSPATBLT
COLORREF crBackgroundClr
Definition: ntgdityp.h:494
ULONG ulBackgroundClr
Definition: ntgdityp.h:539
BOOL NTAPI GreDeleteObject(HGDIOBJ hobj)
Definition: gdiobj.c:1155
PATRECT pRect[1]
Definition: ntgdityp.h:500
ULONG ulBrushClr
Definition: ntgdityp.h:498
_In_ int _Inout_ LPRECT lprc
Definition: winuser.h:4366
VOID NTAPI EBRUSHOBJ_vCleanup(EBRUSHOBJ *pebo)
Definition: engbrush.c:153
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
VOID FASTCALL DC_vUpdateBackgroundBrush(PDC pdc)
Definition: dcobjs.c:126
COLORREF crBackgroundClr
Definition: ntgdityp.h:471
SHORT Size
Definition: ntgdityp.h:457
#define BRUSH_ShareLockBrush(hBrush)
Definition: brush.h:113
#define WIN32_ROP4_USES_SOURCE(Rop)
Definition: intgdi.h:7
COLORREF crForegroundClr
Definition: ntgdityp.h:493
#define DIRTY_CHARSET
Definition: ntgdihdl.h:149
DWORD dwRop
Definition: ntgdityp.h:469
struct _GDIBSEXTTEXTOUT * PGDIBSEXTTEXTOUT
SHORT Cmd
Definition: ntgdityp.h:458
COLORREF crForegroundClr
Definition: ntgdityp.h:470
LONG top
Definition: windef.h:292
struct _GDIBSEXTSELCLPRGN * PGDIBSEXTSELCLPRGN
HDC dc
Definition: cylfrac.c:34
COLORREF crBrushClr
Definition: ntgdityp.h:472
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
struct _GDIBSOBJECT * PGDIBSOBJECT
int32_t INT
Definition: typedefs.h:56
int FASTCALL IntGdiExtSelectClipRect(PDC, PRECTL, int)
#define DIRTY_BACKGROUND
Definition: ntgdihdl.h:148
LONG lBkMode
Definition: ntgdityp.h:513
LONG y
Definition: windef.h:315
_SEH2_TRY
Definition: create.c:4250
FLONG flTextAlign
Definition: ntgdityp.h:524
struct _GDIBSTEXTOUT * PGDIBSTEXTOUT
HANDLE hbrush
Definition: ntgdityp.h:468
#define PAGE_XLATE_CHANGED
Definition: ntgdihdl.h:201
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
long LONG
Definition: pedump.c:60
DWORD Count
Definition: ntgdityp.h:492
struct _GDIBSSETBRHORG * PGDIBSSETBRHORG
ULONG ulBackgroundClr
Definition: ntgdityp.h:497
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
COLORREF crBackgroundClr
Definition: ntgdityp.h:512
struct _GDIBSPPATBLT * PGDIBSPPATBLT
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
#define MAKEROP4(f, b)
Definition: wingdi.h:2941
COLORREF crBrushClr
Definition: ntgdityp.h:495
unsigned long FLONG
Definition: ntbasedef.h:373
UINT Options
Definition: ntgdityp.h:518
ULONG ulDirty_
Definition: ntgdihdl.h:298
Definition: types.h:100
ULONG ulBackgroundClr
Definition: ntgdityp.h:515
VOID FASTCALL DC_vUpdateTextBrush(PDC pdc)
Definition: dcobjs.c:108
HBRUSH hBrush
Definition: ntgdityp.h:484
RECT r
Definition: ntgdityp.h:483
#define _SEH2_YIELD(STMT_)
Definition: pseh2_64.h:8
__wchar_t WCHAR
Definition: xmlstorage.h:180
COLORREF crForegroundClr
Definition: ntgdityp.h:511
HGDIOBJ hgdiobj
Definition: ntgdityp.h:559
DWORD COLORREF
Definition: windef.h:285
unsigned long DWORD
Definition: ntddk_ex.h:95
LONG x
Definition: windef.h:314
#define GDIBS_NORECT
Definition: ntgdityp.h:506
POINTL ptlViewportOrg
Definition: ntgdityp.h:538
GLbitfield flags
Definition: glext.h:7161
#define DIRTY_TEXT
Definition: ntgdihdl.h:147
#define DIRTY_FILL
Definition: ntgdihdl.h:145
BOOL APIENTRY IntExtTextOutW(IN PDC, IN INT, IN INT, IN UINT, IN OPTIONAL PRECTL, IN LPCWSTR, IN INT, IN OPTIONAL LPINT, IN DWORD)
Definition: freetype.c:6032
#define SLOW_WIDTHS
Definition: ntgdihdl.h:150
Definition: sacdrv.h:277
HANDLE hlfntNew
Definition: ntgdityp.h:523
ULONG ulBackgroundClr
Definition: ntgdityp.h:476
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
POINTL ptlBrushOrigin
Definition: ntgdihdl.h:353
WCHAR String[2]
Definition: ntgdityp.h:527
VOID NTAPI DC_vSetBrushOrigin(PDC pdc, LONG x, LONG y)
Definition: dcobjs.c:142
POINTL ptlViewportOrg
Definition: ntgdityp.h:525
ULONG ulBrushClr
Definition: ntgdityp.h:477
DWORD iCS_CP
Definition: ntgdityp.h:520
#define WORLD_XFORM_CHANGED
Definition: ntgdihdl.h:203
_SEH2_END
Definition: create.c:4424
VOID NTAPI EBRUSHOBJ_vInitFromDC(EBRUSHOBJ *pebo, PBRUSH pbrush, PDC pdc)
Definition: engbrush.c:112
unsigned short USHORT
Definition: pedump.c:61
ULONG ulForegroundClr
Definition: ntgdityp.h:475
#define DC_BRUSH_DIRTY
Definition: ntgdihdl.h:157
#define DPRINT1
Definition: precomp.h:8
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
#define DEVICE_TO_WORLD_INVALID
Definition: ntgdihdl.h:192
POINTL ptlBrushOrigin
Definition: ntgdityp.h:545
unsigned int ULONG
Definition: retypes.h:1
UINT cbCount
Definition: ntgdityp.h:521
LONG bottom
Definition: windef.h:294
#define DIRTY_LINE
Definition: ntgdihdl.h:146
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
ULONG ulForegroundClr
Definition: ntgdityp.h:514
BOOL FASTCALL IntPatBlt(PDC, INT, INT, INT, INT, DWORD, PEBRUSHOBJ)
Definition: bitblt.c:777
VOID FASTCALL DC_vUpdateFillBrush(PDC pdc)
Definition: dcobjs.c:16
int * LPINT
Definition: windef.h:178
ULONG ulForegroundClr
Definition: ntgdityp.h:496
HFONT NTAPI DC_hSelectFont(_In_ PDC pdc, _In_ HFONT hlfntNew)
Definition: dcobjs.c:550

Referenced by NtGdiFlushUserBatch().

◆ IntExtTextOutW()

BOOL APIENTRY IntExtTextOutW ( IN  PDC,
IN  INT,
IN  INT,
IN  UINT,
IN OPTIONAL  PRECTL,
IN  LPCWSTR,
IN  INT,
IN OPTIONAL  LPINT,
IN  DWORD 
)

Definition at line 6032 of file freetype.c.

6042 {
6043  /*
6044  * FIXME:
6045  * Call EngTextOut, which does the real work (calling DrvTextOut where
6046  * appropriate)
6047  */
6048 
6049  PDC_ATTR pdcattr;
6050  SURFOBJ *SurfObj;
6051  SURFACE *psurf = NULL;
6052  int error, glyph_index, i;
6053  FT_Face face;
6054  FT_GlyphSlot glyph;
6055  FT_BitmapGlyph realglyph;
6056  LONGLONG TextLeft, RealXStart;
6057  ULONG TextTop, previous, BackgroundLeft;
6058  FT_Bool use_kerning;
6059  RECTL DestRect, MaskRect;
6060  POINTL SourcePoint, BrushOrigin;
6061  HBITMAP HSourceGlyph;
6062  SURFOBJ *SourceGlyphSurf;
6063  SIZEL bitSize;
6064  INT yoff;
6065  FONTOBJ *FontObj;
6066  PFONTGDI FontGDI;
6067  PTEXTOBJ TextObj = NULL;
6068  EXLATEOBJ exloRGB2Dst, exloDst2RGB;
6069  FT_Render_Mode RenderMode;
6070  BOOLEAN Render;
6071  POINT Start;
6072  BOOL DoBreak = FALSE;
6073  USHORT DxShift;
6074  PMATRIX pmxWorldToDevice;
6075  LONG fixAscender, fixDescender;
6076  FLOATOBJ Scale;
6077  LOGFONTW *plf;
6078  BOOL EmuBold, EmuItalic;
6079  int thickness;
6080  BOOL bResult;
6081 
6082  /* Check if String is valid */
6083  if ((Count > 0xFFFF) || (Count > 0 && String == NULL))
6084  {
6086  return FALSE;
6087  }
6088 
6089  Render = IntIsFontRenderingEnabled();
6090 
6091  if (PATH_IsPathOpen(dc->dclevel))
6092  {
6093  bResult = PATH_ExtTextOut(dc,
6094  XStart,
6095  YStart,
6096  fuOptions,
6097  (const RECTL *)lprc,
6098  String,
6099  Count,
6100  (const INT *)Dx);
6101  return bResult;
6102  }
6103 
6105 
6106  if (!dc->dclevel.pSurface)
6107  {
6108  /* Memory DC with no surface selected */
6109  bResult = TRUE;
6110  goto Cleanup;
6111  }
6112 
6113  pdcattr = dc->pdcattr;
6114 
6115  if (lprc && (fuOptions & (ETO_OPAQUE | ETO_CLIPPED)))
6116  {
6117  IntLPtoDP(dc, (POINT *)lprc, 2);
6118  }
6119 
6120  if (pdcattr->flTextAlign & TA_UPDATECP)
6121  {
6122  Start.x = pdcattr->ptlCurrent.x;
6123  Start.y = pdcattr->ptlCurrent.y;
6124  } else {
6125  Start.x = XStart;
6126  Start.y = YStart;
6127  }
6128 
6129  IntLPtoDP(dc, &Start, 1);
6130  RealXStart = ((LONGLONG)Start.x + dc->ptlDCOrig.x) << 6;
6131  YStart = Start.y + dc->ptlDCOrig.y;
6132 
6133  SourcePoint.x = 0;
6134  SourcePoint.y = 0;
6135  MaskRect.left = 0;
6136  MaskRect.top = 0;
6137  BrushOrigin.x = 0;
6138  BrushOrigin.y = 0;
6139 
6140  if ((fuOptions & ETO_OPAQUE) && lprc)
6141  {
6142  DestRect.left = lprc->left;
6143  DestRect.top = lprc->top;
6144  DestRect.right = lprc->right;
6145  DestRect.bottom = lprc->bottom;
6146 
6147  DestRect.left += dc->ptlDCOrig.x;
6148  DestRect.top += dc->ptlDCOrig.y;
6149  DestRect.right += dc->ptlDCOrig.x;
6150  DestRect.bottom += dc->ptlDCOrig.y;
6151 
6152  if (dc->fs & (DC_ACCUM_APP|DC_ACCUM_WMGR))
6153  {
6154  IntUpdateBoundsRect(dc, &DestRect);
6155  }
6156 
6157  if (pdcattr->ulDirty_ & DIRTY_BACKGROUND)
6159  if (dc->dctype == DCTYPE_DIRECT)
6160  MouseSafetyOnDrawStart(dc->ppdev, DestRect.left, DestRect.top, DestRect.right, DestRect.bottom);
6161 
6162  psurf = dc->dclevel.pSurface;
6163  IntEngBitBlt(
6164  &psurf->SurfObj,
6165  NULL,
6166  NULL,
6167  (CLIPOBJ *)&dc->co,
6168  NULL,
6169  &DestRect,
6170  &SourcePoint,
6171  &SourcePoint,
6172  &dc->eboBackground.BrushObject,
6173  &BrushOrigin,
6175 
6176  if (dc->dctype == DCTYPE_DIRECT)
6177  MouseSafetyOnDrawEnd(dc->ppdev);
6178 
6179  fuOptions &= ~ETO_OPAQUE;
6180  }
6181  else
6182  {
6183  if (pdcattr->jBkMode == OPAQUE)
6184  {
6185  fuOptions |= ETO_OPAQUE;
6186  }
6187  }
6188 
6189  TextObj = RealizeFontInit(pdcattr->hlfntNew);
6190  if (TextObj == NULL)
6191  {
6192  bResult = FALSE;
6193  goto Cleanup;
6194  }
6195 
6196  FontObj = TextObj->Font;
6197  ASSERT(FontObj);
6198  FontGDI = ObjToGDI(FontObj, FONT);
6199  ASSERT(FontGDI);
6200 
6201  IntLockFreeType();
6202  face = FontGDI->SharedFace->Face;
6203 
6204  plf = &TextObj->logfont.elfEnumLogfontEx.elfLogFont;
6205  EmuBold = EMUBOLD_NEEDED(FontGDI->OriginalWeight, plf->lfWeight);
6206  EmuItalic = (plf->lfItalic && !FontGDI->OriginalItalic);
6207 
6208  if (Render)
6209  RenderMode = IntGetFontRenderMode(plf);
6210  else
6211  RenderMode = FT_RENDER_MODE_MONO;
6212 
6213  if (!TextIntUpdateSize(dc, TextObj, FontGDI, FALSE))
6214  {
6216  bResult = FALSE;
6217  goto Cleanup;
6218  }
6219 
6220  /* NOTE: Don't trust face->size->metrics.ascender and descender values. */
6221  if (dc->pdcattr->iGraphicsMode == GM_ADVANCED)
6222  {
6223  pmxWorldToDevice = DC_pmxWorldToDevice(dc);
6224  FtSetCoordinateTransform(face, pmxWorldToDevice);
6225 
6226  fixAscender = ScaleLong(FontGDI->tmAscent, &pmxWorldToDevice->efM22) << 6;
6227  fixDescender = ScaleLong(FontGDI->tmDescent, &pmxWorldToDevice->efM22) << 6;
6228  }
6229  else
6230  {
6231  pmxWorldToDevice = (PMATRIX)&gmxWorldToDeviceDefault;
6232  FtSetCoordinateTransform(face, pmxWorldToDevice);
6233 
6234  fixAscender = FontGDI->tmAscent << 6;
6235  fixDescender = FontGDI->tmDescent << 6;
6236  }
6237 
6238  /*
6239  * Process the vertical alignment and determine the yoff.
6240  */
6241 #define VALIGN_MASK (TA_TOP | TA_BASELINE | TA_BOTTOM)
6242  if ((pdcattr->flTextAlign & VALIGN_MASK) == TA_BASELINE)
6243  yoff = 0;
6244  else if ((pdcattr->flTextAlign & VALIGN_MASK) == TA_BOTTOM)
6245  yoff = -(fixDescender >> 6);
6246  else /* TA_TOP */
6247  yoff = fixAscender >> 6;
6248 #undef VALIGN_MASK
6249 
6250  use_kerning = FT_HAS_KERNING(face);
6251  previous = 0;
6252 
6253  /*
6254  * Process the horizontal alignment and modify XStart accordingly.
6255  */
6256  DxShift = fuOptions & ETO_PDY ? 1 : 0;
6257  if (pdcattr->flTextAlign & (TA_RIGHT | TA_CENTER))
6258  {
6259  ULONGLONG TextWidth = 0;
6260  LPCWSTR TempText = String;
6261  int iStart;
6262 
6263  /*
6264  * Calculate width of the text.
6265  */
6266 
6267  if (NULL != Dx)
6268  {
6269  iStart = Count < 2 ? 0 : Count - 2;
6270  TextWidth = Count < 2 ? 0 : (Dx[(Count-2)<<DxShift] << 6);
6271  }
6272  else
6273  {
6274  iStart = 0;
6275  }
6276  TempText = String + iStart;
6277 
6278  for (i = iStart; i < Count; i++)
6279  {
6280  glyph_index = get_glyph_index_flagged(face, *TempText, ETO_GLYPH_INDEX, fuOptions);
6281 
6282  if (EmuBold || EmuItalic)
6283  realglyph = NULL;
6284  else
6285  realglyph = ftGdiGlyphCacheGet(face, glyph_index, plf->lfHeight,
6286  RenderMode, pmxWorldToDevice);
6287  if (!realglyph)
6288  {
6289  error = FT_Load_Glyph(face, glyph_index, FT_LOAD_DEFAULT);
6290  if (error)
6291  {
6292  DPRINT1("WARNING: Failed to load and render glyph! [index: %d]\n", glyph_index);
6293  }
6294 
6295  glyph = face->glyph;
6296  if (EmuBold || EmuItalic)
6297  {
6298  if (EmuBold)
6299  FT_GlyphSlot_Embolden(glyph);
6300  if (EmuItalic)
6301  FT_GlyphSlot_Oblique(glyph);
6302  realglyph = ftGdiGlyphSet(face, glyph, RenderMode);
6303  }
6304  else
6305  {
6306  realglyph = ftGdiGlyphCacheSet(face,
6307  glyph_index,
6308  plf->lfHeight,
6309  pmxWorldToDevice,
6310  glyph,
6311  RenderMode);
6312  }
6313  if (!realglyph)
6314  {
6315  DPRINT1("Failed to render glyph! [index: %d]\n", glyph_index);
6317  goto Cleanup;
6318  }
6319 
6320  }
6321  /* Retrieve kerning distance */
6322  if (use_kerning && previous && glyph_index)
6323  {
6324  FT_Vector delta;
6325  FT_Get_Kerning(face, previous, glyph_index, 0, &delta);
6326  TextWidth += delta.x;
6327  }
6328 
6329  TextWidth += realglyph->root.advance.x >> 10;
6330 
6331  if (EmuBold || EmuItalic)
6332  {
6333  FT_Done_Glyph((FT_Glyph)realglyph);
6334  realglyph = NULL;
6335  }
6336 
6337  previous = glyph_index;
6338  TempText++;
6339  }
6340 
6341  previous = 0;
6342 
6343  if ((pdcattr->flTextAlign & TA_CENTER) == TA_CENTER)
6344  {
6345  RealXStart -= TextWidth / 2;
6346  }
6347  else
6348  {
6349  RealXStart -= TextWidth;
6350  }
6351  }
6352 
6353  psurf = dc->dclevel.pSurface;
6354  SurfObj = &psurf->SurfObj ;
6355 
6356  if ((fuOptions & ETO_OPAQUE) && (dc->pdcattr->ulDirty_ & DIRTY_BACKGROUND))
6358 
6359  if(dc->pdcattr->ulDirty_ & DIRTY_TEXT)
6361 
6362  if (!face->units_per_EM)
6363  {
6364  thickness = 1;
6365  }
6366  else
6367  {
6368  thickness = face->underline_thickness *
6369  face->size->metrics.y_ppem / face->units_per_EM;
6370  if (thickness <= 0)
6371  thickness = 1;
6372  }
6373 
6374  if ((fuOptions & ETO_OPAQUE) && plf->lfItalic)
6375  {
6376  /* Draw background */
6377  TextLeft = RealXStart;
6378  TextTop = YStart;
6379  BackgroundLeft = (RealXStart + 32) >> 6;
6380  for (i = 0; i < Count; ++i)
6381  {
6382  glyph_index = get_glyph_index_flagged(face, String[i], ETO_GLYPH_INDEX, fuOptions);
6383 
6384  error = FT_Load_Glyph(face, glyph_index, FT_LOAD_DEFAULT);
6385  if (error)
6386  {
6387  DPRINT1("Failed to load and render glyph! [index: %d]\n", glyph_index);
6389  goto Cleanup;
6390  }
6391 
6392  glyph = face->glyph;
6393  if (EmuBold)
6394  FT_GlyphSlot_Embolden(glyph);
6395  if (EmuItalic)
6396  FT_GlyphSlot_Oblique(glyph);
6397  realglyph = ftGdiGlyphSet(face, glyph, RenderMode);
6398  if (!realglyph)
6399  {
6400  DPRINT1("Failed to render glyph! [index: %d]\n", glyph_index);
6402  goto Cleanup;
6403  }
6404 
6405  /* retrieve kerning distance and move pen position */
6406  if (use_kerning && previous && glyph_index && NULL == Dx)
6407  {
6408  FT_Vector delta;
6409  FT_Get_Kerning(face, previous, glyph_index, 0, &delta);
6410  TextLeft += delta.x;
6411  }
6412  DPRINT("TextLeft: %I64d\n", TextLeft);
6413  DPRINT("TextTop: %lu\n", TextTop);
6414  DPRINT("Advance: %d\n", realglyph->root.advance.x);
6415 
6416  DestRect.left = BackgroundLeft;
6417  DestRect.right = (TextLeft + (realglyph->root.advance.x >> 10) + 32) >> 6;
6418  DestRect.top = TextTop + yoff - ((fixAscender + 32) >> 6);
6419  DestRect.bottom = DestRect.top + ((fixAscender + fixDescender) >> 6);
6420  MouseSafetyOnDrawStart(dc->ppdev, DestRect.left, DestRect.top, DestRect.right, DestRect.bottom);
6421  if (dc->fs & (DC_ACCUM_APP|DC_ACCUM_WMGR))
6422  {
6423  IntUpdateBoundsRect(dc, &DestRect);
6424  }
6425  IntEngBitBlt(
6426  &psurf->SurfObj,
6427  NULL,
6428  NULL,
6429  (CLIPOBJ *)&dc->co,
6430  NULL,
6431  &DestRect,
6432  &SourcePoint,
6433  &SourcePoint,
6434  &dc->eboBackground.BrushObject,
6435  &BrushOrigin,
6437  MouseSafetyOnDrawEnd(dc->ppdev);
6438  BackgroundLeft = DestRect.right;
6439 
6440  DestRect.left = ((TextLeft + 32) >> 6) + realglyph->left;
6441  DestRect.right = DestRect.left + realglyph->bitmap.width;
6442  DestRect.top = TextTop + yoff - realglyph->top;
6443  DestRect.bottom = DestRect.top + realglyph->bitmap.rows;
6444 
6445  bitSize.cx = realglyph->bitmap.width;
6446  bitSize.cy = realglyph->bitmap.rows;
6447  MaskRect.right = realglyph->bitmap.width;
6448  MaskRect.bottom = realglyph->bitmap.rows;
6449 
6450  if (NULL == Dx)
6451  {
6452  TextLeft += realglyph->root.advance.x >> 10;
6453  DPRINT("New TextLeft: %I64d\n", TextLeft);
6454  }
6455  else
6456  {
6457  // FIXME this should probably be a matrix transform with TextTop as well.
6458  Scale = pdcattr->mxWorldToDevice.efM11;
6459  if (FLOATOBJ_Equal0(&Scale))
6460  FLOATOBJ_Set1(&Scale);
6461 
6462  /* do the shift before multiplying to preserve precision */
6463  FLOATOBJ_MulLong(&Scale, Dx[i<<DxShift] << 6);
6464  TextLeft += FLOATOBJ_GetLong(&Scale);
6465  DPRINT("New TextLeft2: %I64d\n", TextLeft);
6466  }
6467 
6468  if (DxShift)
6469  {
6470  TextTop -= Dx[2 * i + 1] << 6;
6471  }
6472 
6473  previous = glyph_index;
6474 
6475  if (EmuBold || EmuItalic)
6476  {
6477  FT_Done_Glyph((FT_Glyph)realglyph);
6478  realglyph = NULL;
6479  }
6480  }
6481  }
6482 
6483  EXLATEOBJ_vInitialize(&exloRGB2Dst, &gpalRGB, psurf->ppal, 0, 0, 0);
6484  EXLATEOBJ_vInitialize(&exloDst2RGB, psurf->ppal, &gpalRGB, 0, 0, 0);
6485 
6486  /* Assume success */
6487  bResult = TRUE;
6488 
6489  /*
6490  * The main rendering loop.
6491  */
6492  TextLeft = RealXStart;
6493  TextTop = YStart;
6494  BackgroundLeft = (RealXStart + 32) >> 6;
6495  for (i = 0; i < Count; ++i)
6496  {
6497  glyph_index = get_glyph_index_flagged(face, String[i], ETO_GLYPH_INDEX, fuOptions);
6498 
6499  if (EmuBold || EmuItalic)
6500  realglyph = NULL;
6501  else
6502  realglyph = ftGdiGlyphCacheGet(face, glyph_index, plf->lfHeight,
6503  RenderMode, pmxWorldToDevice);
6504  if (!realglyph)
6505  {
6506  error = FT_Load_Glyph(face, glyph_index, FT_LOAD_DEFAULT);
6507  if (error)
6508  {
6509  DPRINT1("Failed to load and render glyph! [index: %d]\n", glyph_index);
6510  bResult = FALSE;
6511  break;
6512  }
6513 
6514  glyph = face->glyph;
6515  if (EmuBold || EmuItalic)
6516  {
6517  if (EmuBold)
6518  FT_GlyphSlot_Embolden(glyph);
6519  if (EmuItalic)
6520  FT_GlyphSlot_Oblique(glyph);
6521  realglyph = ftGdiGlyphSet(face, glyph, RenderMode);
6522  }
6523  else
6524  {
6525  realglyph = ftGdiGlyphCacheSet(face,
6526  glyph_index,
6527  plf->lfHeight,
6528  pmxWorldToDevice,
6529  glyph,
6530  RenderMode);
6531  }
6532  if (!realglyph)
6533  {
6534  DPRINT1("Failed to render glyph! [index: %d]\n", glyph_index);
6535  bResult = FALSE;
6536  break;
6537  }
6538  }
6539 
6540  /* retrieve kerning distance and move pen position */
6541  if (use_kerning && previous && glyph_index && NULL == Dx)
6542  {
6543  FT_Vector delta;
6544  FT_Get_Kerning(face, previous, glyph_index, 0, &delta);
6545  TextLeft += delta.x;
6546  }
6547  DPRINT("TextLeft: %I64d\n", TextLeft);
6548  DPRINT("TextTop: %lu\n", TextTop);
6549  DPRINT("Advance: %d\n", realglyph->root.advance.x);
6550 
6551  if ((fuOptions & ETO_OPAQUE) && !plf->lfItalic)
6552  {
6553  DestRect.left = BackgroundLeft;
6554  DestRect.right = (TextLeft + (realglyph->root.advance.x >> 10) + 32) >> 6;
6555  DestRect.top = TextTop + yoff - ((fixAscender + 32) >> 6);
6556  DestRect.bottom = DestRect.top + ((fixAscender + fixDescender) >> 6);
6557 
6558  if (dc->dctype == DCTYPE_DIRECT)
6559  MouseSafetyOnDrawStart(dc->ppdev, DestRect.left, DestRect.top, DestRect.right, DestRect.bottom);
6560 
6561  if (dc->fs & (DC_ACCUM_APP|DC_ACCUM_WMGR))
6562  {
6563  IntUpdateBoundsRect(dc, &DestRect);
6564  }
6565  IntEngBitBlt(
6566  &psurf->SurfObj,
6567  NULL,
6568  NULL,
6569  (CLIPOBJ *)&dc->co,
6570  NULL,
6571  &DestRect,
6572  &SourcePoint,
6573  &SourcePoint,
6574  &dc->eboBackground.BrushObject,
6575  &BrushOrigin,
6577 
6578  if (dc->dctype == DCTYPE_DIRECT)
6579  MouseSafetyOnDrawEnd(dc->ppdev);
6580 
6581  BackgroundLeft = DestRect.right;
6582  }
6583 
6584  DestRect.left = ((TextLeft + 32) >> 6) + realglyph->left;
6585  DestRect.right = DestRect.left + realglyph->bitmap.width;
6586  DestRect.top = TextTop + yoff - realglyph->top;
6587  DestRect.bottom = DestRect.top + realglyph->bitmap.rows;
6588 
6589  bitSize.cx = realglyph->bitmap.width;
6590  bitSize.cy = realglyph->bitmap.rows;
6591  MaskRect.right = realglyph->bitmap.width;
6592  MaskRect.bottom = realglyph->bitmap.rows;
6593 
6594  /* Check if the bitmap has any pixels */
6595  if ((bitSize.cx != 0) && (bitSize.cy != 0))
6596  {
6597  /*
6598  * We should create the bitmap out of the loop at the biggest possible
6599  * glyph size. Then use memset with 0 to clear it and sourcerect to
6600  * limit the work of the transbitblt.
6601  */
6602  HSourceGlyph = EngCreateBitmap(bitSize, realglyph->bitmap.pitch,
6604  realglyph->bitmap.buffer);
6605  if ( !HSourceGlyph )
6606  {
6607  DPRINT1("WARNING: EngCreateBitmap() failed!\n");
6608  // FT_Done_Glyph(realglyph);
6609  bResult = FALSE;
6610  break;
6611  }
6612  SourceGlyphSurf = EngLockSurface((HSURF)HSourceGlyph);
6613  if ( !SourceGlyphSurf )
6614  {
6615  EngDeleteSurface((HSURF)HSourceGlyph);
6616  DPRINT1("WARNING: EngLockSurface() failed!\n");
6617  bResult = FALSE;
6618  break;
6619  }
6620 
6621  /*
6622  * Use the font data as a mask to paint onto the DCs surface using a
6623  * brush.
6624  */
6625  if (lprc && (fuOptions & ETO_CLIPPED) &&
6626  DestRect.right >= lprc->right + dc->ptlDCOrig.x)
6627  {
6628  // We do the check '>=' instead of '>' to possibly save an iteration
6629  // through this loop, since it's breaking after the drawing is done,
6630  // and x is always incremented.
6631  DestRect.right = lprc->right + dc->ptlDCOrig.x;
6632  DoBreak = TRUE;
6633  }
6634  if (lprc && (fuOptions & ETO_CLIPPED) &&
6635  DestRect.bottom >= lprc->bottom + dc->ptlDCOrig.y)
6636  {
6637  DestRect.bottom = lprc->bottom + dc->ptlDCOrig.y;
6638  }
6639 
6640  if (dc->dctype == DCTYPE_DIRECT)
6641  MouseSafetyOnDrawStart(dc->ppdev, DestRect.left, DestRect.top, DestRect.right, DestRect.bottom);
6642 
6643  if (!IntEngMaskBlt(
6644  SurfObj,
6645  SourceGlyphSurf,
6646  (CLIPOBJ *)&dc->co,
6647  &exloRGB2Dst.xlo,
6648  &exloDst2RGB.xlo,
6649  &DestRect,
6650  (PPOINTL)&MaskRect,
6651  &dc->eboText.BrushObject,
6652  &BrushOrigin))
6653  {
6654  DPRINT1("Failed to MaskBlt a glyph!\n");
6655  }
6656 
6657  if (dc->dctype == DCTYPE_DIRECT)
6658  MouseSafetyOnDrawEnd(dc->ppdev) ;
6659 
6660  EngUnlockSurface(SourceGlyphSurf);
6661  EngDeleteSurface((HSURF)HSourceGlyph);
6662  }
6663 
6664  if (DoBreak)
6665  {
6666  break;
6667  }
6668 
6669  if (plf->lfUnderline)
6670  {
6671  int i, position;
6672  if (!face->units_per_EM)
6673  {
6674  position = 0;
6675  }
6676  else
6677  {
6678  position = face->underline_position *
6679  face->size->metrics.y_ppem / face->units_per_EM;
6680  }
6681  for (i = -thickness / 2; i < -thickness / 2 + thickness; ++i)
6682  {
6683  EngLineTo(SurfObj,
6684  (CLIPOBJ *)&dc->co,
6685  &dc->eboText.BrushObject,
6686  (TextLeft >> 6),
6687  TextTop + yoff - position + i,
6688  ((TextLeft + (realglyph->root.advance.x >> 10)) >> 6),
6689  TextTop + yoff - position + i,
6690  NULL,
6692  }
6693  }
6694  if (plf->lfStrikeOut)
6695  {
6696  int i;
6697  for (i = -thickness / 2; i < -thickness / 2 + thickness; ++i)
6698  {
6699  EngLineTo(SurfObj,
6700  (CLIPOBJ *)&dc->co,
6701  &dc->eboText.BrushObject,
6702  (TextLeft >> 6),
6703  TextTop + yoff - (fixAscender >> 6) / 3 + i,
6704  ((TextLeft + (realglyph->root.advance.x >> 10)) >> 6),
6705  TextTop + yoff - (fixAscender >> 6) / 3 + i,
6706  NULL,
6708  }
6709  }
6710 
6711  if (NULL == Dx)
6712  {
6713  TextLeft += realglyph->root.advance.x >> 10;
6714  DPRINT("New TextLeft: %I64d\n", TextLeft);
6715  }
6716  else
6717  {
6718  // FIXME this should probably be a matrix transform with TextTop as well.
6719  Scale = pdcattr->mxWorldToDevice.efM11;
6720  if (FLOATOBJ_Equal0(&Scale))
6721  FLOATOBJ_Set1(&Scale);
6722 
6723  /* do the shift before multiplying to preserve precision */
6724  FLOATOBJ_MulLong(&Scale, Dx[i<<DxShift] << 6);
6725  TextLeft += FLOATOBJ_GetLong(&Scale);
6726  DPRINT("New TextLeft2: %I64d\n", TextLeft);
6727  }
6728 
6729  if (DxShift)
6730  {
6731  TextTop -= Dx[2 * i + 1] << 6;
6732  }
6733 
6734  previous = glyph_index;
6735 
6736  if (EmuBold || EmuItalic)
6737  {
6738  FT_Done_Glyph((FT_Glyph)realglyph);
6739  realglyph = NULL;
6740  }
6741  }
6742 
6743  if (pdcattr->flTextAlign & TA_UPDATECP) {
6744  pdcattr->ptlCurrent.x = DestRect.right - dc->ptlDCOrig.x;
6745  }
6746 
6748 
6749  EXLATEOBJ_vCleanup(&exloRGB2Dst);
6750  EXLATEOBJ_vCleanup(&exloDst2RGB);
6751 
6752 Cleanup:
6753 
6755 
6756  if (TextObj != NULL)
6757  TEXTOBJ_UnlockText(TextObj);
6758 
6759  return bResult;
6760 }
#define ROP2_TO_MIX(Rop2)
Definition: inteng.h:40
#define ERROR_INVALID_PARAMETER
Definition: compat.h:91
FT_Bitmap bitmap
Definition: ftglyph.h:165
FT_Get_Kerning(FT_Face face, FT_UInt left_glyph, FT_UInt right_glyph, FT_UInt kern_mode, FT_Vector *akerning)
Definition: ftobjs.c:3347
ENGAPI BOOL APIENTRY EngLineTo(_Inout_ SURFOBJ *pso, _In_ CLIPOBJ *pco, _In_ BRUSHOBJ *pbo, _In_ LONG x1, _In_ LONG y1, _In_ LONG x2, _In_ LONG y2, _In_opt_ RECTL *prclBounds, _In_ MIX mix)
Definition: lineto.c:440
LONG tmAscent
Definition: engobjects.h:159
#define TRUE
Definition: types.h:120
_In_ int _Inout_ LPRECT lprc
Definition: winuser.h:4366
ENGAPI BOOL APIENTRY EngDeleteSurface(_In_ _Post_ptr_invalid_ HSURF hsurf)
Definition: surface.c:564
unsigned int rows
Definition: ftimage.h:263
#define error(str)
Definition: mkdosfs.c:1605
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
VOID FASTCALL DC_vUpdateBackgroundBrush(PDC pdc)
Definition: dcobjs.c:126
FT_Pos x
Definition: ftimage.h:76
#define FLOATOBJ_Equal0(pf)
Definition: floatobj.h:106
FORCEINLINE VOID TEXTOBJ_UnlockText(PLFONT plfnt)
Definition: text.h:96
#define FLOATOBJ_Set1(fo)
Definition: floatobj.h:120
struct _MATRIX * PMATRIX
enum FT_Render_Mode_ FT_Render_Mode
LONG lfHeight
Definition: dimm.idl:59
struct _PALETTE *const ppal
Definition: surface.h:11
#define BMF_TOPDOWN
Definition: winddi.h:1180
LONG top
Definition: windef.h:292
long bottom
Definition: polytest.cpp:53
unsigned char * buffer
Definition: ftimage.h:266
#define FLOATOBJ_GetLong(pf)
Definition: winddi.h:2817
_Inout_ __drv_aliasesMem PSLIST_ENTRY _Inout_ PSLIST_ENTRY _In_ ULONG Count
Definition: exfuncs.h:1015
_In_ UINT iStart
Definition: wingdi.h:3615
HDC dc
Definition: cylfrac.c:34
static WCHAR String[]
Definition: stringtable.c:55
_Requires_lock_held_ ppdev BOOL NTAPI MouseSafetyOnDrawEnd(_Inout_ PPDEVOBJ ppdev)
Definition: mouse.c:99
#define R2_COPYPEN
Definition: wingdi.h:338
LONG left
Definition: windef.h:291
WORD face[3]
Definition: mesh.c:4747
#define FT_LOAD_DEFAULT
Definition: freetype.h:3008
LONG right
Definition: windef.h:293
int32_t INT
Definition: typedefs.h:56
#define DIRTY_BACKGROUND
Definition: ntgdihdl.h:148
LONG y
Definition: windef.h:315
Definition: xlate.c:10
FT_BEGIN_HEADER typedef unsigned char FT_Bool
Definition: fttypes.h:108
#define FT_HAS_KERNING(face)
Definition: freetype.h:1297
XLATEOBJ xlo
Definition: xlateobj.h:21
long right
Definition: polytest.cpp:53
FT_BitmapGlyph APIENTRY ftGdiGlyphSet(FT_Face Face, FT_GlyphSlot GlyphSlot, FT_Render_Mode RenderMode)
Definition: freetype.c:3342
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
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:358
LONG tmDescent
Definition: engobjects.h:160
#define ETO_OPAQUE
Definition: wingdi.h:646
BOOL FASTCALL TextIntUpdateSize(PDC dc, PTEXTOBJ TextObj, PFONTGDI FontGDI, BOOL bDoLock)
Definition: freetype.c:3770
Definition: text.h:59
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
FT_Load_Glyph(FT_Face face, FT_UInt glyph_index, FT_Int32 load_flags)
Definition: ftobjs.c:760
#define TA_BASELINE
Definition: wingdi.h:927
long top
Definition: polytest.cpp:53
HANDLE hlfntNew
Definition: ntgdihdl.h:334
SURFOBJ SurfObj
Definition: surface.h:8
FORCEINLINE LONG ScaleLong(LONG lValue, PFLOATOBJ pef)
Definition: freetype.c:6014
FT_BEGIN_HEADER FT_GlyphSlot_Embolden(FT_GlyphSlot slot)
Definition: ftsynth.c:90
BYTE OriginalItalic
Definition: engobjects.h:153
unsigned char BOOLEAN
FT_GlyphSlot_Oblique(FT_GlyphSlot slot)
Definition: ftsynth.c:48
#define TA_BOTTOM
Definition: wingdi.h:928
_Requires_lock_held_ ppdev BOOL NTAPI MouseSafetyOnDrawStart(_Inout_ PPDEVOBJ ppdev, _In_ LONG HazardX1, _In_ LONG HazardY1, _In_ LONG HazardX2, _In_ LONG HazardY2)
Definition: mouse.c:41
smooth NULL
Definition: ftsmooth.c:416
LONG cx
Definition: windef.h:319
void DPRINT(...)
Definition: polytest.cpp:61
#define ETO_CLIPPED
Definition: wingdi.h:647
VOID NTAPI EXLATEOBJ_vCleanup(_Inout_ PEXLATEOBJ pexlo)
Definition: xlateobj.c:649
long left
Definition: polytest.cpp:53
#define TA_UPDATECP
Definition: wingdi.h:935
typedef HSURF(APIENTRY FN_DrvEnableSurface)(_In_ DHPDEV dhpdev)
ULONG ulDirty_
Definition: ntgdihdl.h:298
#define gmxWorldToDeviceDefault
Definition: freetype.c:53
#define TA_RIGHT
Definition: wingdi.h:932
#define FLOATOBJ_MulLong(pf, l)
Definition: winddi.h:2826
#define PATH_IsPathOpen(dclevel)
Definition: path.h:74
FT_GlyphRec root
Definition: ftglyph.h:162
int64_t LONGLONG
Definition: typedefs.h:66
VOID FASTCALL DC_vUpdateTextBrush(PDC pdc)
Definition: dcobjs.c:108
FLOAT FLOATOBJ
Definition: winddi.h:677
uint64_t ULONGLONG
Definition: typedefs.h:65
LONG OriginalWeight
Definition: engobjects.h:154
#define IntUnLockFreeType()
Definition: freetype.c:82
LONG x
Definition: windef.h:314
ENGAPI SURFOBJ *APIENTRY EngLockSurface(_In_ HSURF hsurf)
Definition: surface.c:604
Definition: partlist.h:33
FT_Face Face
Definition: engobjects.h:129
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define DIRTY_TEXT
Definition: ntgdihdl.h:147
VOID FtSetCoordinateTransform(FT_Face face, PMATRIX pmx)
Definition: freetype.c:775
#define IntLPtoDP(pdc, ppt, count)
Definition: coord.h:7
BOOL FASTCALL IntIsFontRenderingEnabled(VOID)
Definition: freetype.c:2133
BOOL APIENTRY IntEngMaskBlt(_Inout_ SURFOBJ *psoDest, _In_ SURFOBJ *psoMask, _In_ CLIPOBJ *pco, _In_ XLATEOBJ *pxloDest, _In_ XLATEOBJ *pxloSource, _In_ RECTL *prclDest, _In_ POINTL *pptlMask, _In_ BRUSHOBJ *pbo, _In_ POINTL *pptlBrushOrg)
Definition: bitblt.c:1028
#define OPAQUE
Definition: wingdi.h:948
#define IntLockFreeType()
Definition: freetype.c:79
static FT_UInt FASTCALL get_glyph_index_flagged(FT_Face face, FT_ULong code, DWORD indexed_flag, DWORD flags)
Definition: freetype.c:3888
MATRIX mxWorldToDevice
Definition: ntgdihdl.h:335
static const WCHAR Cleanup[]
Definition: register.c:80
ENUMLOGFONTEXDVW logfont
Definition: text.h:70
BYTE jBkMode
Definition: ntgdihdl.h:312
FLOATOBJ efM22
Definition: ntgdityp.h:414
FONTOBJ * Font
Definition: text.h:66
FT_BitmapGlyph APIENTRY ftGdiGlyphCacheSet(FT_Face Face, INT GlyphIndex, INT Height, PMATRIX pmx, FT_GlyphSlot GlyphSlot, FT_Render_Mode RenderMode)
Definition: freetype.c:3383
PSHARED_FACE SharedFace
Definition: engobjects.h:142
unsigned short USHORT
Definition: pedump.c:61
PTEXTOBJ FASTCALL RealizeFontInit(HFONT hFont)
Definition: font.c:422
BYTE lfStrikeOut
Definition: dimm.idl:66
BOOL FASTCALL PATH_ExtTextOut(PDC dc, INT x, INT y, UINT flags, const RECTL *lprc, LPCWSTR str, UINT count, const INT *dx)
Definition: path.c:2286
BYTE lfItalic
Definition: dimm.idl:64
FT_BitmapGlyph APIENTRY ftGdiGlyphCacheGet(FT_Face Face, INT GlyphIndex, INT Height, FT_Render_Mode RenderMode, PMATRIX pmx)
Definition: freetype.c:3305
ENGAPI VOID APIENTRY EngUnlockSurface(_In_ _Post_ptr_invalid_ SURFOBJ *pso)
Definition: surface.c:625
VOID FASTCALL DC_vPrepareDCsForBlit(PDC pdcDest, const RECT *rcDest, PDC pdcSrc, const RECT *rcSrc)
Definition: dclife.c:505
int pitch
Definition: ftimage.h:265
#define ETO_PDY
Definition: wingdi.h:656
FLONG flTextAlign
Definition: ntgdihdl.h:328
#define DPRINT1
Definition: precomp.h:8
VOID FASTCALL DC_vFinishBlit(PDC pdc1, PDC pdc2)
Definition: dclife.c:614
#define VALIGN_MASK
FT_Vector advance
Definition: ftglyph.h:113
LOGFONTW elfLogFont
Definition: wingdi.h:2697
VOID FASTCALL IntUpdateBoundsRect(PDC, PRECTL)
Definition: dcutil.c:689
FT_Render_Mode FASTCALL IntGetFontRenderMode(LOGFONTW *logfont)
Definition: freetype.c:2145
unsigned int ULONG
Definition: retypes.h:1
LONG bottom
Definition: windef.h:294
#define ObjToGDI(ClipObj, Type)
Definition: engobjects.h:180
FORCEINLINE PMATRIX DC_pmxWorldToDevice(PDC pdc)
Definition: coord.h:98
#define EMUBOLD_NEEDED(original, request)
Definition: freetype.c:45
PALETTE gpalRGB
Definition: palette.c:20
static HBITMAP
Definition: button.c:44
#define TA_CENTER
Definition: wingdi.h:930
LONG lfWeight
Definition: dimm.idl:63
ENUMLOGFONTEXW elfEnumLogfontEx
Definition: wingdi.h:2774
BYTE lfUnderline
Definition: dimm.idl:65
FT_Done_Glyph(FT_Glyph glyph)
Definition: ftglyph.c:633
POINTL ptlCurrent
Definition: ntgdihdl.h:315
LONG cy
Definition: windef.h:320
#define ROP4_FROM_INDEX(index)
Definition: inteng.h:42
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27
GLenum GLuint GLint GLenum face
Definition: glext.h:7025
ENGAPI HBITMAP APIENTRY EngCreateBitmap(_In_ SIZEL sizl, _In_ LONG lWidth, _In_ ULONG iFormat, _In_ FLONG fl, _In_opt_ PVOID pvBits)
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:604
unsigned int width
Definition: ftimage.h:264
#define GM_ADVANCED
Definition: wingdi.h:864

Referenced by GdiFlushUserBatch(), and GreExtTextOutW().

◆ IntPatBlt()

BOOL FASTCALL IntPatBlt ( PDC  ,
INT  ,
INT  ,
INT  ,
INT  ,
DWORD  ,
PEBRUSHOBJ   
)

Definition at line 777 of file bitblt.c.

785 {
786  RECTL DestRect;
787  SURFACE *psurf;
788  POINTL BrushOrigin;
789  BOOL ret;
790  PBRUSH pbrush;
791 
792  ASSERT(pebo);
793  pbrush = pebo->pbrush;
794  ASSERT(pbrush);
795 
796  if (pbrush->flAttrs & BR_IS_NULL)
797  {
798  return TRUE;
799  }
800 
801  if (Width > 0)
802  {
803  DestRect.left = XLeft;
804  DestRect.right = XLeft + Width;
805  }
806  else
807  {
808  DestRect.left = XLeft + Width + 1;
809  DestRect.right = XLeft + 1;
810  }
811 
812  if (Height > 0)
813  {
814  DestRect.top = YLeft;
815  DestRect.bottom = YLeft + Height;
816  }
817  else
818  {
819  DestRect.top = YLeft + Height + 1;
820  DestRect.bottom = YLeft + 1;
821  }
822 
823  IntLPtoDP(pdc, (LPPOINT)&DestRect, 2);
824 
825  DestRect.left += pdc->ptlDCOrig.x;
826  DestRect.top += pdc->ptlDCOrig.y;
827  DestRect.right += pdc->ptlDCOrig.x;
828  DestRect.bottom += pdc->ptlDCOrig.y;
829 
830  if (pdc->fs & (DC_ACCUM_APP|DC_ACCUM_WMGR))
831  {
832  IntUpdateBoundsRect(pdc, &DestRect);
833  }
834 
835 #ifdef _USE_DIBLIB_
836  BrushOrigin.x = pbrush->ptOrigin.x + pdc->ptlDCOrig.x + XLeft;
837  BrushOrigin.y = pbrush->ptOrigin.y + pdc->ptlDCOrig.y + YLeft;
838 #else
839  BrushOrigin.x = pbrush->ptOrigin.x + pdc->ptlDCOrig.x;
840  BrushOrigin.y = pbrush->ptOrigin.y + pdc->ptlDCOrig.y;
841 #endif
842 
843  DC_vPrepareDCsForBlit(pdc, &DestRect, NULL, NULL);
844 
845  psurf = pdc->dclevel.pSurface;
846 
847  ret = IntEngBitBlt(&psurf->SurfObj,
848  NULL,
849  NULL,
850  (CLIPOBJ *)&pdc->co,
851  NULL,
852  &DestRect,
853  NULL,
854  NULL,
855  &pebo->BrushObject,
856  &BrushOrigin,
857  WIN32_ROP3_TO_ENG_ROP4(dwRop3));
858 
859  DC_vFinishBlit(pdc, NULL);
860 
861  return ret;
862 }
#define TRUE
Definition: types.h:120
long bottom
Definition: polytest.cpp:53
LONG y
Definition: windef.h:315
long right
Definition: polytest.cpp:53
unsigned int BOOL
Definition: ntddk_ex.h:94
long top
Definition: polytest.cpp:53
SURFOBJ SurfObj
Definition: surface.h:8
#define WIN32_ROP3_TO_ENG_ROP4(dwRop4)
Definition: intgdi.h:4
smooth NULL
Definition: ftsmooth.c:416
long left
Definition: polytest.cpp:53
Definition: types.h:100
#define BR_IS_NULL
Definition: brush.h:101
LONG x
Definition: windef.h:314
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define IntLPtoDP(pdc, ppt, count)
Definition: coord.h:7
int ret
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
VOID FASTCALL IntUpdateBoundsRect(PDC, PRECTL)
Definition: dcutil.c:689
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:604

Referenced by GdiFlushUserBatch(), IntGdiPolyPatBlt(), NtGdiPatBlt(), and NtGdiSetPixel().

◆ NtGdiFlush()

◆ NtGdiFlushUserBatch()

NTSTATUS APIENTRY NtGdiFlushUserBatch ( VOID  )

Definition at line 487 of file gdibatch.c.

488 {
489  PTEB pTeb = NtCurrentTeb();
490  ULONG GdiBatchCount = pTeb->GdiBatchCount;
491 
492  if( (GdiBatchCount > 0) && (GdiBatchCount <= (GDIBATCHBUFSIZE/4)))
493  {
494  HDC hDC = (HDC) pTeb->GdiTebBatch.HDC;
495 
496  /* If hDC is zero and the buffer fills up with delete objects we need
497  to run anyway.
498  */
499  if (hDC || GdiBatchCount)
500  {
501  PCHAR pHdr = (PCHAR)&pTeb->GdiTebBatch.Buffer[0];
502  PDC pDC = NULL;
503 
505  {
506  pDC = DC_LockDc(hDC);
507  }
508 
509  // No need to init anything, just go!
510  for (; GdiBatchCount > 0; GdiBatchCount--)
511  {
512  ULONG Size;
513  // Process Gdi Batch!
514  Size = GdiFlushUserBatch(pDC, (PGDIBATCHHDR) pHdr);
515  if (!Size) break;
516  pHdr += Size;
517  }
518 
519  if (pDC)
520  {
521  DC_UnlockDc(pDC);
522  }
523 
524  // Exit and clear out for the next round.
525  pTeb->GdiTebBatch.Offset = 0;
526  pTeb->GdiBatchCount = 0;
527  pTeb->GdiTebBatch.HDC = 0;
528  }
529  }
530 
531  // FIXME: On Windows XP the function returns &pTeb->RealClientId, maybe VOID?
532  return STATUS_SUCCESS;
533 }
signed char * PCHAR
Definition: retypes.h:7
BOOL NTAPI GreIsHandleValid(HGDIOBJ hobj)
Definition: gdiobj.c:1143
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:219
static HDC
Definition: imagelist.c:92
ULONG Buffer[GDI_BATCH_BUFFER_SIZE]
Definition: compat.h:482
ULONG FASTCALL GdiFlushUserBatch(PDC dc, PGDIBATCHHDR pHdr)
Definition: gdibatch.c:70
#define GDIBATCHBUFSIZE
Definition: ntgdityp.h:199
smooth NULL
Definition: ftsmooth.c:416
#define GDI_HANDLE_GET_TYPE(h)
Definition: gdi.h:31
#define PCHAR
Definition: match.c:90
Definition: polytest.cpp:40
if(!(yy_init))
Definition: macro.lex.yy.c:714
GDI_TEB_BATCH GdiTebBatch
Definition: compat.h:506
ULONG GdiBatchCount
Definition: compat.h:536
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
static HDC hDC
Definition: 3dtext.c:33
Definition: compat.h:484
ULONG Offset
Definition: compat.h:480
FORCEINLINE struct _TEB * NtCurrentTeb(VOID)
Definition: psfuncs.h:420
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:237
unsigned int ULONG
Definition: retypes.h:1
return STATUS_SUCCESS
Definition: btrfs.c:2966
HANDLE HDC
Definition: compat.h:481

Referenced by DriverEntry().

◆ SynchronizeDriver()

VOID FASTCALL SynchronizeDriver ( FLONG  Flags)

Definition at line 45 of file gdibatch.c.

46 {
47  SURFOBJ *SurfObj;
48  //PPDEVOBJ Device;
49 
50  if (Flags & GCAPS2_SYNCFLUSH)
52  if (Flags & GCAPS2_SYNCTIMER)
54 
55  //Device = IntEnumHDev();
56 // UNIMPLEMENTED;
57 //ASSERT(FALSE);
58  SurfObj = 0;// EngLockSurface( Device->pSurface );
59  if(!SurfObj) return;
60  DoDeviceSync( SurfObj, NULL, Flags);
61  EngUnlockSurface(SurfObj);
62  return;
63 }
#define DSS_TIMER_EVENT
Definition: winddi.h:4159
#define GCAPS2_SYNCTIMER
Definition: winddi.h:373
#define DSS_FLUSH_EVENT
Definition: winddi.h:4160
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
VOID FASTCALL DoDeviceSync(SURFOBJ *Surface, PRECTL Rect, FLONG fl)
Definition: gdibatch.c:22
smooth NULL
Definition: ftsmooth.c:416
#define GCAPS2_SYNCFLUSH
Definition: winddi.h:372
ENGAPI VOID APIENTRY EngUnlockSurface(_In_ _Post_ptr_invalid_ SURFOBJ *pso)
Definition: surface.c:625

Referenced by NtGdiFlush().