Browse Source

Let CConnection intercept more callbacks

We need more callbacks for correct operation of multi-threaded
rect decoding.
tags/v1.6.90
Pierre Ossman 8 years ago
parent
commit
3da238dee8
5 changed files with 44 additions and 0 deletions
  1. 23
    0
      common/rfb/CConnection.cxx
  2. 9
    0
      common/rfb/CConnection.h
  3. 4
    0
      tests/decperf.cxx
  4. 4
    0
      tests/encperf.cxx
  5. 4
    0
      vncviewer/CConn.cxx

+ 23
- 0
common/rfb/CConnection.cxx View File

@@ -301,6 +301,29 @@ void CConnection::securityCompleted()
writer_->writeClientInit(shared);
}

void CConnection::setDesktopSize(int w, int h)
{
CMsgHandler::setDesktopSize(w,h);
}

void CConnection::setExtendedDesktopSize(unsigned reason,
unsigned result,
int w, int h,
const ScreenSet& layout)
{
CMsgHandler::setExtendedDesktopSize(reason, result, w, h, layout);
}

void CConnection::framebufferUpdateStart()
{
CMsgHandler::framebufferUpdateStart();
}

void CConnection::framebufferUpdateEnd()
{
CMsgHandler::framebufferUpdateEnd();
}

void CConnection::dataRect(const Rect& r, int encoding)
{
decoder.decodeRect(r, encoding, framebuffer);

+ 9
- 0
common/rfb/CConnection.h View File

@@ -92,6 +92,15 @@ namespace rfb {

// Methods overridden from CMsgHandler

// Note: These must be called by any deriving classes

virtual void setDesktopSize(int w, int h);
virtual void setExtendedDesktopSize(unsigned reason, unsigned result,
int w, int h,
const ScreenSet& layout);

virtual void framebufferUpdateStart();
virtual void framebufferUpdateEnd();
virtual void dataRect(const Rect& r, int encoding);



+ 4
- 0
tests/decperf.cxx View File

@@ -99,11 +99,15 @@ void CConn::setCursor(int, int, const rfb::Point&, void*, void*)

void CConn::framebufferUpdateStart()
{
CConnection::framebufferUpdateStart();

startCpuCounter();
}

void CConn::framebufferUpdateEnd()
{
CConnection::framebufferUpdateEnd();

endCpuCounter();

cpuTime += getCpuCounter();

+ 4
- 0
tests/encperf.cxx View File

@@ -208,6 +208,8 @@ void CConn::setCursor(int, int, const rfb::Point&, void*, void*)

void CConn::framebufferUpdateStart()
{
CConnection::framebufferUpdateStart();

updates.clear();
startCpuCounter();
}
@@ -218,6 +220,8 @@ void CConn::framebufferUpdateEnd()
rfb::PixelBuffer* pb = getFramebuffer();
rfb::Region clip(pb->getRect());

CConnection::framebufferUpdateEnd();

endCpuCounter();

decodeTime += getCpuCounter();

+ 4
- 0
vncviewer/CConn.cxx View File

@@ -342,6 +342,8 @@ void CConn::setName(const char* name)
// one.
void CConn::framebufferUpdateStart()
{
CConnection::framebufferUpdateStart();

// Note: This might not be true if sync fences are supported
pendingUpdate = false;

@@ -357,6 +359,8 @@ void CConn::framebufferUpdateStart()
// appropriately, and then request another incremental update.
void CConn::framebufferUpdateEnd()
{
CConnection::framebufferUpdateEnd();

Fl::remove_timeout(handleUpdateTimeout, this);
desktop->updateWindow();


Loading…
Cancel
Save