diff options
author | Pierre Ossman <ossman@cendio.se> | 2014-02-06 16:31:10 +0100 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2014-07-07 14:55:27 +0200 |
commit | a32040d7c9972f70272218effbc0242416d417d2 (patch) | |
tree | b6ef6c797262da99af6907154b014a65acb15b60 /vncviewer | |
parent | 2e5a10608394186fd1324c97b17d7f08e0c0aaf6 (diff) | |
download | tigervnc-a32040d7c9972f70272218effbc0242416d417d2.tar.gz tigervnc-a32040d7c9972f70272218effbc0242416d417d2.zip |
Provide a better R/W base PixelBuffer class
Clearly separates the read API from the write API
and also from actual implementation.
Diffstat (limited to 'vncviewer')
-rw-r--r-- | vncviewer/CConn.cxx | 2 | ||||
-rw-r--r-- | vncviewer/DesktopWindow.cxx | 4 | ||||
-rw-r--r-- | vncviewer/DesktopWindow.h | 2 | ||||
-rw-r--r-- | vncviewer/Viewport.cxx | 6 | ||||
-rw-r--r-- | vncviewer/Viewport.h | 5 |
5 files changed, 13 insertions, 6 deletions
diff --git a/vncviewer/CConn.cxx b/vncviewer/CConn.cxx index db1a08a5..c78bb891 100644 --- a/vncviewer/CConn.cxx +++ b/vncviewer/CConn.cxx @@ -470,7 +470,7 @@ rdr::U8* CConn::getRawBufferRW(const rfb::Rect& r, int* stride) { return desktop->getBufferRW(r, stride); } void CConn::releaseRawBuffer(const rfb::Rect& r) { - desktop->damageRect(r); + desktop->commitBufferRW(r); } diff --git a/vncviewer/DesktopWindow.cxx b/vncviewer/DesktopWindow.cxx index 3e9b57e6..a64f02a2 100644 --- a/vncviewer/DesktopWindow.cxx +++ b/vncviewer/DesktopWindow.cxx @@ -232,8 +232,8 @@ rdr::U8* DesktopWindow::getBufferRW(const rfb::Rect& r, int* stride) { return viewport->getBufferRW(r, stride); } -void DesktopWindow::damageRect(const rfb::Rect& r) { - viewport->damageRect(r); +void DesktopWindow::commitBufferRW(const rfb::Rect& r) { + viewport->commitBufferRW(r); } diff --git a/vncviewer/DesktopWindow.h b/vncviewer/DesktopWindow.h index 08a66522..83a8c767 100644 --- a/vncviewer/DesktopWindow.h +++ b/vncviewer/DesktopWindow.h @@ -55,7 +55,7 @@ public: void copyRect(const rfb::Rect& r, int srcX, int srcY); rdr::U8* getBufferRW(const rfb::Rect& r, int* stride); - void damageRect(const rfb::Rect& r); + void commitBufferRW(const rfb::Rect& r); void resizeFramebuffer(int new_w, int new_h); diff --git a/vncviewer/Viewport.cxx b/vncviewer/Viewport.cxx index d1d51622..70964b76 100644 --- a/vncviewer/Viewport.cxx +++ b/vncviewer/Viewport.cxx @@ -229,6 +229,7 @@ void Viewport::imageRect(const rfb::Rect& r, void* pixels) { pixelTrans->translateRect(pixels, r.width(), rfb::Rect(0, 0, r.width(), r.height()), buffer, stride, rfb::Point(0, 0)); + frameBuffer->commitBufferRW(r); } else { frameBuffer->imageRect(r, pixels); } @@ -244,6 +245,11 @@ rdr::U8* Viewport::getBufferRW(const rfb::Rect& r, int* stride) { return frameBuffer->getBufferRW(r, stride); } +void Viewport::commitBufferRW(const rfb::Rect& r) { + frameBuffer->commitBufferRW(r); + damageRect(r); +} + void Viewport::damageRect(const rfb::Rect& r) { damage.assign_union(rfb::Region(r)); if (!Fl::has_timeout(handleUpdateTimeout, this)) diff --git a/vncviewer/Viewport.h b/vncviewer/Viewport.h index bd17655a..e112efda 100644 --- a/vncviewer/Viewport.h +++ b/vncviewer/Viewport.h @@ -56,8 +56,7 @@ public: void copyRect(const rfb::Rect& r, int srcX, int srcY); rdr::U8* getBufferRW(const rfb::Rect& r, int* stride); - - void damageRect(const rfb::Rect& r); + void commitBufferRW(const rfb::Rect& r); void setCursor(int width, int height, const rfb::Point& hotspot, void* data, void* mask); @@ -72,6 +71,8 @@ public: private: + void damageRect(const rfb::Rect& r); + PlatformPixelBuffer* createFramebuffer(int w, int h); static void handleUpdateTimeout(void *data); |