ReactOS 0.4.16-dev-122-g325d74c
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
uint32_t ULONG
Definition: typedefs.h:59
_In_ PATHOBJ _In_ CLIPOBJ _In_ BRUSHOBJ _In_ POINTL _In_ MIX mix
Definition: winddi.h:3595

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 EX_PUSH_LOCK_LOCK_V
Definition: Object.c:28
#define FLT_ASSERT(_e)
Definition: fltkernel.h:49
#define InterlockedBitTestAndSet
Definition: interlocked.h:30
#define KeEnterCriticalRegion()
Definition: ke_x.h:88
VOID FASTCALL ExfAcquirePushLockExclusive(PEX_PUSH_LOCK PushLock)
Definition: pushlock.c:471
int32_t * PLONG
Definition: typedefs.h:58

◆ 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
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}
#define DPRINT1
Definition: precomp.h:8
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define _SEH2_END
Definition: filesup.c:22
#define _SEH2_TRY
Definition: filesup.c:19
unsigned int BOOL
Definition: ntddk_ex.h:94
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLsizei width
Definition: gl.h:1546
const GLubyte * c
Definition: glext.h:8905
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
Definition: glext.h:10929
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
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
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define c
Definition: ke_i.h:80
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:66
#define _SEH2_YIELD(__stmt)
Definition: pseh2_64.h:168
@ RLE_END
Definition: rlecomp.c:17
@ RLE_EOL
Definition: rlecomp.c:16
@ RLE_DELTA
Definition: rlecomp.c:18
static calc_node_t temp
Definition: rpn_ieee.c:38
int32_t INT
Definition: typedefs.h:58
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
#define BMF_8BPP
Definition: winddi.h:357
#define BMF_8RLE
Definition: winddi.h:362
#define BMF_4RLE
Definition: winddi.h:361
#define BMF_4BPP
Definition: winddi.h:356
static ULONG Delta
Definition: xboxvideo.c:33
static clock_t begin
Definition: xmllint.c:458
unsigned char BYTE
Definition: xxhash.c:193

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}
#define UInt32x32To64(a, b)
Definition: intsafe.h:252
#define Int64ShrlMod32(a, b)
#define KeQueryTickCount(CurrentCount)
Definition: ke.h:43
#define SharedUserData
ULONG LowPart
Definition: typedefs.h:106

◆ 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
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}
#define NULL
Definition: types.h:112
#define PAGE_READONLY
Definition: compat.h:138
#define PAGE_SIZE
Definition: env_spec_w32.h:49
VOID NTAPI ProbeForRead(IN CONST VOID *Address, IN SIZE_T Length, IN ULONG Alignment)
Definition: exintrin.c:102
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
PVOID NTAPI MmSecureVirtualMemory(IN PVOID Address, IN SIZE_T Length, IN ULONG Mode)
Definition: virtual.c:2794
static WCHAR Address[46]
Definition: ping.c:68
#define ALIGN_DOWN_POINTER_BY(ptr, align)
Definition: umtypes.h:82
#define ADDRESS_AND_SIZE_TO_SPAN_PAGES(_Va, _Size)

◆ 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 1103 of file bitblt.c.

