ReactOS  0.4.12-dev-916-gffc4e30
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, saveflags;
250  FLONG flTextAlign = -1;
251  HANDLE hlfntNew;
252  PRECTL lprc;
253  USHORT jBkMode;
254  LONG lBkMode;
255  if (!dc) break;
256  pgO = (PGDIBSTEXTOUT) pHdr;
257 
258  // Save current attributes, flags and Set the attribute snapshots
260 
261  // In this instance check for differences and set the appropriate dirty flags.
262  if ( dc->pdcattr->crForegroundClr != pgO->crForegroundClr)
263  {
264  crColor = dc->pdcattr->crForegroundClr;
265  dc->pdcattr->crForegroundClr = pgO->crForegroundClr;
266  ulForegroundClr = dc->pdcattr->ulForegroundClr;
267  dc->pdcattr->ulForegroundClr = pgO->ulForegroundClr;
269  }
270  if (dc->pdcattr->crBackgroundClr != pgO->crBackgroundClr)
271  {
272  crBkColor = dc->pdcattr->ulBackgroundClr;
273  dc->pdcattr->crBackgroundClr = pgO->crBackgroundClr;
274  ulBackgroundClr = dc->pdcattr->ulBackgroundClr;
275  dc->pdcattr->ulBackgroundClr = pgO->ulBackgroundClr;
277  }
278  if (dc->pdcattr->flTextAlign != pgO->flTextAlign)
279  {
280  flTextAlign = dc->pdcattr->flTextAlign;
281  dc->pdcattr->flTextAlign = pgO->flTextAlign;
282  }
283  if (dc->pdcattr->hlfntNew != pgO->hlfntNew)
284  {
285  hlfntNew = dc->pdcattr->hlfntNew;
286  dc->pdcattr->hlfntNew = pgO->hlfntNew;
287  dc->pdcattr->ulDirty_ &= ~SLOW_WIDTHS;
288  flags |= DIRTY_CHARSET;
289  }
290 
291  dc->pdcattr->ulDirty_ |= flags;
292 
293  jBkMode = dc->pdcattr->jBkMode;
294  dc->pdcattr->jBkMode = pgO->lBkMode;
295  lBkMode = dc->pdcattr->lBkMode;
296  dc->pdcattr->lBkMode = pgO->lBkMode;
297 
298  lprc = (pgO->Options & GDIBS_NORECT) ? NULL : &pgO->Rect;
299  pgO->Options &= ~GDIBS_NORECT;
300 
302  pgO->x,
303  pgO->y,
304  pgO->Options,
305  lprc,
306  (LPCWSTR)&pgO->String[pgO->Size/sizeof(WCHAR)],
307  pgO->cbCount,
308  pgO->Size ? (LPINT)&pgO->Buffer : NULL,
309  pgO->iCS_CP );
310 
311  // Restore attributes and flags
312  dc->pdcattr->jBkMode = jBkMode;
313  dc->pdcattr->lBkMode = lBkMode;
314 
315  if (flags & DIRTY_TEXT && crColor != -1)
316  {
317  dc->pdcattr->crForegroundClr = crColor;
318  dc->pdcattr->ulForegroundClr = ulForegroundClr;
319  }
320  if (flags & DIRTY_BACKGROUND)
321  {
322  dc->pdcattr->crBackgroundClr = crBkColor;
323  dc->pdcattr->ulBackgroundClr = ulBackgroundClr;
324  }
325  if (flTextAlign != -1)
326  {
327  dc->pdcattr->flTextAlign = flTextAlign;
328  }
329 
330  if (flags & DIRTY_CHARSET)
331  {
332  dc->pdcattr->hlfntNew = hlfntNew;
333  dc->pdcattr->ulDirty_ &= ~SLOW_WIDTHS;
334  }
335  dc->pdcattr->ulDirty_ |= saveflags | flags;
336  break;
337  }
338 
339  case GdiBCExtTextOut:
340  {
341  PGDIBSEXTTEXTOUT pgO;
342  COLORREF crBkColor;
343  ULONG ulBackgroundClr;
344  DWORD flags = 0, saveflags;
345  if (!dc) break;
346  pgO = (PGDIBSEXTTEXTOUT) pHdr;
347 
348  saveflags = dc->pdcattr->ulDirty_ & (DIRTY_BACKGROUND|DIRTY_TEXT|DIRTY_FILL|DC_BRUSH_DIRTY|DIRTY_CHARSET);
349 
350  if (dc->pdcattr->crBackgroundClr != pgO->ulBackgroundClr)
351  {
352  crBkColor = dc->pdcattr->crBackgroundClr;
353  ulBackgroundClr = dc->pdcattr->ulBackgroundClr;
354  dc->pdcattr->crBackgroundClr = pgO->ulBackgroundClr;
355  dc->pdcattr->ulBackgroundClr = pgO->ulBackgroundClr;
357  }
358 
359  dc->pdcattr->ulDirty_ |= flags;
360 
362  0,
363  0,
364  pgO->Options,
365  &pgO->Rect,
366  NULL,
367  pgO->Count,
368  NULL,
369  0 );
370 
371  if (flags & DIRTY_BACKGROUND)
372  {
373  dc->pdcattr->crBackgroundClr = crBkColor;
374  dc->pdcattr->ulBackgroundClr = ulBackgroundClr;
375  }
376  dc->pdcattr->ulDirty_ |= saveflags | flags;
377  break;
378  }
379 
380  case GdiBCSetBrushOrg:
381  {
382  PGDIBSSETBRHORG pgSBO;
383  if (!dc) break;
384  pgSBO = (PGDIBSSETBRHORG) pHdr;
385  pdcattr->ptlBrushOrigin = pgSBO->ptlBrushOrigin;
387  break;
388  }
389 
390  case GdiBCExtSelClipRgn:
391  break;
392 
393  case GdiBCSelObj:
394  {
395  PGDIBSOBJECT pgO;
396 
397  if (!dc) break;
398  pgO = (PGDIBSOBJECT) pHdr;
399 
400  DC_hSelectFont(dc, (HFONT)pgO->hgdiobj);
401  break;
402  }
403 
404  case GdiBCDelRgn:
405  DPRINT("Delete Region Object!\n");
406  /* Fall through */
407  case GdiBCDelObj:
408  {
409  PGDIBSOBJECT pgO = (PGDIBSOBJECT) pHdr;
410  GreDeleteObject( pgO->hgdiobj );
411  break;
412  }
413 
414  default:
415  break;
416  }
417 
418  return Size;
419 }
ULONG Buffer[1]
Definition: ntgdityp.h:523
#define BRUSH_ShareUnlockBrush(pBrush)
Definition: brush.h:114
DWORD rop4
Definition: ntgdityp.h:485
struct _GDIBSPATBLT * PGDIBSPATBLT
COLORREF crBackgroundClr
Definition: ntgdityp.h:489
ULONG ulBackgroundClr
Definition: ntgdityp.h:534
BOOL NTAPI GreDeleteObject(HGDIOBJ hobj)
Definition: gdiobj.c:1153
PATRECT pRect[1]
Definition: ntgdityp.h:495
ULONG ulBrushClr
Definition: ntgdityp.h:493
_In_ int _Inout_ LPRECT lprc
Definition: winuser.h:4334
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:466
SHORT Size
Definition: ntgdityp.h:452
#define BRUSH_ShareLockBrush(hBrush)
Definition: brush.h:113
#define WIN32_ROP4_USES_SOURCE(Rop)
Definition: intgdi.h:7
COLORREF crForegroundClr
Definition: ntgdityp.h:488
#define DIRTY_CHARSET
Definition: ntgdihdl.h:149
DWORD dwRop
Definition: ntgdityp.h:464
struct _GDIBSEXTTEXTOUT * PGDIBSEXTTEXTOUT
SHORT Cmd
Definition: ntgdityp.h:453
COLORREF crForegroundClr
Definition: ntgdityp.h:465
LONG top
Definition: windef.h:292
HDC dc
Definition: cylfrac.c:34
COLORREF crBrushClr
Definition: ntgdityp.h:467
LONG left
Definition: windef.h:291
LONG right
Definition: windef.h:293
struct _GDIBSOBJECT * PGDIBSOBJECT
int32_t INT
Definition: typedefs.h:56
#define DIRTY_BACKGROUND
Definition: ntgdihdl.h:148
LONG lBkMode
Definition: ntgdityp.h:508
LONG y
Definition: windef.h:315
_SEH2_TRY
Definition: create.c:4250
FLONG flTextAlign
Definition: ntgdityp.h:519
struct _GDIBSTEXTOUT * PGDIBSTEXTOUT
HANDLE hbrush
Definition: ntgdityp.h:463
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:487
struct _GDIBSSETBRHORG * PGDIBSSETBRHORG
ULONG ulBackgroundClr
Definition: ntgdityp.h:492
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
COLORREF crBackgroundClr
Definition: ntgdityp.h:507
struct _GDIBSPPATBLT * PGDIBSPPATBLT
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
#define MAKEROP4(f, b)
Definition: wingdi.h:2924
COLORREF crBrushClr
Definition: ntgdityp.h:490
unsigned long FLONG
Definition: ntbasedef.h:373
UINT Options
Definition: ntgdityp.h:513
ULONG ulDirty_
Definition: ntgdihdl.h:291
Definition: types.h:100
ULONG ulBackgroundClr
Definition: ntgdityp.h:510
VOID FASTCALL DC_vUpdateTextBrush(PDC pdc)
Definition: dcobjs.c:108
HBRUSH hBrush
Definition: ntgdityp.h:479
RECT r
Definition: ntgdityp.h:478
#define _SEH2_YIELD(STMT_)
Definition: pseh2_64.h:8
__wchar_t WCHAR
Definition: xmlstorage.h:180
COLORREF crForegroundClr
Definition: ntgdityp.h:506
HGDIOBJ hgdiobj
Definition: ntgdityp.h:554
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:501
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:5510
#define SLOW_WIDTHS
Definition: ntgdihdl.h:150
Definition: sacdrv.h:277
HANDLE hlfntNew
Definition: ntgdityp.h:518
ULONG ulBackgroundClr
Definition: ntgdityp.h:471
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
POINTL ptlBrushOrigin
Definition: ntgdihdl.h:346
WCHAR String[2]
Definition: ntgdityp.h:522
VOID NTAPI DC_vSetBrushOrigin(PDC pdc, LONG x, LONG y)
Definition: dcobjs.c:142
ULONG ulBrushClr
Definition: ntgdityp.h:472
DWORD iCS_CP
Definition: ntgdityp.h:515
_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:470
#define DC_BRUSH_DIRTY
Definition: ntgdihdl.h:157
#define DPRINT1
Definition: precomp.h:8
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
POINTL ptlBrushOrigin
Definition: ntgdityp.h:540
unsigned int ULONG
Definition: retypes.h:1
UINT cbCount
Definition: ntgdityp.h:516
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:509
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:491
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 5510 of file freetype.c.

