diff options
author | Pierre Ossman <ossman@cendio.se> | 2014-01-30 10:47:07 +0100 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2014-07-09 14:55:30 +0200 |
commit | c02c05d403f000d15f736458b8c26ad60b4811f0 (patch) | |
tree | 5716d8ffa9f75209cc1a5051b5d235e0407a5f7b /common/rfb/PixelFormat.h | |
parent | 761fe24089bfe95028b0da02a12650351b244165 (diff) | |
download | tigervnc-c02c05d403f000d15f736458b8c26ad60b4811f0.tar.gz tigervnc-c02c05d403f000d15f736458b8c26ad60b4811f0.zip |
Add optimised buffer conversion
Handles the common cases when the target or source are in
the preferred 888 format.
If one of the buffers is not 888, then it must also be properly
aligned (which is commonly the case). Performance is now in many
cases on par with PixelTransformer.
Diffstat (limited to 'common/rfb/PixelFormat.h')
-rw-r--r-- | common/rfb/PixelFormat.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/common/rfb/PixelFormat.h b/common/rfb/PixelFormat.h index b18045f7..113b8eef 100644 --- a/common/rfb/PixelFormat.h +++ b/common/rfb/PixelFormat.h @@ -90,6 +90,29 @@ namespace rfb { void updateState(void); bool isSane(void); + private: + // Preprocessor generated, optimised methods + + void directBufferFromBufferFrom888(rdr::U8* dst, const PixelFormat &srcPF, + const rdr::U8* src, int w, int h, + int dstStride, int srcStride) const; + void directBufferFromBufferFrom888(rdr::U16* dst, const PixelFormat &srcPF, + const rdr::U8* src, int w, int h, + int dstStride, int srcStride) const; + void directBufferFromBufferFrom888(rdr::U32* dst, const PixelFormat &srcPF, + const rdr::U8* src, int w, int h, + int dstStride, int srcStride) const; + + void directBufferFromBufferTo888(rdr::U8* dst, const PixelFormat &srcPF, + const rdr::U8* src, int w, int h, + int dstStride, int srcStride) const; + void directBufferFromBufferTo888(rdr::U8* dst, const PixelFormat &srcPF, + const rdr::U16* src, int w, int h, + int dstStride, int srcStride) const; + void directBufferFromBufferTo888(rdr::U8* dst, const PixelFormat &srcPF, + const rdr::U32* src, int w, int h, + int dstStride, int srcStride) const; + public: int bpp; int depth; |