1113{
1114 BOOLEAN ret;
1115 RECTL rcDest;
1116 POINTL ptMask = {0,0};
1117 PSURFACE psurfTemp;
1118 RECTL rcTemp;
1119
1120 ASSERT(psoDest);
1121 ASSERT(psoMask);
1122
1123 /* Is this a 1 BPP mask? */
1124 if (psoMask->iBitmapFormat == BMF_1BPP)
1125 {
1126 /* Use IntEngBitBlt with an appropriate ROP4 */
1127 return IntEngBitBlt(psoDest,
1128 NULL,
1129 psoMask,
1130 pco,
1131 pxloDest,
1132 prclDest,
1133 NULL,
1134 pptlMask,
1135 pbo,
1138 }
1139
1140 ASSERT(psoMask->iBitmapFormat == BMF_8BPP);
1141
1142 if (pptlMask)
1143 {
1144 ptMask = *pptlMask;
1145 }
1146
1147 /* Clip against the bounds of the clipping region so we won't try to write
1148 * outside the surface */
1149 if (pco != NULL)
1150 {
1151 /* Intersect with the clip bounds and check if everything was clipped */
1152 if (!RECTL_bIntersectRect(&rcDest, prclDest, &pco->rclBounds))
1153 {
1154 return TRUE;
1155 }
1156
1157 /* Adjust the mask point */
1158 ptMask.x += rcDest.left - prclDest->left;
1159 ptMask.y += rcDest.top - prclDest->top;
1160 }
1161 else
1162 {
1163 rcDest = *prclDest;
1164 }
1165
1166 /* Check if the target surface is device managed */
1167 if (psoDest->iType != STYPE_BITMAP)
1168 {
1169 rcTemp.left = 0;
1170 rcTemp.top = 0;
1171 rcTemp.right = rcDest.right - rcDest.left;
1172 rcTemp.bottom = rcDest.bottom - rcDest.top;
1173
1174 /* Allocate a temporary surface */
1176 rcTemp.right,
1177 rcTemp.bottom,
1178 psoDest->iBitmapFormat,
1179 0,
1180 0,
1181 0,
1182 NULL);
1183 if (psurfTemp == NULL)
1184 {
1185 return FALSE;
1186 }
1187
1188 /* Copy the current target surface bits to the temp surface */
1189 ret = EngCopyBits(&psurfTemp->SurfObj,
1190 psoDest,
1191 NULL, // pco
1192 NULL, // pxlo
1193 &rcTemp,
1194 (PPOINTL)&rcDest);
1195
1196 if (ret)
1197 {
1198 /* Do the operation on the temp surface */
1199 ret = EngMaskBitBlt(&psurfTemp->SurfObj,
1200 psoMask,
1201 NULL,
1202 pxloDest,
1203 pxloSource,
1204 &rcTemp,
1205 &ptMask,
1206 pbo,
1207 pptlBrushOrg);
1208 }
1209
1210 if (ret)
1211 {
1212 /* Copy the result back to the dest surface */
1213 ret = EngCopyBits(psoDest,
1214 &psurfTemp->SurfObj,
1215 pco,
1216 NULL,
1217 &rcDest,
1218 (PPOINTL)&rcTemp);
1219 }
1220
1221 /* Delete the temp surface */
1222 GDIOBJ_vDeleteObject(&psurfTemp->BaseObject);
1223 }
1224 else
1225 {
1226 /* Do the operation on the target surface */
1227 ret = EngMaskBitBlt(psoDest,
1228 psoMask,
1229 pco,
1230 pxloDest,
1231 pxloSource,
1232 &rcDest,
1233 &ptMask,
1234 pbo,
1235 pptlBrushOrg);
1236 }
1237
1238 return ret;
1239}
unsigned char BOOLEAN
#define ROP4_MASKPAINT
Definition: inteng.h:56
#define ASSERT(a)
Definition: mode.c:44
long bottom
Definition: polytest.cpp:53
long right
Definition: polytest.cpp:53
long top
Definition: polytest.cpp:53
long left
Definition: polytest.cpp:53
LONG y
Definition: windef.h:330
LONG x
Definition: windef.h:329
SURFOBJ SurfObj
Definition: surface.h:8
BASEOBJECT BaseObject
Definition: surface.h:6
int ret
BOOL APIENTRY IntEngBitBlt(SURFOBJ *psoTrg, SURFOBJ *psoSrc, SURFOBJ *psoMask, CLIPOBJ *pco, XLATEOBJ *pxlo, RECTL *prclTrg, POINTL *pptlSrc, POINTL *pptlMask, BRUSHOBJ *pbo, POINTL *pptlBrush, ROP4 Rop4)
Definition: bitblt.c:656
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:893
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
VOID NTAPI GDIOBJ_vDeleteObject(POBJ pobj)
Definition: gdiobj.c:1111
BOOL FASTCALL RECTL_bIntersectRect(_Out_ RECTL *prclDst, _In_ const RECTL *prcl1, _In_ const RECTL *prcl2)
Definition: rect.c:55
#define STYPE_BITMAP
Definition: winddi.h:1175
#define BMF_1BPP
Definition: winddi.h:355
_In_opt_ SURFOBJ _In_opt_ SURFOBJ * psoMask
Definition: winddi.h:3434
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 _In_opt_ BRUSHOBJ * pbo
Definition: winddi.h:3440
_In_opt_ SURFOBJ _In_opt_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL _In_opt_ POINTL _In_opt_ POINTL * pptlMask
Definition: winddi.h:3439
_In_ PATHOBJ _In_ CLIPOBJ _In_ BRUSHOBJ _In_ POINTL * pptlBrushOrg
Definition: winddi.h:3594
_In_ SURFOBJ _In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ RECTL * prclDest
Definition: winddi.h:3417
_In_ SURFOBJ _In_ CLIPOBJ * pco
Definition: winddi.h:3415

Referenced by IntExtTextOutW().

◆ IntEngWindowChanged()

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

Variable Documentation

◆ gajRop2ToRop3

const BYTE gajRop2ToRop3[16]
extern

Definition at line 15 of file paint.c.