17 #include <freerdp/config.h>
21 #include <freerdp/types.h>
22 #include <freerdp/primitives.h>
24 #include "prim_internal.h"
28 static pstatus_t general_set_8u(BYTE val, BYTE* pDst, UINT32 len)
30 memset((
void*)pDst, (
int)val, (
size_t)len);
31 return PRIMITIVES_SUCCESS;
35 static pstatus_t general_zero(
void* pDst,
size_t len)
38 return PRIMITIVES_SUCCESS;
42 static pstatus_t general_set_32s(INT32 val, INT32* pDst, UINT32 len)
54 return PRIMITIVES_SUCCESS;
61 prims = primitives_get();
65 size_t thiswidth = span;
67 if (thiswidth > remaining)
68 thiswidth = remaining;
70 const size_t s = thiswidth << 2;
71 WINPR_ASSERT(thiswidth <= INT32_MAX);
72 prims->copy_8u((BYTE*)dptr, (BYTE*)(dptr + span), (INT32)s);
73 remaining -= thiswidth;
77 return PRIMITIVES_SUCCESS;
81 static pstatus_t general_set_32u(UINT32 val, UINT32* pDst, UINT32 len)
93 return PRIMITIVES_SUCCESS;
100 prims = primitives_get();
104 size_t thiswidth = span;
106 if (thiswidth > remaining)
107 thiswidth = remaining;
109 const size_t s = thiswidth << 2;
110 WINPR_ASSERT(thiswidth <= INT32_MAX);
111 prims->copy_8u((BYTE*)dptr, (BYTE*)(dptr + span), (INT32)s);
112 remaining -= thiswidth;
116 return PRIMITIVES_SUCCESS;
120 void primitives_init_set(
primitives_t* WINPR_RESTRICT prims)
123 prims->set_8u = general_set_8u;
124 prims->set_32s = general_set_32s;
125 prims->set_32u = general_set_32u;
126 prims->zero = general_zero;
129 void primitives_init_set_opt(
primitives_t* WINPR_RESTRICT prims)
131 primitives_init_set_sse2(prims);