ReactOS  0.4.13-dev-39-g8b6696f
eng.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define MIX_TO_ROP4(mix)
 
#define EngGetTickCount32()   (ULONG)EngGetTickCount()
 

Functions

 _Acquires_lock_ (_Global_critical_region_) _Requires_lock_not_held_(*hsem) _Acquires_shared_lock_(*hsem) ENGAPI VOID NTAPI EngAcquireSemaphoreShared(_Inout_ HSEMAPHORE hsem)
 
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)
 
VOID FASTCALL IntEngWindowChanged (_In_ struct _WND *Window, _In_ FLONG flChanged)
 
ULONGLONG APIENTRY EngGetTickCount (VOID)
 
HANDLE APIENTRY EngSecureMemForRead (PVOID Address, ULONG Length)
 
VOID DecompressBitmap (SIZEL Size, BYTE *CompressedBits, BYTE *UncompressedBits, LONG Delta, ULONG iFormat, ULONG cjSizeImage)
 

Variables

const BYTE gajRop2ToRop3 [16]
 

Macro Definition Documentation

◆ EngGetTickCount32

#define EngGetTickCount32 ( )    (ULONG)EngGetTickCount()

Definition at line 43 of file eng.h.

◆ MIX_TO_ROP4

#define MIX_TO_ROP4 (   mix)
Value:
(((ULONG)gajRop2ToRop3[((mix) - 1) & 0xF]) | \
((ULONG)gajRop2ToRop3[(((mix) >> 8) - 1) & 0xF] << 8))
const BYTE gajRop2ToRop3[16]
Definition: paint.c:15
_In_ PATHOBJ _In_ CLIPOBJ _In_ BRUSHOBJ _In_ POINTL _In_ MIX mix
Definition: winddi.h:3591
unsigned int ULONG
Definition: retypes.h:1

Definition at line 5 of file eng.h.

Function Documentation

◆ _Acquires_lock_()

_Acquires_lock_ ( _Global_critical_region_  )

Definition at line 59 of file Object.c.

64 {
66 
67  /* Try acquiring the lock */
69  {
70  /* Someone changed it, use the slow path */
72  }
73 
74  /* Sanity check */
75  FLT_ASSERT(PushLock->Locked);
76 }
#define InterlockedBitTestAndSet
Definition: interlocked.h:30
VOID FASTCALL ExfAcquirePushLockExclusive(PEX_PUSH_LOCK PushLock)
Definition: pushlock.c:471
#define KeEnterCriticalRegion()
Definition: ke_x.h:83
#define EX_PUSH_LOCK_LOCK_V
Definition: Object.c:28
signed int * PLONG
Definition: retypes.h:5
#define FLT_ASSERT(_e)
Definition: fltkernel.h:49

◆ DecompressBitmap()

VOID DecompressBitmap ( SIZEL  Size,
BYTE CompressedBits,
BYTE UncompressedBits,
LONG  Delta,
ULONG  iFormat,
ULONG  cjSizeImage 
)

Definition at line 21 of file rlecomp.c.

