diff options
author | Pierre Ossman <ossman@cendio.se> | 2014-02-12 16:33:43 +0100 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2014-07-14 16:00:20 +0200 |
commit | 6ea6e1aebcd29cd8b950179f0df52768d5ddbdaf (patch) | |
tree | 27cf997c6b62d08c36aa159fd74323b3f401e459 /common/rfb/VNCServerST.cxx | |
parent | 9cbdec67c9973faf950c0eb6ba56f927dfccaf6f (diff) | |
download | tigervnc-6ea6e1aebcd29cd8b950179f0df52768d5ddbdaf.tar.gz tigervnc-6ea6e1aebcd29cd8b950179f0df52768d5ddbdaf.zip |
Add helper class for a rendered cursor
Add a magical cursor framebuffer class for handling when you
want to render the cursor on the server side. Keeps the cursor
specific magic in one contained place.
Diffstat (limited to 'common/rfb/VNCServerST.cxx')
-rw-r--r-- | common/rfb/VNCServerST.cxx | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/common/rfb/VNCServerST.cxx b/common/rfb/VNCServerST.cxx index f1e378ed..27eb605a 100644 --- a/common/rfb/VNCServerST.cxx +++ b/common/rfb/VNCServerST.cxx @@ -294,7 +294,7 @@ void VNCServerST::setPixelBuffer(PixelBuffer* pb_, const ScreenSet& layout) comparer = new ComparingUpdateTracker(pb); cursor.setPF(pb->getPF()); - renderedCursor.setPF(pb->getPF()); + renderedCursorInvalid = true; // Make sure that we have at least one screen if (screenLayout.num_screens() == 0) @@ -598,15 +598,12 @@ bool VNCServerST::checkUpdate() if (renderCursor) { Rect clippedCursorRect - = cursor.getRect(cursorTL()).intersect(pb->getRect()); + = cursor.getRect(cursorPos.subtract(cursor.hotspot)).intersect(pb->getRect()); if (!renderedCursorInvalid && (toCheck.intersect(clippedCursorRect) .is_empty())) { renderCursor = false; } else { - renderedCursorTL = clippedCursorRect.tl; - renderedCursor.setSize(clippedCursorRect.width(), - clippedCursorRect.height()); toCheck.assign_union(clippedCursorRect); } } @@ -622,17 +619,7 @@ bool VNCServerST::checkUpdate() comparer->getUpdateInfo(&ui, pb->getRect()); if (renderCursor) { - const rdr::U8* buffer; - int stride; - - buffer = pb->getBuffer(renderedCursor.getRect(renderedCursorTL), &stride); - renderedCursor.imageRect(renderedCursor.getRect(), buffer, stride); - - buffer = cursor.getBuffer(cursor.getRect(), &stride); - renderedCursor.maskRect(cursor.getRect(cursorTL() - .subtract(renderedCursorTL)), - buffer, cursor.mask.buf); - + renderedCursor.update(pb, &cursor, cursorPos); renderedCursorInvalid = false; } |