diff options
author | Jay Sorg <jay.sorg@gmail.com> | 2013-08-19 10:48:38 -0700 |
---|---|---|
committer | Jay Sorg <jay.sorg@gmail.com> | 2013-08-19 10:48:38 -0700 |
commit | 4a66be133f4e2dad7246baeb020f64dda4ce2d8c (patch) | |
tree | 998fd0acb750f927a7edcc51f237c4e55336b0e0 /xrdp/xrdp_cache.c | |
parent | f17692adaacc234f90db845e295946b5a68e511a (diff) | |
download | xrdp-proprietary-4a66be133f4e2dad7246baeb020f64dda4ce2d8c.tar.gz xrdp-proprietary-4a66be133f4e2dad7246baeb020f64dda4ce2d8c.zip |
CRC optimize
Diffstat (limited to 'xrdp/xrdp_cache.c')
-rw-r--r-- | xrdp/xrdp_cache.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/xrdp/xrdp_cache.c b/xrdp/xrdp_cache.c index cac7f114..52022546 100644 --- a/xrdp/xrdp_cache.c +++ b/xrdp/xrdp_cache.c @@ -136,6 +136,10 @@ xrdp_cache_reset(struct xrdp_cache *self, return 0; } +#define COMPARE_WITH_CRC(_b1, _b2) \ + _b1 != 0 && _b2 != 0 && _b1->crc == _b2->crc && _b1->bpp == _b2->bpp && \ + _b1->width == _b1->width && _b1->height == _b2->height + /*****************************************************************************/ /* returns cache id */ int APP_CC @@ -171,7 +175,8 @@ xrdp_cache_add_bitmap(struct xrdp_cache *self, struct xrdp_bitmap *bitmap, { #ifdef USE_CRC - if (xrdp_bitmap_compare_with_crc(self->bitmap_items[i][j].bitmap, bitmap)) + //if (xrdp_bitmap_compare_with_crc(self->bitmap_items[i][j].bitmap, bitmap)) + if (COMPARE_WITH_CRC(self->bitmap_items[i][j].bitmap, bitmap)) #else if (xrdp_bitmap_compare(self->bitmap_items[i][j].bitmap, bitmap)) #endif @@ -191,7 +196,8 @@ xrdp_cache_add_bitmap(struct xrdp_cache *self, struct xrdp_bitmap *bitmap, { #ifdef USE_CRC - if (xrdp_bitmap_compare_with_crc(self->bitmap_items[i][j].bitmap, bitmap)) + //if (xrdp_bitmap_compare_with_crc(self->bitmap_items[i][j].bitmap, bitmap)) + if (COMPARE_WITH_CRC(self->bitmap_items[i][j].bitmap, bitmap)) #else if (xrdp_bitmap_compare(self->bitmap_items[i][j].bitmap, bitmap)) #endif @@ -211,7 +217,8 @@ xrdp_cache_add_bitmap(struct xrdp_cache *self, struct xrdp_bitmap *bitmap, { #ifdef USE_CRC - if (xrdp_bitmap_compare_with_crc(self->bitmap_items[i][j].bitmap, bitmap)) + //if (xrdp_bitmap_compare_with_crc(self->bitmap_items[i][j].bitmap, bitmap)) + if (COMPARE_WITH_CRC(self->bitmap_items[i][j].bitmap, bitmap)) #else if (xrdp_bitmap_compare(self->bitmap_items[i][j].bitmap, bitmap)) #endif |