23 {
24  INT x = 0, y = Size.cy - 1;
25  INT i, c, c2, length;
26  INT width = Size.cx, height = y;
27  BYTE *begin = CompressedBits;
28  BYTE *bits = CompressedBits;
29  BYTE *temp;
30  BOOL is4bpp = FALSE;
31 
32  if ((Format == BMF_4RLE) || (Format == BMF_4BPP))
33  is4bpp = TRUE;
34  else if ((Format != BMF_8RLE) && (Format != BMF_8BPP))
35  return;
36 
37  _SEH2_TRY
38  {
39  while (y >= 0 && (bits - begin) <= cjSizeImage)
40  {
41  length = *bits++;
42  if (length)
43  {
44  c = *bits++;
45  for (i = 0; i < length; i++)
46  {
47  if (x >= width) break;
48  temp = UncompressedBits + (height - y) * Delta;
49  if (is4bpp)
50  {
51  temp += x / 2;
52  if (i & 1)
53  c2 = c & 0x0F;
54  else
55  c2 = c >> 4;
56  if (x & 1)
57  *temp |= c2;
58  else
59  *temp |= c2 << 4;
60  }
61  else
62  {
63  temp += x;
64  *temp = c;
65  }
66  x++;
67  }
68  }
69  else
70  {
71  length = *bits++;
72  switch (length)
73  {
74  case RLE_EOL:
75  x = 0;
76  y--;
77  break;
78  case RLE_END:
79  _SEH2_YIELD(return);
80  case RLE_DELTA:
81  x += *bits++;
82  y -= *bits++;
83  break;
84  default:
85  for (i = 0; i < length; i++)
86  {
87  if (!(is4bpp && i & 1))
88  c = *bits++;
89 
90  if (x < width)
91  {
92  temp = UncompressedBits + (height - y) * Delta;
93  if (is4bpp)
94  {
95  temp += x / 2;
96  if (i & 1)
97  c2 = c & 0x0F;
98  else
99  c2 = c >> 4;
100  if (x & 1)
101  *temp |= c2;
102  else
103  *temp |= c2 << 4;
104  }
105  else
106  {
107  temp += x;
108  *temp = c;
109  }
110  x++;
111  }
112  }
113  if ((bits - begin) & 1)
114  {
115  bits++;
116  }
117  }
118  }
119  }
120  }
122  {
123  DPRINT1("Decoding error\n");
124  }
125  _SEH2_END;
126 
127  return;
128 }
GLint GLint GLsizei width
Definition: gl.h:1546
#define TRUE
Definition: types.h:120
#define BMF_8RLE
Definition: winddi.h:362
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
Definition: xlate.c:10
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
Definition: glext.h:10929
int32_t INT
Definition: typedefs.h:56
_SEH2_TRY
Definition: create.c:4250
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
unsigned int BOOL
Definition: ntddk_ex.h:94
#define BMF_4RLE
Definition: winddi.h:361
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
static clock_t begin
Definition: xmllint.c:466
#define _SEH2_YIELD(STMT_)
Definition: pseh2_64.h:8
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
const GLubyte * c
Definition: glext.h:8905
unsigned char BYTE
Definition: mem.h:68
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
_SEH2_END
Definition: create.c:4424
static calc_node_t temp
Definition: rpn_ieee.c:38
static ULONG Delta
Definition: xboxvideo.c:28
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
#define DPRINT1
Definition: precomp.h:8
Definition: xlate.c:9
#define c
Definition: ke_i.h:80
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6

Referenced by GreCreateBitmapEx().

◆ EngGetTickCount()

ULONGLONG APIENTRY EngGetTickCount ( VOID  )

Definition at line 288 of file engmisc.c.

289 {
290  ULONG Multiplier;
291  LARGE_INTEGER TickCount;
292 
293  /* Get the multiplier and current tick count */
294  KeQueryTickCount(&TickCount);
295  Multiplier = SharedUserData->TickCountMultiplier;
296 
297  /* Convert to milliseconds and return */
298  return (Int64ShrlMod32(UInt32x32To64(Multiplier, TickCount.LowPart), 24) +
299  (Multiplier * (TickCount.HighPart << 8)));
300 }
VOID NTAPI KeQueryTickCount(IN PLARGE_INTEGER TickCount)
Definition: clock.c:165
#define SharedUserData
ULONG LowPart
Definition: typedefs.h:104
#define Int64ShrlMod32(a, b)
unsigned int ULONG
Definition: retypes.h:1
#define UInt32x32To64(a, b)
Definition: intsafe.h:258

◆ EngSecureMemForRead()

HANDLE APIENTRY EngSecureMemForRead ( PVOID  Address,
ULONG  Length 
)

Definition at line 196 of file mem.c.

