diff options
Diffstat (limited to 'vncviewer')
-rw-r--r-- | vncviewer/PlatformPixelBuffer.cxx | 4 | ||||
-rw-r--r-- | vncviewer/PlatformPixelBuffer.h | 3 |
2 files changed, 7 insertions, 0 deletions
diff --git a/vncviewer/PlatformPixelBuffer.cxx b/vncviewer/PlatformPixelBuffer.cxx index 5bd50d2c..522bad3f 100644 --- a/vncviewer/PlatformPixelBuffer.cxx +++ b/vncviewer/PlatformPixelBuffer.cxx @@ -28,15 +28,19 @@ PlatformPixelBuffer::PlatformPixelBuffer(const rfb::PixelFormat& pf, void PlatformPixelBuffer::commitBufferRW(const rfb::Rect& r) { FullFramePixelBuffer::commitBufferRW(r); + mutex.lock(); damage.assign_union(rfb::Region(r)); + mutex.unlock(); } rfb::Rect PlatformPixelBuffer::getDamage(void) { rfb::Rect r; + mutex.lock(); r = damage.get_bounding_rect(); damage.clear(); + mutex.unlock(); return r; } diff --git a/vncviewer/PlatformPixelBuffer.h b/vncviewer/PlatformPixelBuffer.h index 21b93be4..795273a9 100644 --- a/vncviewer/PlatformPixelBuffer.h +++ b/vncviewer/PlatformPixelBuffer.h @@ -19,6 +19,8 @@ #ifndef __PLATFORMPIXELBUFFER_H__ #define __PLATFORMPIXELBUFFER_H__ +#include <os/Mutex.h> + #include <rfb/PixelBuffer.h> #include <rfb/Region.h> @@ -33,6 +35,7 @@ public: rfb::Rect getDamage(void); protected: + os::Mutex mutex; rfb::Region damage; }; |