ReactOS  0.4.13-dev-235-g7373cb3
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: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
struct _GDIBSEXTSELCLPRGN * PGDIBSEXTSELCLPRGN
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
int FASTCALL IntGdiExtSelectClipRect(PDC, PRECTL, int)
#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
#define PAGE_XLATE_CHANGED
Definition: ntgdihdl.h:197
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
POINTL ptlViewportOrg
Definition: ntgdityp.h:533
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:5579
#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
POINTL ptlViewportOrg
Definition: ntgdityp.h:520
ULONG ulBrushClr
Definition: ntgdityp.h:472
DWORD iCS_CP
Definition: ntgdityp.h:515
#define WORLD_XFORM_CHANGED
Definition: ntgdihdl.h:199
_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 *)
#define DEVICE_TO_WORLD_INVALID
Definition: ntgdihdl.h:188
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 5579 of file freetype.c.

5589 {
5590  /*
5591  * FIXME:
5592  * Call EngTextOut, which does the real work (calling DrvTextOut where
5593  * appropriate)
5594  */
5595 
5596  PDC_ATTR pdcattr;
5597  SURFOBJ *SurfObj;
5598  SURFACE *psurf = NULL;
5599  int error, glyph_index, i;
5600  FT_Face face;
5601  FT_GlyphSlot glyph;
5602  FT_BitmapGlyph realglyph;
5603  LONGLONG TextLeft64, TextTop64, DeltaX64, DeltaY64, XStart64, YStart64;
5604  ULONG previous;
5605  FT_Bool use_kerning;
5606  RECTL DestRect, MaskRect;
5607  POINTL SourcePoint, BrushOrigin;
5608  HBITMAP HSourceGlyph;
5609  SURFOBJ *SourceGlyphSurf;
5610  SIZEL bitSize;
5611  FONTOBJ *FontObj;
5612  PFONTGDI FontGDI;
5613  PTEXTOBJ TextObj = NULL;
5614  EXLATEOBJ exloRGB2Dst, exloDst2RGB;
5615  FT_Render_Mode RenderMode;
5616  BOOLEAN Render;
5617  POINT Start;
5618  BOOL DoBreak = FALSE;
5619  USHORT DxShift;
5620  PMATRIX pmxWorldToDevice;
5621  LONG lfEscapement, lfWidth;
5622  FLOATOBJ Scale;
5623  LOGFONTW *plf;
5624  BOOL EmuBold, EmuItalic;
5625  int thickness;
5626  BOOL bResult;
5627  FT_Matrix mat = identityMat, matWidth, matEscape, matWorld;
5628  FT_Vector vecs[9];
5629 
5630  /* Check if String is valid */
5631  if ((Count > 0xFFFF) || (Count > 0 && String == NULL))
5632  {
5634  return FALSE;
5635  }
5636 
5637  Render = IntIsFontRenderingEnabled();
5638 
5639  if (PATH_IsPathOpen(dc->dclevel))
5640  {
5641  bResult = PATH_ExtTextOut(dc,
5642  XStart,
5643  YStart,
5644  fuOptions,
5645  (const RECTL *)lprc,
5646  String,
5647  Count,
5648  (const INT *)Dx);
5649  return bResult;
5650  }
5651 
5653 
5654  if (!dc->dclevel.pSurface)
5655  {
5656  /* Memory DC with no surface selected */
5657  bResult = TRUE;
5658  goto Cleanup;
5659  }
5660 
5661  pdcattr = dc->pdcattr;
5662 
5663  if (lprc && (fuOptions & (ETO_OPAQUE | ETO_CLIPPED)))
5664  {
5665  IntLPtoDP(dc, (POINT *)lprc, 2);
5666  }
5667 
5668  if (pdcattr->flTextAlign & TA_UPDATECP)
5669  {
5671  }
5672  else
5673  {
5674  Start.x = XStart;
5675  Start.y = YStart;
5676  }
5677 
5678  SourcePoint.x = 0;
5679  SourcePoint.y = 0;
5680  MaskRect.left = 0;
5681  MaskRect.top = 0;
5682  BrushOrigin.x = 0;
5683  BrushOrigin.y = 0;
5684 
5685  if ((fuOptions & ETO_OPAQUE) && lprc)
5686  {
5687  DestRect.left = lprc->left;
5688  DestRect.top = lprc->top;
5689  DestRect.right = lprc->right;
5690  DestRect.bottom = lprc->bottom;
5691 
5692  DestRect.left += dc->ptlDCOrig.x;
5693  DestRect.top += dc->ptlDCOrig.y;
5694  DestRect.right += dc->ptlDCOrig.x;
5695  DestRect.bottom += dc->ptlDCOrig.y;
5696 
5697  if (dc->fs & (DC_ACCUM_APP|DC_ACCUM_WMGR))
5698  {
5699  IntUpdateBoundsRect(dc, &DestRect);
5700  }
5701 
5702  if (pdcattr->ulDirty_ & DIRTY_BACKGROUND)
5704  if (dc->dctype == DCTYPE_DIRECT)
5705  MouseSafetyOnDrawStart(dc->ppdev, DestRect.left, DestRect.top, DestRect.right, DestRect.bottom);
5706 
5707  psurf = dc->dclevel.pSurface;
5708  IntEngBitBlt(
5709  &psurf->SurfObj,
5710  NULL,
5711  NULL,
5712  (CLIPOBJ *)&dc->co,
5713  NULL,
5714  &DestRect,
5715  &SourcePoint,
5716  &SourcePoint,
5717  &dc->eboBackground.BrushObject,
5718  &BrushOrigin,
5720 
5721  if (dc->dctype == DCTYPE_DIRECT)
5722  MouseSafetyOnDrawEnd(dc->ppdev);
5723 
5724  fuOptions &= ~ETO_OPAQUE;
5725  }
5726  else
5727  {
5728  if (pdcattr->jBkMode == OPAQUE)
5729  {
5730  fuOptions |= ETO_OPAQUE;
5731  }
5732  }
5733 
5734  TextObj = RealizeFontInit(pdcattr->hlfntNew);
5735  if (TextObj == NULL)
5736  {
5737  bResult = FALSE;
5738  goto Cleanup;
5739  }
5740 
5741  FontObj = TextObj->Font;
5742  ASSERT(FontObj);
5743  FontGDI = ObjToGDI(FontObj, FONT);
5744  ASSERT(FontGDI);
5745 
5746  IntLockFreeType();
5747  face = FontGDI->SharedFace->Face;
5748 
5749  plf = &TextObj->logfont.elfEnumLogfontEx.elfLogFont;
5750  EmuBold = (plf->lfWeight >= FW_BOLD && FontGDI->OriginalWeight <= FW_NORMAL);
5751  EmuItalic = (plf->lfItalic && !FontGDI->OriginalItalic);
5752  if (FT_IS_SCALABLE(face))
5753  {
5754  lfEscapement = IntNormalizeAngle(plf->lfEscapement);
5755  lfWidth = labs(plf->lfWidth);
5756  }
5757  else
5758  {
5759  lfEscapement = lfWidth = 0;
5760  }
5761 
5762  if (Render)
5763  RenderMode = IntGetFontRenderMode(plf);
5764  else
5765  RenderMode = FT_RENDER_MODE_MONO;
5766 
5767  if (!TextIntUpdateSize(dc, TextObj, FontGDI, FALSE))
5768  {
5770  bResult = FALSE;
5771  goto Cleanup;
5772  }
5773 
5774  /* NOTE: Don't trust face->size->metrics.ascender and descender values. */
5776  if (dc->pdcattr->iGraphicsMode == GM_ADVANCED)
5777  {
5778  pmxWorldToDevice = DC_pmxWorldToDevice(dc);
5779  }
5780  else
5781  {
5782  pmxWorldToDevice = (PMATRIX)&gmxWorldToDeviceDefault;
5783  }
5784 
5785  IntWidthMatrix(face, &matWidth, lfWidth);
5786  FT_Matrix_Multiply(&matWidth, &mat);
5787 
5788  IntEscapeMatrix(&matEscape, lfEscapement);
5789  FT_Matrix_Multiply(&matEscape, &mat);
5790 
5791  FtMatrixFromMx(&matWorld, pmxWorldToDevice);
5792  matWorld.yx = -matWorld.yx;
5793  matWorld.xy = -matWorld.xy;
5794  FT_Matrix_Multiply(&matWorld, &mat);
5795 
5797 
5798  // Calculate displacement of the text.
5799  DeltaX64 = DeltaY64 = 0;
5800  DxShift = fuOptions & ETO_PDY ? 1 : 0;
5801  use_kerning = FT_HAS_KERNING(face);
5802  previous = 0;
5803  if ((fuOptions & ETO_OPAQUE) ||
5804  (pdcattr->flTextAlign & (TA_CENTER | TA_RIGHT)) ||
5805  memcmp(&mat, &identityMat, sizeof(mat)) != 0 ||
5806  plf->lfUnderline || plf->lfStrikeOut)
5807  {
5808  for (i = 0; i < Count; ++i)
5809  {
5810  glyph_index = get_glyph_index_flagged(face, String[i], ETO_GLYPH_INDEX, fuOptions);
5811 
5812  // FIXME: Use FT_LOAD_BITMAP_METRICS_ONLY or cache.
5813  error = FT_Load_Glyph(face, glyph_index, FT_LOAD_DEFAULT);
5814  if (error)
5815  {
5816  DPRINT1("Failed to load glyph! [index: %d]\n", glyph_index);
5818  bResult = FALSE;
5819  goto Cleanup;
5820  }
5821 
5822  glyph = face->glyph;
5823  if (EmuBold)
5824  FT_GlyphSlot_Embolden(glyph);
5825  if (EmuItalic)
5826  FT_GlyphSlot_Oblique(glyph);
5827  realglyph = ftGdiGlyphSet(face, glyph, RenderMode);
5828  if (!realglyph)
5829  {
5830  DPRINT1("Failed to render glyph! [index: %d]\n", glyph_index);
5832  bResult = FALSE;
5833  goto Cleanup;
5834  }
5835 
5836  /* retrieve kerning distance and move pen position */
5837  if (use_kerning && previous && glyph_index && Dx == NULL)
5838  {
5839  FT_Vector delta;
5840  FT_Get_Kerning(face, previous, glyph_index, 0, &delta);
5841  DeltaX64 += delta.x;
5842  DeltaY64 -= delta.y;
5843  }
5844 
5845  if (Dx == NULL)
5846  {
5847  DeltaX64 += realglyph->root.advance.x >> 10;
5848  DeltaY64 -= realglyph->root.advance.y >> 10;
5849  }
5850  else
5851  {
5852  // FIXME this should probably be a matrix transform with DeltaY64 as well.
5853  Scale = pdcattr->mxWorldToDevice.efM11;
5854  if (FLOATOBJ_Equal0(&Scale))
5855  FLOATOBJ_Set1(&Scale);
5856 
5857  /* do the shift before multiplying to preserve precision */
5858  FLOATOBJ_MulLong(&Scale, Dx[i << DxShift] << 6);
5859  DeltaX64 += FLOATOBJ_GetLong(&Scale);
5860  }
5861 
5862  if (DxShift)
5863  {
5864  DeltaY64 -= Dx[2 * i + 1] << 6;
5865  }
5866 
5867  previous = glyph_index;
5868 
5869  FT_Done_Glyph((FT_Glyph)realglyph);
5870  }
5871  }
5872 
5873  // Process the X and Y alignments.
5874  if ((pdcattr->flTextAlign & TA_CENTER) == TA_CENTER)
5875  {
5876  XStart64 = -DeltaX64 / 2;
5877  YStart64 = -DeltaY64 / 2;
5878  }
5879  else if ((pdcattr->flTextAlign & TA_RIGHT) == TA_RIGHT)
5880  {
5881  XStart64 = -DeltaX64;
5882  YStart64 = -DeltaY64;
5883  }
5884  else
5885  {
5886  XStart64 = YStart64 = 0;
5887  }
5888 
5889  psurf = dc->dclevel.pSurface;
5890  SurfObj = &psurf->SurfObj ;
5891 
5892  if ((fuOptions & ETO_OPAQUE) && (dc->pdcattr->ulDirty_ & DIRTY_BACKGROUND))
5894 
5895  if (dc->pdcattr->ulDirty_ & DIRTY_TEXT)
5897 
5898  thickness = 1;
5899  if (face->units_per_EM)
5900  {
5901  thickness = face->underline_thickness *
5902  face->size->metrics.y_ppem / face->units_per_EM;
5903  if (thickness <= 0)
5904  thickness = 1;
5905  }
5906 
5907  /* Process the vertical alignment */
5908 #define VALIGN_MASK (TA_TOP | TA_BASELINE | TA_BOTTOM)
5909  RtlZeroMemory(vecs, sizeof(vecs));
5910  if ((pdcattr->flTextAlign & VALIGN_MASK) == TA_BASELINE)
5911  {
5912  vecs[1].y = -FontGDI->tmAscent << 16; // upper left
5913  vecs[4].y = 0; // baseline
5914  vecs[0].y = FontGDI->tmDescent << 16; // lower left
5915  }
5916  else if ((pdcattr->flTextAlign & VALIGN_MASK) == TA_BOTTOM)
5917  {
5918  vecs[1].y = -FontGDI->tmHeight << 16; // upper left
5919  vecs[4].y = -FontGDI->tmDescent << 16; // baseline
5920  vecs[0].y = 0; // lower left
5921  }
5922  else /* TA_TOP */
5923  {
5924  vecs[1].y = 0; // upper left
5925  vecs[4].y = FontGDI->tmAscent << 16; // baseline
5926  vecs[0].y = FontGDI->tmHeight << 16; // lower left
5927  }
5928  vecs[2] = vecs[1]; // upper right
5929  vecs[3] = vecs[0]; // lower right
5930 #undef VALIGN_MASK
5931 
5932  // underline
5933  if (plf->lfUnderline)
5934  {
5935  int position = 0;
5936  if (face->units_per_EM)
5937  {
5938  position = face->underline_position *
5939  face->size->metrics.y_ppem / face->units_per_EM;
5940  }
5941  vecs[5].y = vecs[6].y = vecs[4].y - (position << 16);
5942  }
5943 
5944  // strike through
5945  if (plf->lfStrikeOut)
5946  {
5947  vecs[7].y = vecs[8].y = vecs[4].y - ((FontGDI->tmAscent / 3) << 16);
5948  }
5949 
5950  // invert y axis
5951  IntEscapeMatrix(&matEscape, -lfEscapement);
5952 
5953  matWorld.yx = -matWorld.yx;
5954  matWorld.xy = -matWorld.xy;
5955 
5956  // convert vecs
5957  for (i = 0; i < 9; ++i)
5958  {
5959  FT_Vector_Transform(&vecs[i], &matWidth);
5960  FT_Vector_Transform(&vecs[i], &matEscape);
5961  FT_Vector_Transform(&vecs[i], &matWorld);
5962  }
5963  vecs[2].x += DeltaX64 << 10;
5964  vecs[2].y += DeltaY64 << 10; // upper right
5965  vecs[3].x += DeltaX64 << 10;
5966  vecs[3].y += DeltaY64 << 10; // lower right
5967  vecs[6].x += DeltaX64 << 10;
5968  vecs[6].y += DeltaY64 << 10; // underline right
5969  vecs[8].x += DeltaX64 << 10;
5970  vecs[8].y += DeltaY64 << 10; // strike through right
5971 
5972  {
5973  POINT pt;
5974  pt.x = Start.x + (XStart64 >> 6);
5975  pt.y = Start.y + (YStart64 >> 6);
5976  IntLPtoDP(dc, &pt, 1);
5977 
5978  for (i = 0; i < 9; ++i)
5979  {
5980  vecs[i].x += pt.x << 16;
5981  vecs[i].y += pt.y << 16;
5982  vecs[i].x >>= 16;
5983  vecs[i].y >>= 16;
5984  vecs[i].x += dc->ptlDCOrig.x;
5985  vecs[i].y += dc->ptlDCOrig.y;
5986  }
5987  }
5988 
5989  if (fuOptions & ETO_OPAQUE)
5990  {
5991  /* Draw background */
5992  RECTL Rect;
5993  RtlZeroMemory(&Rect, sizeof(Rect));
5994 
5995  if ((mat.xy == 0 && mat.yx == 0) || (mat.xx == 0 && mat.yy == 0))
5996  {
5997  Rect.left = Rect.top = MAXLONG;
5998  Rect.right = Rect.bottom = MINLONG;
5999  for (i = 0; i < 4; ++i)
6000  {
6001  Rect.left = min(Rect.left, vecs[i].x);
6002  Rect.top = min(Rect.top, vecs[i].y);
6003  Rect.right = max(Rect.right, vecs[i].x);
6004  Rect.bottom = max(Rect.bottom, vecs[i].y);
6005  }
6006  }
6007  else
6008  {
6009  // FIXME: Use vecs[0] ... vecs[3] and EngFillPath
6010  }
6011 
6012  if (dc->fs & (DC_ACCUM_APP | DC_ACCUM_WMGR))
6013  {
6015  }
6016 
6017  if (pdcattr->ulDirty_ & DIRTY_BACKGROUND)
6019  if (dc->dctype == DCTYPE_DIRECT)
6020  MouseSafetyOnDrawStart(dc->ppdev, Rect.left, Rect.top, Rect.right, Rect.bottom);
6021 
6022  SourcePoint.x = SourcePoint.y = 0;
6023  BrushOrigin.x = BrushOrigin.y = 0;
6024 
6025  psurf = dc->dclevel.pSurface;
6026  IntEngBitBlt(
6027  &psurf->SurfObj,
6028  NULL,
6029  NULL,
6030  (CLIPOBJ *)&dc->co,
6031  NULL,
6032  &Rect,
6033  &SourcePoint,
6034  &SourcePoint,
6035  &dc->eboBackground.BrushObject,
6036  &BrushOrigin,
6038 
6039  if (dc->dctype == DCTYPE_DIRECT)
6040  MouseSafetyOnDrawEnd(dc->ppdev);
6041  }
6042 
6043  EXLATEOBJ_vInitialize(&exloRGB2Dst, &gpalRGB, psurf->ppal, 0, 0, 0);
6044  EXLATEOBJ_vInitialize(&exloDst2RGB, psurf->ppal, &gpalRGB, 0, 0, 0);
6045 
6046  // The main rendering loop.
6047  bResult = TRUE;
6048  TextLeft64 = vecs[4].x << 6;
6049  TextTop64 = vecs[4].y << 6;
6050  previous = 0;
6051  for (i = 0; i < Count; ++i)
6052  {
6053  BOOL bNeedCache = (!EmuBold && !EmuItalic &&
6054  memcmp(&mat, &identityMat, sizeof(mat)) == 0);
6055  glyph_index = get_glyph_index_flagged(face, String[i], ETO_GLYPH_INDEX, fuOptions);
6056  realglyph = NULL;
6057  if (bNeedCache)
6058  {
6059  realglyph = ftGdiGlyphCacheGet(face, glyph_index, plf->lfHeight,
6060  RenderMode, pmxWorldToDevice);
6061  }
6062  if (!realglyph)
6063  {
6064  error = FT_Load_Glyph(face, glyph_index, FT_LOAD_DEFAULT);
6065  if (error)
6066  {
6067  DPRINT1("Failed to load and render glyph! [index: %d]\n", glyph_index);
6068  bResult = FALSE;
6069  break;
6070  }
6071  glyph = face->glyph;
6072  if (bNeedCache)
6073  {
6074  realglyph = ftGdiGlyphCacheSet(face,
6075  glyph_index,
6076  plf->lfHeight,
6077  pmxWorldToDevice,
6078  glyph,
6079  RenderMode);
6080  }
6081  else
6082  {
6083  if (EmuBold)
6084  FT_GlyphSlot_Embolden(glyph);
6085  if (EmuItalic)
6086  FT_GlyphSlot_Oblique(glyph);
6087  realglyph = ftGdiGlyphSet(face, glyph, RenderMode);
6088  }
6089  if (!realglyph)
6090  {
6091  DPRINT1("Failed to render glyph! [index: %d]\n", glyph_index);
6092  bResult = FALSE;
6093  break;
6094  }
6095  }
6096 
6097  /* retrieve kerning distance and move pen position */
6098  if (use_kerning && previous && glyph_index && NULL == Dx)
6099  {
6100  FT_Vector delta;
6101  FT_Get_Kerning(face, previous, glyph_index, 0, &delta);
6102  TextLeft64 += delta.x;
6103  TextTop64 -= delta.y;
6104  }
6105  DPRINT("TextLeft64: %I64d\n", TextLeft64);
6106  DPRINT("TextTop64: %I64d\n", TextTop64);
6107  DPRINT("Advance: %d\n", realglyph->root.advance.x);
6108 
6109  DestRect.left = ((TextLeft64 + 32) >> 6) + realglyph->left;
6110  DestRect.right = DestRect.left + realglyph->bitmap.width;
6111  DestRect.top = ((TextTop64 + 32) >> 6) - realglyph->top;
6112  DestRect.bottom = DestRect.top + realglyph->bitmap.rows;
6113 
6114  bitSize.cx = realglyph->bitmap.width;
6115  bitSize.cy = realglyph->bitmap.rows;
6116  MaskRect.right = realglyph->bitmap.width;
6117  MaskRect.bottom = realglyph->bitmap.rows;
6118 
6119  /* Check if the bitmap has any pixels */
6120  if ((bitSize.cx != 0) && (bitSize.cy != 0))
6121  {
6122  /*
6123  * We should create the bitmap out of the loop at the biggest possible
6124  * glyph size. Then use memset with 0 to clear it and sourcerect to
6125  * limit the work of the transbitblt.
6126  */
6127  HSourceGlyph = EngCreateBitmap(bitSize, realglyph->bitmap.pitch,
6129  realglyph->bitmap.buffer);
6130  if ( !HSourceGlyph )
6131  {
6132  DPRINT1("WARNING: EngCreateBitmap() failed!\n");
6133  bResult = FALSE;
6134  if (EmuBold || EmuItalic)
6135  {
6136  FT_Done_Glyph((FT_Glyph)realglyph);
6137  }
6138 
6139  break;
6140  }
6141  SourceGlyphSurf = EngLockSurface((HSURF)HSourceGlyph);
6142  if ( !SourceGlyphSurf )
6143  {
6144  EngDeleteSurface((HSURF)HSourceGlyph);
6145  DPRINT1("WARNING: EngLockSurface() failed!\n");
6146  bResult = FALSE;
6147  if (EmuBold || EmuItalic)
6148  {
6149  FT_Done_Glyph((FT_Glyph)realglyph);
6150  }
6151 
6152  break;
6153  }
6154 
6155  /*
6156  * Use the font data as a mask to paint onto the DCs surface using a
6157  * brush.
6158  */
6159  if (lprc && (fuOptions & ETO_CLIPPED) &&
6160  DestRect.right >= lprc->right + dc->ptlDCOrig.x)
6161  {
6162  // We do the check '>=' instead of '>' to possibly save an iteration
6163  // through this loop, since it's breaking after the drawing is done,
6164  // and x is always incremented.
6165  DestRect.right = lprc->right + dc->ptlDCOrig.x;
6166  DoBreak = TRUE;
6167  }
6168  if (lprc && (fuOptions & ETO_CLIPPED) &&
6169  DestRect.bottom >= lprc->bottom + dc->ptlDCOrig.y)
6170  {
6171  DestRect.bottom = lprc->bottom + dc->ptlDCOrig.y;
6172  }
6173 
6174  if (dc->dctype == DCTYPE_DIRECT)
6175  MouseSafetyOnDrawStart(dc->ppdev, DestRect.left, DestRect.top, DestRect.right, DestRect.bottom);
6176 
6177  if (!IntEngMaskBlt(
6178  SurfObj,
6179  SourceGlyphSurf,
6180  (CLIPOBJ *)&dc->co,
6181  &exloRGB2Dst.xlo,
6182  &exloDst2RGB.xlo,
6183  &DestRect,
6184  (PPOINTL)&MaskRect,
6185  &dc->eboText.BrushObject,
6186  &BrushOrigin))
6187  {
6188  DPRINT1("Failed to MaskBlt a glyph!\n");
6189  }
6190 
6191  if (dc->dctype == DCTYPE_DIRECT)
6192  MouseSafetyOnDrawEnd(dc->ppdev) ;
6193 
6194  EngUnlockSurface(SourceGlyphSurf);
6195  EngDeleteSurface((HSURF)HSourceGlyph);
6196  }
6197 
6198  if (DoBreak)
6199  {
6200  if (EmuBold || EmuItalic)
6201  {
6202  FT_Done_Glyph((FT_Glyph)realglyph);
6203  }
6204 
6205  break;
6206  }
6207 
6208  if (NULL == Dx)
6209  {
6210  TextLeft64 += realglyph->root.advance.x >> 10;
6211  TextTop64 -= realglyph->root.advance.y >> 10;
6212  DPRINT("New TextLeft64: %I64d\n", TextLeft64);
6213  DPRINT("New TextTop64: %I64d\n", TextTop64);
6214  }
6215  else
6216  {
6217  // FIXME this should probably be a matrix transform with TextTop64 as well.
6218  Scale = pdcattr->mxWorldToDevice.efM11;
6219  if (FLOATOBJ_Equal0(&Scale))
6220  FLOATOBJ_Set1(&Scale);
6221 
6222  /* do the shift before multiplying to preserve precision */
6223  FLOATOBJ_MulLong(&Scale, Dx[i<<DxShift] << 6);
6224  TextLeft64 += FLOATOBJ_GetLong(&Scale);
6225  DPRINT("New TextLeft64 2: %I64d\n", TextLeft64);
6226  }
6227 
6228  if (DxShift)
6229  {
6230  TextTop64 -= Dx[2 * i + 1] << 6;
6231  }
6232 
6233  previous = glyph_index;
6234 
6235  /* No cache, so clean up */
6236  if (!bNeedCache)
6237  {
6238  FT_Done_Glyph((FT_Glyph)realglyph);
6239  }
6240  }
6241 
6242  if (plf->lfUnderline || plf->lfStrikeOut)
6243  {
6244  INT x0 = min(vecs[0].x, vecs[2].x);
6245  INT y0 = min(vecs[0].y, vecs[2].y);
6246  INT x1 = max(vecs[0].x, vecs[2].x);
6247  INT y1 = max(vecs[0].y, vecs[2].y);
6248  if (dc->dctype == DCTYPE_DIRECT)
6249  MouseSafetyOnDrawStart(dc->ppdev, x0, y0, x1, y1);
6250  }
6251 
6252  if (plf->lfUnderline)
6253  {
6254  for (i = -thickness / 2; i < -thickness / 2 + thickness; ++i)
6255  {
6256  LONG dx = (LONG)(DeltaX64 >> 6), dy = (LONG)(DeltaY64 >> 6);
6257  if (labs(dx) > labs(dy))
6258  {
6259  // move vertical
6260  EngLineTo(SurfObj, (CLIPOBJ *)&dc->co,
6261  &dc->eboText.BrushObject,
6262  vecs[5].x, vecs[5].y + i,
6263  vecs[6].x, vecs[6].y + i,
6265  }
6266  else
6267  {
6268  // move horizontal
6269  EngLineTo(SurfObj, (CLIPOBJ *)&dc->co,
6270  &dc->eboText.BrushObject,
6271  vecs[5].x + i, vecs[5].y,
6272  vecs[6].x + i, vecs[6].y,
6274  }
6275  }
6276  }
6277 
6278  if (plf->lfStrikeOut)
6279  {
6280  for (i = -thickness / 2; i < -thickness / 2 + thickness; ++i)
6281  {
6282  LONG dx = (LONG)(DeltaX64 >> 6), dy = (LONG)(DeltaY64 >> 6);
6283  if (labs(dx) > labs(dy))
6284  {
6285  // move vertical
6286  EngLineTo(SurfObj, (CLIPOBJ *)&dc->co,
6287  &dc->eboText.BrushObject,
6288  vecs[7].x, vecs[7].y + i,
6289  vecs[8].x, vecs[8].y + i,
6291  }
6292  else
6293  {
6294  // move horizontal
6295  EngLineTo(SurfObj, (CLIPOBJ *)&dc->co,
6296  &dc->eboText.BrushObject,
6297  vecs[7].x + i, vecs[7].y,
6298  vecs[8].x + i, vecs[8].y,
6300  }
6301  }
6302  }
6303 
6304  if (plf->lfUnderline || plf->lfStrikeOut)
6305  {
6306  if (dc->dctype == DCTYPE_DIRECT)
6307  MouseSafetyOnDrawEnd(dc->ppdev);
6308  }
6309 
6310  if (pdcattr->flTextAlign & TA_UPDATECP)
6311  {
6312  pdcattr->ptlCurrent.x = vecs[2].x - dc->ptlDCOrig.x;
6313  pdcattr->ptlCurrent.y = vecs[2].y - dc->ptlDCOrig.y;
6314  IntDPtoLP(dc, &pdcattr->ptlCurrent, 1);
6315  pdcattr->ulDirty_ &= ~DIRTY_PTLCURRENT;
6317  }
6318 
6320 
6321  EXLATEOBJ_vCleanup(&exloRGB2Dst);
6322  EXLATEOBJ_vCleanup(&exloDst2RGB);
6323 
6324 Cleanup:
6325 
6327 
6328  if (TextObj != NULL)
6329  TEXTOBJ_UnlockText(TextObj);
6330 
6331  return bResult;
6332 }
#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
#define IntDPtoLP(pdc, ppt, count)
Definition: coord.h:13
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
#define DIRTY_PTFXCURRENT
Definition: ntgdihdl.h:154
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:2901
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:3327
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:182
#define TA_UPDATECP
Definition: wingdi.h:935
typedef HSURF(APIENTRY FN_DrvEnableSurface)(_In_ DHPDEV dhpdev)
ULONG ulDirty_
Definition: ntgdihdl.h:291
VOID FASTCALL IntGetCurrentPositionEx(PDC dc, LPPOINT pt)
Definition: line.c:128
VOID FASTCALL FtMatrixFromMx(FT_Matrix *pmat, PMATRIX pmx)
Definition: freetype.c:731
#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
#define DIRTY_STYLESTATE
Definition: ntgdihdl.h:155
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:1676
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:3429
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:719
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:2942
#define DIRTY_PTLCURRENT
Definition: ntgdihdl.h:153
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:2864
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:505
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:614
#define VALIGN_MASK
FORCEINLINE LONG FASTCALL IntNormalizeAngle(LONG nTenthAngle)
Definition: freetype.c:5570
FT_Vector advance
Definition: ftglyph.h:113
LOGFONTW elfLogFont
Definition: wingdi.h:2680
VOID FASTCALL IntUpdateBoundsRect(PDC, PRECTL)
Definition: dcutil.c:689
FT_Render_Mode FASTCALL IntGetFontRenderMode(LOGFONTW *logfont)
Definition: freetype.c:1688
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:98
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:687
#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: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:2745
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().