197 {
198  {// HACK!!!
199  ULONG cPages;
200  volatile BYTE *pjProbe;
201 
202  _SEH2_TRY
203  {
207  while(cPages--)
208  {
209  /* Do a read probe */
210  (void)*pjProbe;
211  pjProbe += PAGE_SIZE;
212  }
213  }
215  {
216  _SEH2_YIELD(return NULL);
217  }
218  _SEH2_END;
219  return (HANDLE)-1;
220  }
222 }
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
_SEH2_TRY
Definition: create.c:4250
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
static WCHAR Address[46]
Definition: ping.c:68
#define ADDRESS_AND_SIZE_TO_SPAN_PAGES(_Va, _Size)
#define _SEH2_YIELD(STMT_)
Definition: pseh2_64.h:8
PVOID NTAPI MmSecureVirtualMemory(IN PVOID Address, IN SIZE_T Length, IN ULONG Mode)
Definition: virtual.c:2669
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
VOID NTAPI ProbeForRead(IN CONST VOID *Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:102
unsigned char BYTE
Definition: mem.h:68
#define PAGE_SIZE
Definition: env_spec_w32.h:49
_SEH2_END
Definition: create.c:4424
#define PAGE_READONLY
Definition: compat.h:127
unsigned int ULONG
Definition: retypes.h:1
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:6
#define ALIGN_DOWN_POINTER_BY(ptr, align)
Definition: umtypes.h:82

◆ IntEngMaskBlt()

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 at line 1028 of file bitblt.c.

1038 {
1039  BOOLEAN ret;
1040  RECTL rcDest;
1041  POINTL ptMask = {0,0};
1042  PSURFACE psurfTemp;
1043  RECTL rcTemp;
1044 
1045  ASSERT(psoDest);
1046  ASSERT(psoMask);
1047 
1048  /* Is this a 1 BPP mask? */
1049  if (psoMask->iBitmapFormat == BMF_1BPP)
1050  {
1051  /* Use IntEngBitBlt with an appropriate ROP4 */
1052  return IntEngBitBlt(psoDest,
1053  NULL,
1054  psoMask,
1055  pco,
1056  pxloDest,
1057  prclDest,
1058  NULL,
1059  pptlMask,
1060  pbo,
1061  pptlBrushOrg,
1062  ROP4_MASKPAINT);
1063  }
1064 
1065  ASSERT(psoMask->iBitmapFormat == BMF_8BPP);
1066 
1067  if (pptlMask)
1068  {
1069  ptMask = *pptlMask;
1070  }
1071 
1072  /* Clip against the bounds of the clipping region so we won't try to write
1073  * outside the surface */
1074  if (pco != NULL)
1075  {
1076  /* Intersect with the clip bounds and check if everything was clipped */
1077  if (!RECTL_bIntersectRect(&rcDest, prclDest, &pco->rclBounds))
1078  {
1079  return TRUE;
1080  }
1081 
1082  /* Adjust the mask point */
1083  ptMask.x += rcDest.left - prclDest->left;
1084  ptMask.y += rcDest.top - prclDest->top;
1085  }
1086  else
1087  {
1088  rcDest = *prclDest;
1089  }
1090 
1091  /* Check if the target surface is device managed */
1092  if (psoDest->iType != STYPE_BITMAP)
1093  {
1094  rcTemp.left = 0;
1095  rcTemp.top = 0;
1096  rcTemp.right = rcDest.right - rcDest.left;
1097  rcTemp.bottom = rcDest.bottom - rcDest.top;
1098 
1099  /* Allocate a temporary surface */
1100  psurfTemp = SURFACE_AllocSurface(STYPE_BITMAP,
1101  rcTemp.right,
1102  rcTemp.bottom,
1103  psoDest->iBitmapFormat,
1104  0,
1105  0,
1106  0,
1107  NULL);
1108  if (psurfTemp == NULL)
1109  {
1110  return FALSE;
1111  }
1112 
1113  /* Copy the current target surface bits to the temp surface */
1114  ret = EngCopyBits(&psurfTemp->SurfObj,
1115  psoDest,
1116  NULL, // pco
1117  NULL, // pxlo
1118  &rcTemp,
1119  (PPOINTL)&rcDest);
1120 
1121  if (ret)
1122  {
1123  /* Do the operation on the temp surface */
1124  ret = EngMaskBitBlt(&psurfTemp->SurfObj,
1125  psoMask,
1126  NULL,
1127  pxloDest,
1128  pxloSource,
1129  &rcTemp,
1130  &ptMask,
1131  pbo,
1132  pptlBrushOrg);
1133  }
1134 
1135  if (ret)
1136  {
1137  /* Copy the result back to the dest surface */
1138  ret = EngCopyBits(psoDest,
1139  &psurfTemp->SurfObj,
1140  pco,
1141  NULL,
1142  &rcDest,
1143  (PPOINTL)&rcTemp);
1144  }
1145 
1146  /* Delete the temp surface */
1147  GDIOBJ_vDeleteObject(&psurfTemp->BaseObject);
1148  }
1149  else
1150  {
1151  /* Do the operation on the target surface */
1152  ret = EngMaskBitBlt(psoDest,
1153  psoMask,
1154  pco,
1155  pxloDest,
1156  pxloSource,
1157  &rcDest,
1158  &ptMask,
1159  pbo,
1160  pptlBrushOrg);
1161  }
1162 
1163  return ret;
1164 }
#define TRUE
Definition: types.h:120
#define STYPE_BITMAP
Definition: winddi.h:1175
#define ROP4_MASKPAINT
Definition: inteng.h:56
long bottom
Definition: polytest.cpp:53
Definition: xlate.c:10
LONG y
Definition: windef.h:315
long right
Definition: polytest.cpp:53
_In_ PATHOBJ _In_ CLIPOBJ _In_ BRUSHOBJ _In_ POINTL * pptlBrushOrg
Definition: winddi.h:3591
long top
Definition: polytest.cpp:53
SURFOBJ SurfObj
Definition: surface.h:8
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
long left
Definition: polytest.cpp:53
BASEOBJECT BaseObject
Definition: surface.h:6
VOID NTAPI GDIOBJ_vDeleteObject(POBJ pobj)
Definition: gdiobj.c:1106
_In_opt_ SURFOBJ _In_opt_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL _In_opt_ POINTL _In_opt_ POINTL _In_opt_ BRUSHOBJ * pbo
Definition: winddi.h:3433
BOOL FASTCALL RECTL_bIntersectRect(_Out_ RECTL *prclDst, _In_ const RECTL *prcl1, _In_ const RECTL *prcl2)
Definition: rect.c:55
LONG x
Definition: windef.h:314
static BOOL APIENTRY EngMaskBitBlt(SURFOBJ *psoDest, SURFOBJ *psoMask, CLIPOBJ *ClipRegion, XLATEOBJ *DestColorTranslation, XLATEOBJ *SourceColorTranslation, RECTL *DestRect, POINTL *pptlMask, BRUSHOBJ *pbo, POINTL *BrushOrigin)
Definition: bitblt.c:818
_In_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL * prclDest
Definition: winddi.h:3414
PSURFACE NTAPI SURFACE_AllocSurface(_In_ USHORT iType, _In_ ULONG cx, _In_ ULONG cy, _In_ ULONG iFormat, _In_ ULONG fjBitmap, _In_opt_ ULONG cjWidth, _In_opt_ ULONG cjBufSize, _In_opt_ PVOID pvBits)
Definition: surface.c:116
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
int ret
_In_ SURFOBJ _In_ CLIPOBJ * pco
Definition: winddi.h:3414
ENGAPI BOOL APIENTRY EngCopyBits(_In_ SURFOBJ *psoDest, _In_ SURFOBJ *psoSrc, _In_opt_ CLIPOBJ *pco, _In_opt_ XLATEOBJ *pxlo, _In_ __in_data_source(USER_MODE) RECTL *prclDest, _In_ __in_data_source(USER_MODE) POINTL *pptlSrc)
_In_opt_ SURFOBJ _In_opt_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL _In_opt_ POINTL _In_opt_ POINTL * pptlMask
Definition: winddi.h:3433
Definition: xlate.c:8
_In_opt_ SURFOBJ _In_opt_ SURFOBJ * psoMask
Definition: winddi.h:3433
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 IntExtTextOutW().

◆ IntEngWindowChanged()

VOID FASTCALL IntEngWindowChanged ( _In_ struct _WND Window,
_In_ FLONG  flChanged 
)

Variable Documentation

◆ gajRop2ToRop3

const BYTE gajRop2ToRop3[16]

Definition at line 15 of file paint.c.