Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FreeRDP/FreeRDP-old.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDorian Johnson <2011@dorianj.net>2011-06-21 19:23:17 +0400
committerDorian Johnson <2011@dorianj.net>2011-06-21 19:23:17 +0400
commit8c8c87094c43747395e63546d658ea39ef570ccf (patch)
treec305c75a32c9c056eed01d51f64ff8b01bbe3a3e
parent06814eabcf9d3fd24c8c68cfda6da8a118a640ae (diff)
libfreerdp-gdi: change gdi_copy_mem to simply use memcpy for better performance
gdi_copy_mem is a performance critical region, called for each scanline in many graphics routines. This patch changes it to simply call memcpy, which is far faster than a naive c loop. More performance could be squeezed out thru other methods, but this is low hanging fruit with no adverse affects or compilation requirements.
-rw-r--r--libfreerdp-gdi/gdi.c18
1 files changed, 1 insertions, 17 deletions
diff --git a/libfreerdp-gdi/gdi.c b/libfreerdp-gdi/gdi.c
index 402b0d2..8135caa 100644
--- a/libfreerdp-gdi/gdi.c
+++ b/libfreerdp-gdi/gdi.c
@@ -311,23 +311,7 @@ gdi_rop3_code(uint8 code)
void
gdi_copy_mem(uint8 * d, uint8 * s, int n)
{
- while (n & (~7))
- {
- *(d++) = *(s++);
- *(d++) = *(s++);
- *(d++) = *(s++);
- *(d++) = *(s++);
- *(d++) = *(s++);
- *(d++) = *(s++);
- *(d++) = *(s++);
- *(d++) = *(s++);
- n = n - 8;
- }
- while (n > 0)
- {
- *(d++) = *(s++);
- n--;
- }
+ memcpy(d, s, n);
}
void