5520 {
5521  /*
5522  * FIXME:
5523  * Call EngTextOut, which does the real work (calling DrvTextOut where
5524  * appropriate)
5525  */
5526 
5527  PDC_ATTR pdcattr;
5528  SURFOBJ *SurfObj;
5529  SURFACE *psurf = NULL;
5530  int error, glyph_index, i;
5531  FT_Face face;
5532  FT_GlyphSlot glyph;
5533  FT_BitmapGlyph realglyph;
5534  LONGLONG TextLeft64, TextTop64, DeltaX64, DeltaY64, XStart64, YStart64;
5535  ULONG previous;
5536  FT_Bool use_kerning;
5537  RECTL DestRect, MaskRect;
5538  POINTL SourcePoint, BrushOrigin;
5539  HBITMAP HSourceGlyph;
5540  SURFOBJ *SourceGlyphSurf;
5541  SIZEL bitSize;
5542  FONTOBJ *FontObj;
5543  PFONTGDI FontGDI;
5544  PTEXTOBJ TextObj = NULL;
5545  EXLATEOBJ exloRGB2Dst, exloDst2RGB;
5546  FT_Render_Mode RenderMode;
5547  BOOLEAN Render;
5548  POINT Start;
5549  BOOL DoBreak = FALSE;
5550  USHORT DxShift;
5551  PMATRIX pmxWorldToDevice;
5552  LONG lfEscapement, lfWidth;
5553  FLOATOBJ Scale;
5554  LOGFONTW *plf;
5555  BOOL EmuBold, EmuItalic;
5556  int thickness;
5557  BOOL bResult;
5558  FT_Matrix mat = identityMat, matWidth, matEscape, matWorld;
5559  FT_Vector vecs[9];
5560 
5561  /* Check if String is valid */
5562  if ((Count > 0xFFFF) || (Count > 0 && String == NULL))
5563  {
5565  return FALSE;
5566  }
5567 
5568  Render = IntIsFontRenderingEnabled();
5569 
5570  if (PATH_IsPathOpen(dc->dclevel))
5571  {
5572  bResult = PATH_ExtTextOut(dc,
5573  XStart,
5574  YStart,
5575  fuOptions,
5576  (const RECTL *)lprc,
5577  String,
5578  Count,
5579  (const INT *)Dx);
5580  return bResult;
5581  }
5582 
5584 
5585  if (!dc->dclevel.pSurface)
5586  {
5587  /* Memory DC with no surface selected */
5588  bResult = TRUE;
5589  goto Cleanup;
5590  }
5591 
5592  pdcattr = dc->pdcattr;
5593 
5594  if (lprc && (fuOptions & (ETO_OPAQUE | ETO_CLIPPED)))
5595  {
5596  IntLPtoDP(dc, (POINT *)lprc, 2);
5597  }
5598 
5599  if (pdcattr->flTextAlign & TA_UPDATECP)
5600  {
5601  Start.x = pdcattr->ptlCurrent.x;
5602  Start.y = pdcattr->ptlCurrent.y;
5603  } else {
5604  Start.x = XStart;
5605  Start.y = YStart;
5606  }
5607 
5608  SourcePoint.x = 0;
5609  SourcePoint.y = 0;
5610  MaskRect.left = 0;
5611  MaskRect.top = 0;
5612  BrushOrigin.x = 0;
5613  BrushOrigin.y = 0;
5614 
5615  if ((fuOptions & ETO_OPAQUE) && lprc)
5616  {
5617  DestRect.left = lprc->left;
5618  DestRect.top = lprc->top;
5619  DestRect.right = lprc->right;
5620  DestRect.bottom = lprc->bottom;
5621 
5622  DestRect.left += dc->ptlDCOrig.x;
5623  DestRect.top += dc->ptlDCOrig.y;
5624  DestRect.right += dc->ptlDCOrig.x;
5625  DestRect.bottom += dc->ptlDCOrig.y;
5626 
5627  if (dc->fs & (DC_ACCUM_APP|DC_ACCUM_WMGR))
5628  {
5629  IntUpdateBoundsRect(dc, &DestRect);
5630  }
5631 
5632  if (pdcattr->ulDirty_ & DIRTY_BACKGROUND)
5634  if (dc->dctype == DCTYPE_DIRECT)
5635  MouseSafetyOnDrawStart(dc->ppdev, DestRect.left, DestRect.top, DestRect.right, DestRect.bottom);
5636 
5637  psurf = dc->dclevel.pSurface;
5638  IntEngBitBlt(
5639  &psurf->SurfObj,
5640  NULL,
5641  NULL,
5642  (CLIPOBJ *)&dc->co,
5643  NULL,
5644  &DestRect,
5645  &SourcePoint,
5646  &SourcePoint,
5647  &dc->eboBackground.BrushObject,
5648  &BrushOrigin,
5650 
5651  if (dc->dctype == DCTYPE_DIRECT)
5652  MouseSafetyOnDrawEnd(dc->ppdev);
5653 
5654  fuOptions &= ~ETO_OPAQUE;
5655  }
5656  else
5657  {
5658  if (pdcattr->jBkMode == OPAQUE)
5659  {
5660  fuOptions |= ETO_OPAQUE;
5661  }
5662  }
5663 
5664  TextObj = RealizeFontInit(pdcattr->hlfntNew);
5665  if (TextObj == NULL)
5666  {
5667  bResult = FALSE;
5668  goto Cleanup;
5669  }
5670 
5671  FontObj = TextObj->Font;
5672  ASSERT(FontObj);
5673  FontGDI = ObjToGDI(FontObj, FONT);
5674  ASSERT(FontGDI);
5675 
5676  IntLockFreeType();
5677  face = FontGDI->SharedFace->Face;
5678 
5679  plf = &TextObj->logfont.elfEnumLogfontEx.elfLogFont;
5680  EmuBold = (plf->lfWeight >= FW_BOLD && FontGDI->OriginalWeight <= FW_NORMAL);
5681  EmuItalic = (plf->lfItalic && !FontGDI->OriginalItalic);
5682  if (FT_IS_SCALABLE(face))
5683  {
5684  lfEscapement = IntNormalizeAngle(plf->lfEscapement);
5685  lfWidth = labs(plf->lfWidth);
5686  }
5687  else
5688  {
5689  lfEscapement = lfWidth = 0;
5690  }
5691 
5692  if (Render)
5693  RenderMode = IntGetFontRenderMode(plf);
5694  else
5695  RenderMode = FT_RENDER_MODE_MONO;
5696 
5697  if (!TextIntUpdateSize(dc, TextObj, FontGDI, FALSE))
5698  {
5700  bResult = FALSE;
5701  goto Cleanup;
5702  }
5703 
5704  /* NOTE: Don't trust face->size->metrics.ascender and descender values. */
5706  if (dc->pdcattr->iGraphicsMode == GM_ADVANCED)
5707  {
5708  pmxWorldToDevice = DC_pmxWorldToDevice(dc);
5709  }
5710  else
5711  {
5712  pmxWorldToDevice = (PMATRIX)&gmxWorldToDeviceDefault;
5713  }
5714 
5715  IntWidthMatrix(face, &matWidth, lfWidth);
5716  FT_Matrix_Multiply(&matWidth, &mat);
5717 
5718  IntEscapeMatrix(&matEscape, lfEscapement);
5719  FT_Matrix_Multiply(&matEscape, &mat);
5720 
5721  FtMatrixFromMx(&matWorld, pmxWorldToDevice);
5722  matWorld.yx = -matWorld.yx;
5723  matWorld.xy = -matWorld.xy;
5724  FT_Matrix_Multiply(&matWorld, &mat);
5725 
5727 
5728  // Calculate displacement of the text.
5729  DeltaX64 = DeltaY64 = 0;
5730  DxShift = fuOptions & ETO_PDY ? 1 : 0;
5731  use_kerning = FT_HAS_KERNING(face);
5732  previous = 0;
5733  if ((fuOptions & ETO_OPAQUE) ||
5734  (pdcattr->flTextAlign & (TA_CENTER | TA_RIGHT)) ||
5735  memcmp(&mat, &identityMat, sizeof(mat)) != 0 ||
5736  plf->lfUnderline || plf->lfStrikeOut)
5737  {
5738  for (i = 0; i < Count; ++i)
5739  {
5740  glyph_index = get_glyph_index_flagged(face, String[i], ETO_GLYPH_INDEX, fuOptions);
5741 
5742  // FIXME: Use FT_LOAD_BITMAP_METRICS_ONLY or cache.
5743  error = FT_Load_Glyph(face, glyph_index, FT_LOAD_DEFAULT);
5744  if (error)
5745  {
5746  DPRINT1("Failed to load glyph! [index: %d]\n", glyph_index);
5748  bResult = FALSE;
5749  goto Cleanup;
5750  }
5751 
5752  glyph = face->glyph;
5753  if (EmuBold)
5754  FT_GlyphSlot_Embolden(glyph);
5755  if (EmuItalic)
5756  FT_GlyphSlot_Oblique(glyph);
5757  realglyph = ftGdiGlyphSet(face, glyph, RenderMode);
5758  if (!realglyph)
5759  {
5760  DPRINT1("Failed to render glyph! [index: %d]\n", glyph_index);
5762  bResult = FALSE;
5763  goto Cleanup;
5764  }
5765 
5766  /* retrieve kerning distance and move pen position */
5767  if (use_kerning && previous && glyph_index && Dx == NULL)
5768  {
5769  FT_Vector delta;
5770  FT_Get_Kerning(face, previous, glyph_index, 0, &delta);
5771  DeltaX64 += delta.x;
5772  DeltaY64 -= delta.y;
5773  }
5774 
5775  if (Dx == NULL)
5776  {
5777  DeltaX64 += realglyph->root.advance.x >> 10;
5778  DeltaY64 -= realglyph->root.advance.y >> 10;
5779  }
5780  else
5781  {
5782  // FIXME this should probably be a matrix transform with DeltaY64 as well.
5783  Scale = pdcattr->mxWorldToDevice.efM11;
5784  if (FLOATOBJ_Equal0(&Scale))
5785  FLOATOBJ_Set1(&Scale);
5786 
5787  /* do the shift before multiplying to preserve precision */
5788  FLOATOBJ_MulLong(&Scale, Dx[i << DxShift] << 6);
5789  DeltaX64 += FLOATOBJ_GetLong(&Scale);
5790  }
5791 
5792  if (DxShift)
5793  {
5794  DeltaY64 -= Dx[2 * i + 1] << 6;
5795  }
5796 
5797  previous = glyph_index;
5798 
5799  FT_Done_Glyph((FT_Glyph)realglyph);
5800  }
5801  }
5802 
5803  // Process the X and Y alignments.
5804  if ((pdcattr->flTextAlign & TA_CENTER) == TA_CENTER)
5805  {
5806  XStart64 = -DeltaX64 / 2;
5807  YStart64 = -DeltaY64 / 2;
5808  }
5809  else if ((pdcattr->flTextAlign & TA_RIGHT) == TA_RIGHT)
5810  {
5811  XStart64 = -DeltaX64;
5812  YStart64 = -DeltaY64;
5813  }
5814  else
5815  {
5816  XStart64 = YStart64 = 0;
5817  }
5818 
5819  psurf = dc->dclevel.pSurface;
5820  SurfObj = &psurf->SurfObj ;
5821 
5822  if ((fuOptions & ETO_OPAQUE) && (dc->pdcattr->ulDirty_ & DIRTY_BACKGROUND))
5824 
5825  if (dc->pdcattr->ulDirty_ & DIRTY_TEXT)
5827 
5828  thickness = 1;
5829  if (face->units_per_EM)
5830  {
5831  thickness = face->underline_thickness *
5832  face->size->metrics.y_ppem / face->units_per_EM;
5833  if (thickness <= 0)
5834  thickness = 1;
5835  }
5836 
5837  /* Process the vertical alignment */
5838 #define VALIGN_MASK (TA_TOP | TA_BASELINE | TA_BOTTOM)
5839  RtlZeroMemory(vecs, sizeof(vecs));
5840  if ((pdcattr->flTextAlign & VALIGN_MASK) == TA_BASELINE)
5841  {
5842  vecs[1].y = -FontGDI->tmAscent << 16; // upper left
5843  vecs[4].y = 0; // baseline
5844  vecs[0].y = FontGDI->tmDescent << 16; // lower left
5845  }
5846  else if ((pdcattr->flTextAlign & VALIGN_MASK) == TA_BOTTOM)
5847  {
5848  vecs[1].y = -FontGDI->tmHeight << 16; // upper left
5849  vecs[4].y = -FontGDI->tmDescent << 16; // baseline
5850  vecs[0].y = 0; // lower left
5851  }
5852  else /* TA_TOP */
5853  {
5854  vecs[1].y = 0; // upper left
5855  vecs[4].y = FontGDI->tmAscent << 16; // baseline
5856  vecs[0].y = FontGDI->tmHeight << 16; // lower left
5857  }
5858  vecs[2] = vecs[1]; // upper right
5859  vecs[3] = vecs[0]; // lower right
5860 #undef VALIGN_MASK
5861 
5862  // underline
5863  if (plf->lfUnderline)
5864  {
5865  int position = 0;
5866  if (face->units_per_EM)
5867  {
5868  position = face->underline_position *
5869  face->size->metrics.y_ppem / face->units_per_EM;
5870  }
5871  vecs[5].y = vecs[6].y = vecs[4].y - (position << 16);
5872  }
5873 
5874  // strike through
5875  if (plf->lfStrikeOut)
5876  {
5877  vecs[7].y = vecs[8].y = vecs[4].y - ((FontGDI->tmAscent / 3) << 16);
5878  }
5879 
5880  // invert y axis
5881  IntEscapeMatrix(&matEscape, -lfEscapement);
5882 
5883  // convert vecs
5884  for (i = 0; i < 9; ++i)
5885  {
5886  POINT pt;
5887  FT_Vector_Transform(&vecs[i], &matWidth);
5888  FT_Vector_Transform(&vecs[i], &matEscape);
5889  vecs[i].x += (Start.x << 16) + (XStart64 << 10);
5890  vecs[i].y += (Start.y << 16) + (YStart64 << 10);
5891  pt.x = vecs[i].x >> 16;
5892  pt.y = vecs[i].y >> 16;
5893  IntLPtoDP(dc, &pt, 1);
5894  vecs[i].x = pt.x + dc->ptlDCOrig.x;
5895  vecs[i].y = pt.y + dc->ptlDCOrig.y;
5896  }
5897  vecs[2].x += DeltaX64 >> 6;
5898  vecs[2].y += DeltaY64 >> 6; // upper right
5899  vecs[3].x += DeltaX64 >> 6;
5900  vecs[3].y += DeltaY64 >> 6; // lower right
5901  vecs[6].x += DeltaX64 >> 6;
5902  vecs[6].y += DeltaY64 >> 6; // underline right
5903  vecs[8].x += DeltaX64 >> 6;
5904  vecs[8].y += DeltaY64 >> 6; // strike through right
5905 
5906  if (fuOptions & ETO_OPAQUE)
5907  {
5908  /* Draw background */
5909  RECTL Rect;
5910  RtlZeroMemory(&Rect, sizeof(Rect));
5911 
5912  if ((mat.xy == 0 && mat.yx == 0) || (mat.xx == 0 && mat.yy == 0))
5913  {
5914  Rect.left = Rect.top = MAXLONG;
5915  Rect.right = Rect.bottom = MINLONG;
5916  for (i = 0; i < 4; ++i)
5917  {
5918  Rect.left = min(Rect.left, vecs[i].x);
5919  Rect.top = min(Rect.top, vecs[i].y);
5920  Rect.right = max(Rect.right, vecs[i].x);
5921  Rect.bottom = max(Rect.bottom, vecs[i].y);
5922  }
5923  }
5924  else
5925  {
5926  // FIXME: Use vecs[0] ... vecs[3] and EngFillPath
5927  }
5928 
5929  if (dc->fs & (DC_ACCUM_APP | DC_ACCUM_WMGR))
5930  {
5932  }
5933 
5934  if (pdcattr->ulDirty_ & DIRTY_BACKGROUND)
5936  if (dc->dctype == DCTYPE_DIRECT)
5937  MouseSafetyOnDrawStart(dc->ppdev, Rect.left, Rect.top, Rect.right, Rect.bottom);
5938 
5939  SourcePoint.x = SourcePoint.y = 0;
5940  BrushOrigin.x = BrushOrigin.y = 0;
5941 
5942  psurf = dc->dclevel.pSurface;
5943  IntEngBitBlt(
5944  &psurf->SurfObj,
5945  NULL,
5946  NULL,
5947  (CLIPOBJ *)&dc->co,
5948  NULL,
5949  &Rect,
5950  &SourcePoint,
5951  &SourcePoint,
5952  &dc->eboBackground.BrushObject,
5953  &BrushOrigin,
5955 
5956  if (dc->dctype == DCTYPE_DIRECT)
5957  MouseSafetyOnDrawEnd(dc->ppdev);
5958  }
5959 
5960  EXLATEOBJ_vInitialize(&exloRGB2Dst, &gpalRGB, psurf->ppal, 0, 0, 0);
5961  EXLATEOBJ_vInitialize(&exloDst2RGB, psurf->ppal, &gpalRGB, 0, 0, 0);
5962 
5963  // The main rendering loop.
5964  bResult = TRUE;
5965  TextLeft64 = vecs[4].x << 6;
5966  TextTop64 = vecs[4].y << 6;
5967  previous = 0;
5968  for (i = 0; i < Count; ++i)
5969  {
5970  BOOL bNeedCache = (!EmuBold && !EmuItalic &&
5971  memcmp(&mat, &identityMat, sizeof(mat)) == 0);
5972  glyph_index = get_glyph_index_flagged(face, String[i], ETO_GLYPH_INDEX, fuOptions);
5973  realglyph = NULL;
5974  if (bNeedCache)
5975  {
5976  realglyph = ftGdiGlyphCacheGet(face, glyph_index, plf->lfHeight,
5977  RenderMode, pmxWorldToDevice);
5978  }
5979  if (!realglyph)
5980  {
5981  error = FT_Load_Glyph(face, glyph_index, FT_LOAD_DEFAULT);
5982  if (error)
5983  {
5984  DPRINT1("Failed to load and render glyph! [index: %d]\n", glyph_index);
5985  bResult = FALSE;
5986  break;
5987  }
5988  glyph = face->glyph;
5989  if (bNeedCache)
5990  {
5991  realglyph = ftGdiGlyphCacheSet(face,
5992  glyph_index,
5993  plf->lfHeight,
5994  pmxWorldToDevice,
5995  glyph,
5996  RenderMode);
5997  }
5998  else
5999  {
6000  if (EmuBold)
6001  FT_GlyphSlot_Embolden(glyph);
6002  if (EmuItalic)
6003  FT_GlyphSlot_Oblique(glyph);
6004  realglyph = ftGdiGlyphSet(face, glyph, RenderMode);
6005  }
6006  if (!realglyph)
6007  {
6008  DPRINT1("Failed to render glyph! [index: %d]\n", glyph_index);
6009  bResult = FALSE;
6010  break;
6011  }
6012  }
6013 
6014  /* retrieve kerning distance and move pen position */
6015  if (use_kerning && previous && glyph_index && NULL == Dx)
6016  {
6017  FT_Vector delta;
6018  FT_Get_Kerning(face, previous, glyph_index, 0, &delta);
6019  TextLeft64 += delta.x;
6020  TextTop64 -= delta.y;
6021  }
6022  DPRINT("TextLeft64: %I64d\n", TextLeft64);
6023  DPRINT("TextTop64: %I64d\n", TextTop64);
6024  DPRINT("Advance: %d\n", realglyph->root.advance.x);
6025 
6026  DestRect.left = ((TextLeft64 + 32) >> 6) + realglyph->left;
6027  DestRect.right = DestRect.left + realglyph->bitmap.width;
6028  DestRect.top = ((TextTop64 + 32) >> 6) - realglyph->top;
6029  DestRect.bottom = DestRect.top + realglyph->bitmap.rows;
6030 
6031  bitSize.cx = realglyph->bitmap.width;
6032  bitSize.cy = realglyph->bitmap.rows;
6033  MaskRect.right = realglyph->bitmap.width;
6034  MaskRect.bottom = realglyph->bitmap.rows;
6035 
6036  /* Check if the bitmap has any pixels */
6037  if ((bitSize.cx != 0) && (bitSize.cy != 0))
6038  {
6039  /*
6040  * We should create the bitmap out of the loop at the biggest possible
6041  * glyph size. Then use memset with 0 to clear it and sourcerect to
6042  * limit the work of the transbitblt.
6043  */
6044  HSourceGlyph = EngCreateBitmap(bitSize, realglyph->bitmap.pitch,
6046  realglyph->bitmap.buffer);
6047  if ( !HSourceGlyph )
6048  {
6049  DPRINT1("WARNING: EngCreateBitmap() failed!\n");
6050  bResult = FALSE;
6051  if (EmuBold || EmuItalic)
6052  {
6053  FT_Done_Glyph((FT_Glyph)realglyph);
6054  }
6055 
6056  break;
6057  }
6058  SourceGlyphSurf = EngLockSurface((HSURF)HSourceGlyph);
6059  if ( !SourceGlyphSurf )
6060  {
6061  EngDeleteSurface((HSURF)HSourceGlyph);
6062  DPRINT1("WARNING: EngLockSurface() failed!\n");
6063  bResult = FALSE;
6064  if (EmuBold || EmuItalic)
6065  {
6066  FT_Done_Glyph((FT_Glyph)realglyph);
6067  }
6068 
6069  break;
6070  }
6071 
6072  /*
6073  * Use the font data as a mask to paint onto the DCs surface using a
6074  * brush.
6075  */
6076  if (lprc && (fuOptions & ETO_CLIPPED) &&
6077  DestRect.right >= lprc->right + dc->ptlDCOrig.x)
6078  {
6079  // We do the check '>=' instead of '>' to possibly save an iteration
6080  // through this loop, since it's breaking after the drawing is done,
6081  // and x is always incremented.
6082  DestRect.right = lprc->right + dc->ptlDCOrig.x;
6083  DoBreak = TRUE;
6084  }
6085  if (lprc && (fuOptions & ETO_CLIPPED) &&
6086  DestRect.bottom >= lprc->bottom + dc->ptlDCOrig.y)
6087  {
6088  DestRect.bottom = lprc->bottom + dc->ptlDCOrig.y;
6089  }
6090 
6091  if (dc->dctype == DCTYPE_DIRECT)
6092  MouseSafetyOnDrawStart(dc->ppdev, DestRect.left, DestRect.top, DestRect.right, DestRect.bottom);
6093 
6094  if (!IntEngMaskBlt(
6095  SurfObj,
6096  SourceGlyphSurf,
6097  (CLIPOBJ *)&dc->co,
6098  &exloRGB2Dst.xlo,
6099  &exloDst2RGB.xlo,
6100  &DestRect,
6101  (PPOINTL)&MaskRect,
6102  &dc->eboText.BrushObject,
6103  &BrushOrigin))
6104  {
6105  DPRINT1("Failed to MaskBlt a glyph!\n");
6106  }
6107 
6108  if (dc->dctype == DCTYPE_DIRECT)
6109  MouseSafetyOnDrawEnd(dc->ppdev) ;
6110 
6111  EngUnlockSurface(SourceGlyphSurf);
6112  EngDeleteSurface((HSURF)HSourceGlyph);
6113  }
6114 
6115  if (DoBreak)
6116  {
6117  if (EmuBold || EmuItalic)
6118  {
6119  FT_Done_Glyph((FT_Glyph)realglyph);
6120  }
6121 
6122  break;
6123  }
6124 
6125  if (NULL == Dx)
6126  {
6127  TextLeft64 += realglyph->root.advance.x >> 10;
6128  TextTop64 -= realglyph->root.advance.y >> 10;
6129  DPRINT("New TextLeft64: %I64d\n", TextLeft64);
6130  DPRINT("New TextTop64: %I64d\n", TextTop64);
6131  }
6132  else
6133  {
6134  // FIXME this should probably be a matrix transform with TextTop64 as well.
6135  Scale = pdcattr->mxWorldToDevice.efM11;
6136  if (FLOATOBJ_Equal0(&Scale))
6137  FLOATOBJ_Set1(&Scale);
6138 
6139  /* do the shift before multiplying to preserve precision */
6140  FLOATOBJ_MulLong(&Scale, Dx[i<<DxShift] << 6);
6141  TextLeft64 += FLOATOBJ_GetLong(&Scale);
6142  DPRINT("New TextLeft64 2: %I64d\n", TextLeft64);
6143  }
6144 
6145  if (DxShift)
6146  {
6147  TextTop64 -= Dx[2 * i + 1] << 6;
6148  }
6149 
6150  previous = glyph_index;
6151 
6152  /* No cache, so clean up */
6153  if (!bNeedCache)
6154  {
6155  FT_Done_Glyph((FT_Glyph)realglyph);
6156  }
6157  }
6158 
6159  if (plf->lfUnderline || plf->lfStrikeOut)
6160  {
6161  INT x0 = min(vecs[0].x, vecs[2].x);
6162  INT y0 = min(vecs[0].y, vecs[2].y);
6163  INT x1 = max(vecs[0].x, vecs[2].x);
6164  INT y1 = max(vecs[0].y, vecs[2].y);
6165  if (dc->dctype == DCTYPE_DIRECT)
6166  MouseSafetyOnDrawStart(dc->ppdev, x0, y0, x1, y1);
6167  }
6168 
6169  if (plf->lfUnderline)
6170  {
6171  for (i = -thickness / 2; i < -thickness / 2 + thickness; ++i)
6172  {
6173  LONG dx = (LONG)(DeltaX64 >> 6), dy = (LONG)(DeltaY64 >> 6);
6174  if (labs(dx) > labs(dy))
6175  {
6176  // move vertical
6177  EngLineTo(SurfObj, (CLIPOBJ *)&dc->co,
6178  &dc->eboText.BrushObject,
6179  vecs[5].x, vecs[5].y + i,
6180  vecs[6].x, vecs[6].y + i,
6182  }
6183  else
6184  {
6185  // move horizontal
6186  EngLineTo(SurfObj, (CLIPOBJ *)&dc->co,
6187  &dc->eboText.BrushObject,
6188  vecs[5].x + i, vecs[5].y,
6189  vecs[6].x + i, vecs[6].y,
6191  }
6192  }
6193  }
6194 
6195  if (plf->lfStrikeOut)
6196  {
6197  for (i = -thickness / 2; i < -thickness / 2 + thickness; ++i)
6198  {
6199  LONG dx = (LONG)(DeltaX64 >> 6), dy = (LONG)(DeltaY64 >> 6);
6200  if (labs(dx) > labs(dy))
6201  {
6202  // move vertical
6203  EngLineTo(SurfObj, (CLIPOBJ *)&dc->co,
6204  &dc->eboText.BrushObject,
6205  vecs[7].x, vecs[7].y + i,
6206  vecs[8].x, vecs[8].y + i,
6208  }
6209  else
6210  {
6211  // move horizontal
6212  EngLineTo(SurfObj, (CLIPOBJ *)&dc->co,
6213  &dc->eboText.BrushObject,
6214  vecs[7].x + i, vecs[7].y,
6215  vecs[8].x + i, vecs[8].y,
6217  }
6218  }
6219  }
6220 
6221  if (plf->lfUnderline || plf->lfStrikeOut)
6222  {
6223  if (dc->dctype == DCTYPE_DIRECT)
6224  MouseSafetyOnDrawEnd(dc->ppdev);
6225  }
6226 
6227  if (pdcattr->flTextAlign & TA_UPDATECP) {
6228  pdcattr->ptlCurrent.x = DestRect.right - dc->ptlDCOrig.x;
6229  }
6230 
6232 
6233  EXLATEOBJ_vCleanup(&exloRGB2Dst);
6234  EXLATEOBJ_vCleanup(&exloDst2RGB);
6235 
6236 Cleanup:
6237 
6239 
6240  if (TextObj != NULL)
6241  TEXTOBJ_UnlockText(TextObj);
6242 
6243  return bResult;
6244 }
#define ROP2_TO_MIX(Rop2)
Definition: inteng.h:40
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG y1
Definition: winddi.h:3706
#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 max(a, b)
Definition: svc.c:63
FT_Pos y
Definition: ftimage.h:77
#define TRUE
Definition: types.h:120
_In_ int _Inout_ LPRECT lprc
Definition: winuser.h:4334
ENGAPI BOOL APIENTRY EngDeleteSurface(_In_ _Post_ptr_invalid_ HSURF hsurf)
Definition: surface.c:564
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
unsigned int rows
Definition: ftimage.h:263
#define error(str)
Definition: mkdosfs.c:1605
GLint x0
Definition: linetemp.h:95
VOID FASTCALL DC_vUpdateBackgroundBrush(PDC pdc)
Definition: dcobjs.c:126
#define MAXLONG
Definition: umtypes.h:116
FT_Set_Transform(FT_Face face, FT_Matrix *matrix, FT_Vector *delta)
Definition: ftobjs.c:653
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 pt(x, y)
Definition: drawing.c:79
#define FLOATOBJ_Set1(fo)
Definition: floatobj.h:120
struct _MATRIX * PMATRIX
GLint dy
Definition: linetemp.h:97
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3706
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
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
LONG lfEscapement
Definition: dimm.idl:61
static const MAT2 mat
Definition: font.c:66
HDC dc
Definition: cylfrac.c:34
Definition: xlate.c:10
static WCHAR String[]
Definition: stringtable.c:55
FT_Matrix_Multiply(const FT_Matrix *a, FT_Matrix *b)
Definition: ftcalc.c:661
_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
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:2857
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:3317
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:327
SURFOBJ SurfObj
Definition: surface.h:8
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
LONG lfWidth
Definition: dimm.idl:60
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
VOID FASTCALL DC_vUpdateWorldToDevice(PDC pdc)
Definition: coord.c:181
#define TA_UPDATECP
Definition: wingdi.h:935
typedef HSURF(APIENTRY FN_DrvEnableSurface)(_In_ DHPDEV dhpdev)
ULONG ulDirty_
Definition: ntgdihdl.h:291
VOID FASTCALL FtMatrixFromMx(FT_Matrix *pmat, PMATRIX pmx)
Definition: freetype.c:697
#define gmxWorldToDeviceDefault
Definition: freetype.c:49
#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
LONG OriginalWeight
Definition: engobjects.h:154
#define IntUnLockFreeType()
Definition: freetype.c:81
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
#define IntLPtoDP(pdc, ppt, count)
Definition: coord.h:7
BOOL FASTCALL IntIsFontRenderingEnabled(VOID)
Definition: freetype.c:1642
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:78
#define MINLONG
Definition: umtypes.h:115
LONG tmHeight
Definition: engobjects.h:158
static FT_UInt FASTCALL get_glyph_index_flagged(FT_Face face, FT_ULong code, DWORD indexed_flag, DWORD flags)
Definition: freetype.c:3419
MATRIX mxWorldToDevice
Definition: ntgdihdl.h:328
static const WCHAR Cleanup[]
Definition: register.c:80
ENUMLOGFONTEXDVW logfont
Definition: text.h:70
BYTE jBkMode
Definition: ntgdihdl.h:305
FONTOBJ * Font
Definition: text.h:66
VOID FASTCALL IntEscapeMatrix(FT_Matrix *pmat, LONG lfEscapement)
Definition: freetype.c:686
FT_Vector_Transform(FT_Vector *vec, const FT_Matrix *matrix)
Definition: ftoutln.c:688
#define FW_BOLD
Definition: wingdi.h:377
FT_BitmapGlyph APIENTRY ftGdiGlyphCacheSet(FT_Face Face, INT GlyphIndex, INT Height, PMATRIX pmx, FT_GlyphSlot GlyphSlot, FT_Render_Mode RenderMode)
Definition: freetype.c:2898
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
GLint y0
Definition: linetemp.h:96
FT_BitmapGlyph APIENTRY ftGdiGlyphCacheGet(FT_Face Face, INT GlyphIndex, INT Height, FT_Render_Mode RenderMode, PMATRIX pmx)
Definition: freetype.c:2820
ENGAPI VOID APIENTRY EngUnlockSurface(_In_ _Post_ptr_invalid_ SURFOBJ *pso)
Definition: surface.c:625
#define min(a, b)
Definition: monoChain.cc:55
VOID FASTCALL DC_vPrepareDCsForBlit(PDC pdcDest, const RECT *rcDest, PDC pdcSrc, const RECT *rcSrc)
Definition: dclife.c:497
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLint dx
Definition: linetemp.h:97
int pitch
Definition: ftimage.h:265
#define FW_NORMAL
Definition: wingdi.h:372
#define ETO_PDY
Definition: wingdi.h:656
FLONG flTextAlign
Definition: ntgdihdl.h:321
#define DPRINT1
Definition: precomp.h:8
static const FT_Matrix identityMat
Definition: freetype.c:46
VOID FASTCALL DC_vFinishBlit(PDC pdc1, PDC pdc2)
Definition: dclife.c:606
#define VALIGN_MASK
FORCEINLINE LONG FASTCALL IntNormalizeAngle(LONG nTenthAngle)
Definition: freetype.c:5501
FT_Vector advance
Definition: ftglyph.h:113
LOGFONTW elfLogFont
Definition: wingdi.h:2680
VOID FASTCALL IntUpdateBoundsRect(PDC, PRECTL)
Definition: dcutil.c:690
FT_Render_Mode FASTCALL IntGetFontRenderMode(LOGFONTW *logfont)
Definition: freetype.c:1654
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
LONG bottom
Definition: windef.h:294
#define ObjToGDI(ClipObj, Type)
Definition: engobjects.h:180
FORCEINLINE PMATRIX DC_pmxWorldToDevice(PDC pdc)
Definition: coord.h:96
PALETTE gpalRGB
Definition: palette.c:17
_Check_return_ long __cdecl labs(_In_ long x)
static HBITMAP
Definition: button.c:44
#define TA_CENTER
Definition: wingdi.h:930
LONG lfWeight
Definition: dimm.idl:63
ENUMLOGFONTEXW elfEnumLogfontEx
Definition: wingdi.h:2757
#define FT_IS_SCALABLE(face)
Definition: freetype.h:1312
BYTE lfUnderline
Definition: dimm.idl:65
FT_Done_Glyph(FT_Glyph glyph)
Definition: ftglyph.c:633
POINTL ptlCurrent
Definition: ntgdihdl.h:308
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
struct Rect Rect
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
VOID FASTCALL IntWidthMatrix(FT_Face face, FT_Matrix *pmat, LONG lfWidth)
Definition: freetype.c:654
#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:497
VOID FASTCALL DC_vFinishBlit(PDC pdc1, PDC pdc2)
Definition: dclife.c:606
VOID FASTCALL IntUpdateBoundsRect(PDC, PRECTL)
Definition: dcutil.c:690
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 445 of file gdibatch.c.

446 {
447  PTEB pTeb = NtCurrentTeb();
448  ULONG GdiBatchCount = pTeb->GdiBatchCount;
449 
450  if( (GdiBatchCount > 0) && (GdiBatchCount <= (GDIBATCHBUFSIZE/4)))
451  {
452  HDC hDC = (HDC) pTeb->GdiTebBatch.HDC;
453 
454  /* If hDC is zero and the buffer fills up with delete objects we need
455  to run anyway.
456  */
457  if (hDC || GdiBatchCount)
458  {
459  PCHAR pHdr = (PCHAR)&pTeb->GdiTebBatch.Buffer[0];
460  PDC pDC = NULL;
461 
463  {
464  pDC = DC_LockDc(hDC);
465  }
466 
467  // No need to init anything, just go!
468  for (; GdiBatchCount > 0; GdiBatchCount--)
469  {
470  ULONG Size;
471  // Process Gdi Batch!
472  Size = GdiFlushUserBatch(pDC, (PGDIBATCHHDR) pHdr);
473  if (!Size) break;
474  pHdr += Size;
475  }
476 
477  if (pDC)
478  {
479  DC_UnlockDc(pDC);
480  }
481 
482  // Exit and clear out for the next round.
483  pTeb->GdiTebBatch.Offset = 0;
484  pTeb->GdiBatchCount = 0;
485  pTeb->GdiTebBatch.HDC = 0;
486  }
487  }
488 
489  // FIXME: On Windows XP the function returns &pTeb->RealClientId, maybe VOID?
490  return STATUS_SUCCESS;
491 }
signed char * PCHAR
Definition: retypes.h:7
BOOL NTAPI GreIsHandleValid(HGDIOBJ hobj)
Definition: gdiobj.c:1141
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:197
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:2725
HANDLE HDC
Definition: compat.h:481

Referenced by DriverEntry(), and NtGdiDeleteObjectApp().

◆ 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().